function genplot(x,y,plotname,xmin,xmax,ymax,dymin,dymax)

plot(x,y)
axis([xmin,xmax,0,ymax]);
title(sprintf('%s Potential Function',plotname));
eval(sprintf('print %s.ps -deps',plotname));
pause

yy = diff(y)./diff(x);
n = max(size(x));
xx = (x(1:n-1)+x(2:n))/2;

plot(xx,yy)
axis([xmin,xmax,dymin,dymax]);
title(sprintf('%s Influence Function',plotname));
eval(sprintf('print %s_infl.ps -deps',plotname));
pause

