[pstricks] multido in psplot

Aydin Ustun austun at selcuk.edu.tr
Fri Feb 25 16:38:30 CET 2005


Great thanks Herbert,

It is working very well.


Herbert Voss wrote:

> Aydin Ustun wrote:
>
>> I want to use multido in psplot to write a function with multi-term. 
>> Although latex compiler works without any problem, postscript viewer 
>> does not display the function.
>>
>> What is the problem?
>
>
> sorry, forgot the code
>
> \documentclass[12pt,a4paper]{article}
> \usepackage{pst-plot}
> \usepackage{amsmath}
>
> \begin{document}
> \psset{xunit=2cm,yunit=2cm}
> \begin{pspicture}(-2.25,-1.25)(2.5,1.5)%\psgrid
>  \psaxes[Dx=0.5,Dy=0.5]{->}(0,0)(-2.1,-1.1)(2.5,1.5)
>  \uput[45](2.5,0){$x$}
>  \uput[90](0,1.5){$g(x)$}
>  \psline[linewidth=2pt](-0.05,-1)(0,-1)(0,1)(1,1)(1,-1)(2,-1)(2,1)(2.05,1) 
>
>  \psplot[linecolor=red,plotpoints=400,linewidth=.5pt]{-2.25}{2.25}{180 
> x mul sin 4 mul 3.14159 div}
>  \psplot[linecolor=blue,plotpoints=400,linewidth=.5pt]{-0.25}{2.25}{%
>    180 x mul sin
>    3 2 13 {
>    /iA exch def
>    iA 180 mul x mul sin iA div add
>    } for
>    4 mul 3.14159 div}
> \end{pspicture}
> \end{document}
>
>
> Herbert
>
>




More information about the PSTricks mailing list