« lib/App/SeismicUnixGui/misc/perl_use_pkg.pm
↑ Summary
lib/App/SeismicUnixGui/misc/pod_declare.pm »
| 1 | package App::SeismicUnixGui::misc::plot; | ||
| 2 | |||
| 3 | # Contains methods/subroutines/functions to plot data | ||
| 4 | # V 1. Dec 10 2010 | ||
| 5 | # Juan M. Lorenzo | ||
| 6 | |||
| 7 | sub Gnuplot_Geo_enz_file { | ||
| 8 | |||
| 9 | my ($ref_file_name) = shift @_; | ||
| 10 | |||
| 11 | open( GNUPLOT, "| /usr/bin/gnuplot -persist; unset term" ); | ||
| 12 | print( GNUPLOT " \\ | ||
| 13 | set mouse verbose; \\ | ||
| 14 | set term X11; \\ | ||
| 15 | set autoscale; \\ | ||
| 16 | unset log ; \\ | ||
| 17 | unset label ; \\ | ||
| 18 | set xtic auto ; \\ | ||
| 19 | set ytic auto ; \\ | ||
| 20 | set key 0.01,100; \\ | ||
| 21 | set title \"Plot Source Geometry for $$ref_file_name\"; \\ | ||
| 22 | set xlabel \"Easting UTM Z=15 (centimeters)\"; \\ | ||
| 23 | set ylabel \"Northing (centimeters)\"; \\ | ||
| 24 | plot \"$$ref_file_name\" using 2:3 with points; \\ | ||
| 25 | pause mouse; \\ | ||
| 26 | \n" | ||
| 27 | ); | ||
| 28 | close(GNUPLOT); | ||
| 29 | print("\nGnu Plot of $$ref_file_name \n"); | ||
| 30 | |||
| 31 | } | ||
| 32 | |||
| 33 | #set xr [709700:400]; \\ | ||
| 34 | #set yr [0:400]; \\ | ||
| 35 | sub Gnuplot_Sp_enz_file { | ||
| 36 | |||
| 37 | my ($ref_file_name) = shift @_; | ||
| 38 | |||
| 39 | #set term X11; \\ | ||
| 40 | open( GNUPLOT, "| /usr/bin/gnuplot -persist; unset term" ); | ||
| 41 | print( GNUPLOT " \\ | ||
| 42 | set mouse verbose; \\ | ||
| 43 | set autoscale; \\ | ||
| 44 | unset log ; \\ | ||
| 45 | unset label ; \\ | ||
| 46 | set xtic auto ; \\ | ||
| 47 | set ytic auto ; \\ | ||
| 48 | set key 0.01,100; \\ | ||
| 49 | set title \"Plot Shotpoint Geometry for $$ref_file_name\"; \\ | ||
| 50 | set xlabel \"Easting UTM Z=15 (centimeters)\"; \\ | ||
| 51 | set ylabel \"Northing (centimeters)\"; \\ | ||
| 52 | plot \"$$ref_file_name\" using 2:3 with points; \\ | ||
| 53 | pause mouse; \\ | ||
| 54 | \n" | ||
| 55 | ); | ||
| 56 | close(GNUPLOT); | ||
| 57 | print("\nGnu Plot of $$ref_file_name \n"); | ||
| 58 | } | ||
| 59 | |||
| 60 | sub Gnuplot_1col { | ||
| 61 | |||
| 62 | my ($ref_file_name) = shift @_; | ||
| 63 | |||
| 64 | #set term X11; \\ | ||
| 65 | open( GNUPLOT, "| /usr/bin/gnuplot -persist; unset term" ); | ||
| 66 | print( GNUPLOT " \\ | ||
| 67 | set mouse verbose; \\ | ||
| 68 | set autoscale; \\ | ||
| 69 | unset log ; \\ | ||
| 70 | unset label ; \\ | ||
| 71 | set xtic auto ; \\ | ||
| 72 | set ytic auto ; \\ | ||
| 73 | set title \" $$ref_file_name\"; \\ | ||
| 74 | set xlabel \"Xlabel\"; \\ | ||
| 75 | set ylabel \"Ylabel\"; \\ | ||
| 76 | plot \"$$ref_file_name\" using 1 with points; \\ | ||
| 77 | pause mouse; \\ | ||
| 78 | \n" | ||
| 79 | ); | ||
| 80 | close(GNUPLOT); | ||
| 81 | print("\nGnu Plot of $$ref_file_name \n"); | ||
| 82 | |||
| 83 | } | ||
| 84 | |||
| 85 | sub Gnuplot_2cols { | ||
| 86 | |||
| 87 | my ( $ref_file_name, $xlabel, $ylabel ) = @_; | ||
| 88 | |||
| 89 | #set logscale y ; \\ | ||
| 90 | open( GNUPLOT, "| /usr/bin/gnuplot -persist; unset term" ); | ||
| 91 | print( GNUPLOT " \\ | ||
| 92 | set mouse verbose; \\ | ||
| 93 | set autoscale; \\ | ||
| 94 | unset label ; \\ | ||
| 95 | set xtic auto ; \\ | ||
| 96 | set ytic auto ; \\ | ||
| 97 | set title \"$$ref_file_name\"; \\ | ||
| 98 | set xlabel \"$xlabel\"; \\ | ||
| 99 | set ylabel \"$ylabel\"; \\ | ||
| 100 | plot \"$$ref_file_name\" using 1:2 with points; \\ | ||
| 101 | pause mouse; \\ | ||
| 102 | \n" | ||
| 103 | ); | ||
| 104 | |||
| 105 | #set key 0.01,100; \\ | ||
| 106 | close(GNUPLOT); | ||
| 107 | print("\nGnu Plot of $$ref_file_name \n"); | ||
| 108 | |||
| 109 | } | ||
| 110 | |||
| 111 | sub Gnuplot_3cols { | ||
| 112 | |||
| 113 | my ( $ref_file_name, $xlabel, $ylabel, $zlabel ) = @_; | ||
| 114 | |||
| 115 | #set logscale y ; \\ | ||
| 116 | open( GNUPLOT, "| /usr/bin/gnuplot -persist; unset term" ); | ||
| 117 | print( GNUPLOT " \\ | ||
| 118 | set mouse verbose; \\ | ||
| 119 | set autoscale; \\ | ||
| 120 | unset label ; \\ | ||
| 121 | set xtic auto ; \\ | ||
| 122 | set ytic auto ; \\ | ||
| 123 | set key 0.01,100; \\ | ||
| 124 | set title \"$$ref_file_name\"; \\ | ||
| 125 | set xlabel \"$xlabel\"; \\ | ||
| 126 | set ylabel \"$ylabel\"; \\ | ||
| 127 | set zlabel \"$zlabel\"; \\ | ||
| 128 | splot \"$$ref_file_name\" u 1:2:3 with linespoints; \\ | ||
| 129 | pause mouse; \\ | ||
| 130 | \n" | ||
| 131 | ); | ||
| 132 | close(GNUPLOT); | ||
| 133 | print("\nGnu Plot of $$ref_file_name \n"); | ||
| 134 | |||
| 135 | } | ||
| 136 | 1; |