aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/btl/data/mk_new_gnuplot.sh
blob: e6c35597a7db7a14c501448d93ff39e04dfb1b8c (plain)
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
#! /bin/bash
WHAT=$1
DIR=$2

cat ../gnuplot_common_settings.hh > ${WHAT}.gnuplot
cat ../${WHAT}.hh >> ${WHAT}.gnuplot

DATA_FILE=`cat ../order_lib`
echo set term postscript color rounded enhanced >> $WHAT.gnuplot
echo set output "'"../${DIR}/$WHAT.ps"'" >> $WHAT.gnuplot

echo plot \\ >> $WHAT.gnuplot

for FILE in $DATA_FILE
do
    LAST=$FILE
done

for FILE in $DATA_FILE
do
    BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}

    echo "'"$FILE"'" `grep $TITLE ../perlib_plot_settings.txt | head -n 1 | cut -d ";" -f 2` "\\" >>  $WHAT.gnuplot
    if [ $FILE != $LAST ]
    then
      echo ", \\" >>  $WHAT.gnuplot
    fi
done
echo " " >>  $WHAT.gnuplot

gnuplot -persist < $WHAT.gnuplot

rm $WHAT.gnuplot

ps2pdf ../${DIR}/$WHAT.ps ../${DIR}/$WHAT.pdf
convert -density 120 -rotate 90 -resize 800 +dither -colors 48 -quality 0 ../${DIR}/$WHAT.ps ../${DIR}/$WHAT.png