1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/bin/bash
#plot of V/F against depth and B# - use plotR for rays (useful for cones)
if [ ! -n "$1" ]; then
echo "usage: % plotV lrs_output_file [ maxdepth [ maxcobases ] ]"
exit 1
fi
#strip out first four fields from cobasis lines
grep "V#" $1 | sed -n '/V#/s/V#//;s/R#//;s/B#//;s/h=//;s/f.*//p' > $1Vhist
#get maxdepth from file if not supplied
if [ ! -n "$2" ]; then
maxd=$(grep -i "tree depth" $1 | awk '{print $NF}')
else
maxd=$2
fi
#get maxcobases from file if not supplied
if [ ! -n "$3" ]; then
maxB=$(tail -n 1 $1Vhist | awk '{print $3}')
else
maxB=$3
fi
echo "$maxd $maxB"
gnuplot -persist <<EOF
set terminal postscript enhanced color
set output 'plotV.ps'
set autoscale
set xlabel "V#"
set title "V# vs height"
set ylabel "height"
set yrange [0:$maxd]
plot '$1Vhist' using 1:4
set title "V# vs B#"
set ylabel "B#"
set yrange [0:$maxB]
plot '$1Vhist' using 1:3
EOF
rm -f $1Vhist
ps2pdf plotV.ps $1V.pdf
rm plotV.ps
|