[pstricks] multido in psplot
Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
Fri Feb 25 13:43:24 CET 2005
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
--
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
More information about the PSTricks
mailing list