#!/bin/sh
dat2eps(){
  dat=$1
  eps=$2
  cat <<EOF | gnuplot -
set terminal postscript eps
set output "$eps"
plot "$dat" notitle with dots
EOF
  mv $eps $eps.bak
  sed -e 's/1 setlinecap M 0 0 V stroke/7 setlinewidth M 7 0 V stroke/' $eps.bak > $eps
  rm $eps.bak
}
for type in gm ikeda logistic; do
case $type in
gm)
  for mu in -0.9 0.9; do
    dat=$type-mu$mu.dat; eps=$type-mu$mu.eps
    ./de -gm -mu $mu > $dat
    dat2eps $dat $eps
  done
  ;;
ikeda)
  for b in 0.88 0.99; do
    dat=$type-b$b.dat; eps=$type-b$b.eps
    ./de -ikeda -b $b > $dat
    dat2eps $dat $eps
  done
  ;;
logistic)
  for a in 3.88 3.99; do
    dat=$type-a$a.dat; eps=$type-a$a.eps
    ./de -logistic -a $a > $dat
    dat2eps $dat $eps
  done
  ;;
esac
done
