2011年10月19日水曜日

gnuplot 2つの要素をプロット

#! /bin/tcsh -f
################################################
#plot_axcel1
################################################
read_file=output_axcelrv.dat
plot_file1=axcel_pmin
plot_file2=axcel_avcwc
plot_file3=axcel_vmax
################################################
plot_file11=axcel_pmin_vamx
plot_file12=axcel_pmin_cwc
plot_file13=axcel_vamx_cwc
################################################
################################################


gnuplot <<EOF
################################################
################################################
plot "${read_file}" using 1:2 with line title "${plot_file1}" linetype 3 linecolor rgbcolor "red" linewidth 3
set title "${plot_file1}"
set xlabel "time step [h]"
set ylabel "[hPa]"
set term postscript
set output "${plot_file1}.ps"
replot
################################################
plot "${read_file}" using 1:6 with line title "${plot_file2}" linetype 3 linecolor rgbcolor "blue" linewidth 3
set title "${plot_file2}"
set xlabel "time step [h]"
set ylabel "[g/m2]"
set term postscript
set output "${plot_file2}.ps"
replot
################################################
plot "${read_file}" using 1:5 with line title "${plot_file3}" linetype 3 linecolor rgbcolor "green" linewidth 3
set title "${plot_file3}"
set xlabel "time step [h]"
set ylabel "[m/s]"
set term postscript
set output "${plot_file3}.ps"
replot
################################################
### double plot#################################
################################################
set yrange [990:1010]
set y2range [0:30]
plot "${read_file}" using 1:2 axis x1y1 with line title "${plot_file1}" linetype 3 linecolor rgbcolor "red" linewidth 3,\
"${read_file}" using 1:5  axis x1y2 with line title "${plot_file3}" linetype 3 linecolor rgbcolor "green" linewidth 3
set y2tics 0, 5
set ytics nomirror
set xlabel "time step [h]"
set ylabel "[hPa]"
set y2label "[m/s]"
set term postscript
set output "${plot_file11}.ps"
replot
################################################
set yrange [990:1010]
set y2range [0:0.1]
plot "${read_file}" using 1:2 axis x1y1 with line title "${plot_file1}" linetype 3 linecolor rgbcolor "red" linewidth 3,\
"${read_file}" using 1:6  axis x1y2 with line title "${plot_file2}" linetype 3 linecolor rgbcolor "blue" linewidth 3
set y2tics 0, 0.02
set ytics nomirror
set xlabel "time step [h]"
set ylabel "[hPa]"
set y2label "[g/m2]"
set term postscript
set output "${plot_file12}.ps"
replot
################################################
set yrange [0:30]
set y2range [0:0.1]
plot "${read_file}" using 1:5 axis x1y1 with line title "${plot_file3}" linetype 3 linecolor rgbcolor "green" linewidth 3,\
"${read_file}" using 1:6  axis x1y2 with line title "${plot_file2}" linetype 3 linecolor rgbcolor "blue" linewidth 3
set y2tics 0, 0.02
set ytics nomirror
set xlabel "time step [h]"
set ylabel "[m/s]"
set y2label "[g/m2]"
set term postscript
set output "${plot_file13}.ps"
replot
################################################
EOF

################################################
################################################
################################################
################################################
################################################
### make pdf ###################################
################################################
################################################
################################################
################################################
################################################

ps2pdf ${plot_file1}.ps 1_${plot_file1}.pdf
rm ${plot_file1}.ps

ps2pdf ${plot_file2}.ps 2_${plot_file2}.pdf
rm ${plot_file2}.ps

ps2pdf ${plot_file3}.ps 3_${plot_file3}.pdf
rm ${plot_file3}.ps

ps2pdf ${plot_file11}.ps 11_${plot_file11}.pdf
rm ${plot_file11}.ps

ps2pdf ${plot_file12}.ps 12_${plot_file12}.pdf
rm ${plot_file12}.ps

ps2pdf ${plot_file13}.ps 13_${plot_file13}.pdf
rm ${plot_file13}.ps

0 件のコメント:

コメントを投稿