#! /bin/csh -fe
# Last edited on 1998-11-03 22:22:56 by stolfi

set file = "$1"

set ofile = "${file:r}"
set ofile = "${ofile:t}"
#  "< gawk '/^[^#]/ {print log(\$1)/log(10),(\$3==0?0:log(\$3)/log(10))}' ${file}-fpw.plt"
gnuplot <<EOF
# set terminal postscript
# set output "${ofile}-fpw.ps"
plot \
  "< gawk '/^[^#]/ {print \$1,\$3;}' ${file}-fpw.plt" \
  using 1:2 title "freqs" \
  with impulses
pause 100
quit
EOF

# ghostview ${ofile}-fpw.ps

gnuplot <<EOF
# set terminal postscript
# set output "${file}-bpw.ps"
plot \
  "< gawk '/^[^#]/ {print log(\$2)/log(10),(\$3==0?0:log(\$3)/log(10))}' $file-bpw.plt" \
  using 1:2 title "freqs" \
  with impulses
pause 100
quit
EOF

# ghostview ${ofile}-bpw.ps
