[pstricks] Parameterized graphics?

Alan Ristow ristow at ece.gatech.edu
Fri Dec 28 15:52:35 CET 2007


Johan Ekh wrote:
> Hi all,
> I try to create a parameterized illustration, i.e. a picture that can be 
> completely
> modified by changing the numerical values of some user defined parameters.
> I'd like to use constructs such as
> 
> \def\var1{174.2 6.5 sub 2 div }
> \multido{\n=0.0+22.5}{16}{%
> \uput{\var1}[\n](4,4){\psdot[dotsize=0.2](0,0)}}
> 
> but I get an error when running latex.

I only have a few moments so apologies if this doesn't make everything 
100% clear, but try:

\multido{\n=0.0+22.5}{16}{%
\uput{! 174.2 6.5 sub 2 div }[\n](4,4){\psdot[dotsize=0.2](0,0)}}

or:

\pstVerb{/var1 174.2 6.5 sub 2 div def}
\multido{\n=0.0+22.5}{16}{%
\uput{! var1}[\n](4,4){\psdot[dotsize=0.2](0,0)}}

Look up \pstVerb and ! in the PSTricks docs for more explanation. By the 
way, you cannot use numerals in TeX/LaTeX macro names, so \def\var1 is 
likely what caused your error.

Alan



More information about the PSTricks mailing list