#! /bin/sh # levelgraph < data-file > image-file img=png while [ $# -gt 0 ]; do case $1 in -png) img=png; shift ;; -pbm) img=pbm; shift ;; -gif) img=gif; shift ;; esac done sed -n " 1 w /tmp/params /^Levels Histogram/,/Totals/{ /^[0-9].*:/w /tmp/test } /Level Totals/w /tmp/stats " tr ":\t " " \n" /tmp/data params=`cat /tmp/params` name=`sed 's/:.*//' /tmp/params` edges=`sed 's/^.*Edges.*= *//' /tmp/stats` stats=`sed 's/^.*: //;s/;.*//' /tmp/stats` title="$params Edges=$edges Levels:$stats" Xlast=`wc -l < /tmp/data` #Xlast=`expr $Xlast - 1` gnuplot - << EOF 2>/tmp/gplog set terminal $img color; set output set x2label "$title" set xlabel "Level" set ylabel "Count" #set boxwidth .5 #plot [.5:$Xlast] "/tmp/data" t "datafile" with boxes plot [0:$Xlast] [0:] "/tmp/data" every ::1 t "datafile" with boxes EOF