#! /bin/csh -fe 

set usage = "$0 MAXDIST MATCHPLOTFILE NONMATCHPLOTFILE"

set maxDist = "$1"; shift
set mtc = "$1"; set mtc = "${mtc:r}"; shift
set nom = "$1"; set nom = "${nom:r}"; shift

set out = "${mtc}.ps"

gnuplot <<EOF
set terminal X11
set output "${out}"
set title "avgDist × totChainLength  maxDist = ${maxDist}"
plot \
  "$nom.plt" using 7:9 title "non-matching ${nom}" with points, \
  "$mtc.plt" using 7:9 title "matching ${mtc}"     with points
pause 60
quit
EOF
# ghostview -openwindows -landscape "${out}"
echo "plot done"
