Home | History | Annotate | Download | only in data
      1 #!/bin/bash
      2 WHAT=$1
      3 DIR=$2
      4 
      5 cat ../gnuplot_common_settings.hh > ${WHAT}.gnuplot
      6 
      7 echo "set title " `grep ${WHAT} ../action_settings.txt | head -n 1 | cut -d ";" -f 2` >> $WHAT.gnuplot
      8 echo "set xlabel " `grep ${WHAT} ../action_settings.txt | head -n 1 | cut -d ";" -f 3` " offset 0,0" >> $WHAT.gnuplot
      9 echo "set xrange [" `grep ${WHAT} ../action_settings.txt | head -n 1 | cut -d ";" -f 4` "]" >> $WHAT.gnuplot
     10 
     11 if [ $# > 3 ]; then
     12   if [ "$3" == "tiny" ]; then
     13     echo "set xrange [2:16]" >> $WHAT.gnuplot
     14     echo "set nologscale" >> $WHAT.gnuplot
     15   fi
     16 fi
     17 
     18 
     19 
     20 DATA_FILE=`cat ../order_lib`
     21 echo set term postscript color rounded enhanced >> $WHAT.gnuplot
     22 echo set output "'"../${DIR}/$WHAT.ps"'" >> $WHAT.gnuplot
     23 
     24 # echo set term svg color rounded enhanced >> $WHAT.gnuplot
     25 # echo "set terminal svg enhanced size 1000 1000 fname \"Times\" fsize 36" >> $WHAT.gnuplot
     26 # echo set output "'"../${DIR}/$WHAT.svg"'" >> $WHAT.gnuplot
     27 
     28 echo plot \\ >> $WHAT.gnuplot
     29 
     30 for FILE in $DATA_FILE
     31 do
     32     LAST=$FILE
     33 done
     34 
     35 for FILE in $DATA_FILE
     36 do
     37     BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}
     38 
     39     echo "'"$FILE"'" `grep $TITLE ../perlib_plot_settings.txt | head -n 1 | cut -d ";" -f 2` "\\" >>  $WHAT.gnuplot
     40     if [ $FILE != $LAST ]
     41     then
     42       echo ", \\" >>  $WHAT.gnuplot
     43     fi
     44 done
     45 echo " " >>  $WHAT.gnuplot
     46 
     47 gnuplot -persist < $WHAT.gnuplot
     48 
     49 rm $WHAT.gnuplot
     50 
     51 ps2pdf ../${DIR}/$WHAT.ps ../${DIR}/$WHAT.pdf
     52 convert -background white -density 120 -rotate 90 -resize 800 +dither -colors 256 -quality 0 ../${DIR}/$WHAT.ps -background white -flatten  ../${DIR}/$WHAT.png
     53 
     54 # pstoedit -rotate -90 -xscale 0.8 -yscale 0.8 -centered -yshift -50 -xshift -100  -f plot-svg aat.ps  aat2.svg
     55