#! /bin/sh FILE=$1 TMP=$(mktemp -d /tmp/tmp.XXXXXX) function error { cat 1>&2 exit 1 rm -rf $TMP } if ! cols=$(grep "#[ ]*COLUMNS" $FILE) then error < $TMP/gnuplot.script < $TMP/events cat $TMP/events | while read event x text do if ! [ $event = "EVENT" ] then cat 1>&2 <> $TMP/gnuplot.script echo "set label \"$text\" at $x, graph 0.$height_text center" >> $TMP/gnuplot.script height=$(($height + 8)) done # Set Key echo "set key left top box lt 0" >> $TMP/gnuplot.script # Plot the data echo "plot '$FILE' using 1:2 title \"${column[$count]}\" $with" >> $TMP/gnuplot.script count=3 while [ $count -le $columns ] do echo "replot '$FILE' using 1:$count title \"${column[$count]}\" $with" \ >> $TMP/gnuplot.script count=$(($count + 1)) done ( cat $TMP/gnuplot.script; cat ) | gnuplot rm -rf $TMP