#! /bin/bash
# Last edited on 2013-01-07 23:20:13 by stolfilocal

# Plots the lanczos interpolation

rad=$1; shift

prefix="out/lanczos"
radprefix=`printf "%s-r%02d" "${prefix}" "${rad}"`
  
export GDFONTPATH=.

gnuplot <<EOF

set term svg size 720,320 font "arialbd,12" rounded dashed
set output "${radprefix}-filtering.svg" 
set xrange [-0.5:15.5]
set yrange [-0.45:2.25]
set nokey
set format y ""
unset ytics
set xtics 1 nomirror
set style line 10 lt 1 lw 2 lc rgb '#888888'
set border 1 ls 10

plot \
  (0)                                    with lines    lw 2 lt 3     lc rgb '#888888', \
  "${prefix}-samples.txt"      using 1:2 with impulses lw 1 lt 3     lc rgb '#888888', \
  "${radprefix}-interp.txt"    using 1:2 with lines    lw 2 lt 1     lc rgb '#0022ff', \
  "${radprefix}-kern-t004.txt" using 1:2 with lines    lw 2 lt 4     lc rgb '#cc2200', \
  "${radprefix}-kern-t011.txt" using 1:2 with lines    lw 2 lt 4     lc rgb '#117700', \
  "${prefix}-samples.txt"      using 1:2 with points   ps 0.75 pt 7  lc rgb '#000000'
  
quit
gnuplot <<EOF

EOF
