2015-02-21 02:20:34 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# base name of the bench
|
|
|
|
|
# it reads $1.out
|
|
|
|
|
# and generates $1.pdf
|
|
|
|
|
WHAT=$1
|
2015-10-07 22:06:48 +08:00
|
|
|
bench=$2
|
2016-12-05 20:36:26 +08:00
|
|
|
settings_file=$3
|
2015-02-21 02:20:34 +08:00
|
|
|
|
|
|
|
|
header="rev "
|
|
|
|
|
while read line
|
|
|
|
|
do
|
|
|
|
|
if [ ! -z '$line' ]; then
|
|
|
|
|
header="$header \"$line\""
|
|
|
|
|
fi
|
2016-12-05 20:36:26 +08:00
|
|
|
done < $settings_file
|
2015-02-21 02:20:34 +08:00
|
|
|
|
|
|
|
|
echo $header > $WHAT.out.header
|
|
|
|
|
cat $WHAT.out >> $WHAT.out.header
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "set title '$WHAT'" > $WHAT.gnuplot
|
|
|
|
|
echo "set key autotitle columnhead outside " >> $WHAT.gnuplot
|
|
|
|
|
echo "set xtics rotate 1" >> $WHAT.gnuplot
|
|
|
|
|
|
|
|
|
|
echo "set term pdf color rounded enhanced fontscale 0.35 size 7in,5in" >> $WHAT.gnuplot
|
|
|
|
|
echo set output "'"$WHAT.pdf"'" >> $WHAT.gnuplot
|
|
|
|
|
|
2016-12-05 20:36:26 +08:00
|
|
|
col=`cat $settings_file | wc -l`
|
2015-02-21 02:20:34 +08:00
|
|
|
echo "plot for [col=2:$col+1] '$WHAT.out.header' using 0:col:xticlabels(1) with lines" >> $WHAT.gnuplot
|
|
|
|
|
echo " " >> $WHAT.gnuplot
|
|
|
|
|
|
|
|
|
|
gnuplot -persist < $WHAT.gnuplot
|
|
|
|
|
|
|
|
|
|
# generate a png file
|
2016-12-06 23:46:22 +08:00
|
|
|
convert -background white -density 1000 -resize 1000 -colors 256 -quality 0 $WHAT.pdf -background white -flatten $WHAT.png
|
2015-02-21 02:20:34 +08:00
|
|
|
|
|
|
|
|
# clean
|
2016-12-05 20:36:26 +08:00
|
|
|
rm $WHAT.out.header $WHAT.gnuplot
|