[pstricks] Graphing function containing a parameter
Herbert Voss
LaTeX at zedat.fu-berlin.de
Sun Sep 18 00:30:19 CEST 2005
Poul Riis wrote:
> The tex-file below works fine... sometimes... - and sometimes it does not!
> If I change the parameter k to 0.5 it crashes even if 0.4973 and many
> other values are OK.
> If I change the documentclass to 'article' it crashes.
> Furthermore, I get the following (non-fatal) error message:
> Package xkeyval Error: `hatchsepinc' undefined in families `,pstricks-add'.
run the following code and then send the file list, which appears
at the end of the log file.
Herbert
\listfiles
\documentclass{article}
\usepackage{pstricks-add}
\pagestyle{empty}
\SpecialCoor
\newcommand{\plotfunctionwithoneparameter}[9]{%
\pstVerb{/#4 #5 def
/f { #4 mul sin } def
/g { sin #4 add} def }
\psset{linecolor=#9}%
\psplot[plotpoints=100]{#2}{#3}{x #1}%
\pnode(!#6 #6 #1){Q}%
\rput[tr](!#6 #7 add #6 #1 #8 add)%
{\rnode{P}{\color{#9}\psframebox[linecolor=#9]{$#4=#5$}}}
\ncarc[nodesep=2pt,linecolor=#9]{->}{P}{Q}}
\begin{document}
\psset{xunit=0.2mm,yunit=2.5cm}
\begin{pspicture}(0,-1)(360,2)
\psaxes[Dx=60,Dy=0.5,linewidth=1pt,labels=all,%
ticksize=-3pt 0]{->}(0,0)(0,-1)(360,2)
\plotfunctionwithoneparameter{f}{0}{360}{z}{2}{60}{50}{1.2}{red}
\plotfunctionwithoneparameter{g}{0}{360}{k}{0.5}{150}{50}{1.2}{green}
\end{pspicture}
\end{document}
More information about the PSTricks
mailing list