[pstricks] Using ps code in psplot's limits

Alan Ristow ristow at ece.gatech.edu
Fri Mar 7 22:38:45 CET 2008


Hubert Lam wrote:
> Given that the usage of \psplot (excluding options) is
> 
> \psplot{x_min}{x_max}{PS code for function}
> 
> 
> is there a mechanism that I'm not aware of that will allow the effects 
> of this:
> 
> \usepackage{pstricks,pst-math}
> \def\PiFour{PI 4 div}
> \psplot{0}{\PiFour}{x SIN}

Yes. I suppose there's more than one way to do it, but the way I would 
do this is (untested):

\usepackage{pstricks,pst-math}
\pstVerb{/PiFour PI 4 div def}
\psplot{0}{!PiFour}{x SIN}

The "!" tells \psplot to use raw postscript code to compute the max 
value. For that matter, you ought to be able to do (again, untested):

\usepackage{pstricks,pst-math}
\psplot{0}{!PI 4 div}{x SIN}

(I'm assuming PI and SIN are defined in pst-math -- I don't use that 
package myself.)

Alan




More information about the PSTricks mailing list