1 #!/bin/bash 2 3 # base name of the bench 4 # it reads $1.out 5 # and generates $1.pdf 6 WHAT=$1 7 bench=$2 8 9 header="rev " 10 while read line 11 do 12 if [ ! -z '$line' ]; then 13 header="$header \"$line\"" 14 fi 15 done < $bench"_settings.txt" 16 17 echo $header > $WHAT.out.header 18 cat $WHAT.out >> $WHAT.out.header 19 20 21 echo "set title '$WHAT'" > $WHAT.gnuplot 22 echo "set key autotitle columnhead outside " >> $WHAT.gnuplot 23 echo "set xtics rotate 1" >> $WHAT.gnuplot 24 25 echo "set term pdf color rounded enhanced fontscale 0.35 size 7in,5in" >> $WHAT.gnuplot 26 echo set output "'"$WHAT.pdf"'" >> $WHAT.gnuplot 27 28 col=`cat $bench"_settings.txt" | wc -l` 29 echo "plot for [col=2:$col+1] '$WHAT.out.header' using 0:col:xticlabels(1) with lines" >> $WHAT.gnuplot 30 echo " " >> $WHAT.gnuplot 31 32 gnuplot -persist < $WHAT.gnuplot 33 34 # generate a png file 35 # convert -background white -density 120 -rotate 90 -resize 800 +dither -colors 256 -quality 0 $WHAT.ps -background white -flatten .$WHAT.png 36 37 # clean 38 rm $WHAT.out.header $WHAT.gnuplot