#!/bin/bash # # gnuplot multiple graph creation script # # # NOTES: # data files for some of the stuff i've been working on are in macintosh format. # in order to translate these into a nice unix format, you must do the following: # # mac to unix # tr '\r' '\n' < macfile > unixfile # # unix to mac # tr '\n' '\r' < unixfile > macfile # # # DATA: # the data used for this is in this format: #* #Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Zr Hf Si U Th Pb La Yb Y Ce Ca AlFe P Ti #GSWA 105018-11 1.7393e+4 TRAVERSE ST 1.4957e+4 7.061e+3 -4.13e+2 1.86673e+5 2.248e+4 1.47182e+5 1.995e+3 1.17e+2 1.013e+3 7.9e+1 6.37e+2 8.96e+2 4.32e+2 2.331e+3 8.07e+2 4.075e+3 1.259e+3 8.3e+1 #GSWA 105018-11 1.7394e+4 Step scanning 2 of 50 1.4954e+4 7.065e+3 -4.13e+2 1.93083e+5 2.4071e+4 1.38655e+5 2.374e+3 2.5e+2 1.194e+3 1.78e+2 4.47e+2 8.06e+2 5.76e+2 4.503e+3 2.59e+2 3.86e+3 2.428e+3 3.4e+1 # # # Eric Thern eric NOSPAM(at) thern.org # # v0.1 - June 30, 2003 # v0.2 - July 13, 2003 - updated script, added gerneration of headers to each portion # also added two separate versions of the output # # # run gnuplot # echo "running gnuplot creation script" index=$( grep 'Column' $1 | awk -F'\t' '{ORS=","; for (n=1; n <= NF; n++) print $n}' ) for ((count = 7; count <= 21; count = count + 1)); do title=$( echo $index | awk -F',' -v COUNT=$count '{print $COUNT}' ) echo "creating graphs $1-$title.png and $1-$title-csplines.png for element $title" echo "set xlabel \"Zircon position (Cross Section)\"; set ylabel \"Concentration of element\"; set title \"Concentration of $title across zircon grain plot number $1 with smooth csplines\"; set size 2.0,1.0; set log y; set data style linespoints; set terminal png small color; set output '$1-$title-csplines.png'; plot \"