#! /bin/csh -f
# Last edited on 1999-11-10 08:33:11 by hcgl

set usage = "$0 MAXVAL HISTFILE EPSFILE TITLE"

# Draws a histogram of the numerical curvatures
# The maximum value is assumed to be MAXVAL, with 25 bins
# on each side of the origin.

if ( $#argv != 4 ) then
  echo "usage: ${usage}"; exit 1
endif

set maxval = "$1"; shift
set hfile = "$1"; shift
set pfile = "$1"; shift
set title = "$1"; shift

echo "${hfile} -> ${pfile}"

/n/image/bin/gnuplot <<EOF
# set terminal X11
set terminal postscript eps "TimesRoman" 24
set output "${pfile}"
set boxwidth (${maxval}/25)
set size 1.5,0.60
set xrange [(-${maxval}*(1 + 0.6/25)):(+${maxval}*(1 + 0.6/25))]
# set xlabel "curvature (pixel^-1)"
set ylabel "samples"
set nokey
# set title "${title}"
plot "${hfile}" using 2:4 with boxes
# pause 30
quit
EOF

# /bin/ls -l ${inName}.ps