[pstricks] Drawing S- and Z-Curves

Rich Shepard rshepard at appl-ecosys.com
Sun Apr 26 02:01:21 CEST 2009


On Tue, 21 Apr 2009, Michael Sharpe wrote:

> For the bell shaped curve with value 1 at x=m, variance v, plotted
> from x=a to x=b, you could use
> \psplot[algebraic]{a}{b}{Ex(-(x-m)^2/v)}
> where, of course, specific numbers should be substituted for m, v, a, b.
>
> A similar expression can be constructed for the particular logistic
> curve (S-curve) you need, possibly expressed most simply using \tanh,
> written th in algebraic formulas. Eg
> \psplot[algebraic]{a}{b}{(1+th(x/2))/2}

Michael,

   Thank you very much. I have been unsuccessful looking for documentation on
how to use the algebraic option for \psplot. Trying to emulate the Gaussian
plot example on the PSTricks example pages, but without the embedded PS, my
latest attempt is here:

\documentclass[letterpaper,10pt]{article}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pst-add}
\usepackage{amsmath}
\pagestyle{empty}
%
\def\pshlabel#1{\footnotesize#1}\def\psvlabel#1{\footnotesize#1}
%
\begin{document}
\psset{yunit=4cm,xunit=4}
\begin{pspicture}(-2,0)(2,1)
   \psset{xunit=2, plotpoints=500, plotstyle=line}
   \uput[-90](2,0){x}\uput[0](0,1){y}
   \rput[lb](1,0.75){$\sigma =0.5$}
   % a=0.0 b=2.0 m=1.5 v=0.5
   \psplot[algebraic]{0.0}{2.0}{Ex(-(x-3.0)^2/0.5)}
\end{pspicture}
\end{document}

   And I would greatly appreciate a clue stick nudging me to the proper way
to write these.

Thanks,

Rich


More information about the PSTricks mailing list