#! /bin/bash
# Last edited on 2009-11-30 00:13:15 by stolfi

# Plots the sigmoid function {sigma(z)}


epsfile="/tmp/$$.eps"

gnuplot <<EOF
set term postscript eps color solid "TimesRoman" 24
set size 0.75,0.75
set output "${epsfile}"
set nokey

set xzeroaxis
set xtics 0.50 format "%+4.1f"
set mxtics 5
set grid xtics
set xrange[-1.2:+1.2]

set yrange [-1.2:+1.2]
set ytics 0.50 format "%+4.1f"
set grid ytics
set mytics 5

sigma(z)=(abs(z) > 1 ? 0/0 : sin(0.5*pi*sin(0.5*pi*z)))

plot sigma(x) notitle with lines lw 3.0 lt rgb '#227700'
quit
EOF

cat ${epsfile}
gv ${epsfile}
rm -f ${epsfile}
