[pstricks] multido in psplot

Aydin Ustun austun at selcuk.edu.tr
Fri Feb 25 12:35:05 CET 2005


Hi all,

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?

Thanks



\documentclass[12pt,a4paper]{article}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\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\space\multido{\iA=3+2}{5}{\iA\space 180 mul x mul sin 
\iA\space div add} 4 mul 3.14159 div}
\end{pspicture}
\end{document}




More information about the PSTricks mailing list