#! /bin/sh
SS -t sqrt -H sqrt.ss > table.html
printf "set term gif\nset output\nset key left top\nplot\
'sqrt.out' using 1:2 with points title 'sqrt',\
'sqrt.out' using 1:3 with lines title 'RP',\
'sqrt.out' using 1:5 with lines title 'TA1',\
'sqrt.out' using 1:7 with lines title 'TA2',\
'sqrt.out' using 1:9 with lines title 'LLSQ'\n" | gnuplot > all.gif
echo "3 RP
5 TA1
7 TA2
9 LLSQ" | while read i name
do
printf "set term gif\nset output\nset key left\nplot\
'sqrt.out' using 1:2 with points title 'sqrt',\
'sqrt.out' using 1:$i with lines title '$name'\n" | gnuplot > $name.gif
done
rm sqrt.out