[pstricks] - plotstyle=line versus curve in pscustom

Herbert Voss Herbert.Voss at FU-Berlin.DE
Mon Oct 24 19:11:27 CEST 2011


Am 24.10.2011 16:55, schrieb Hensh, Richard:
> \documentclass[dvips]{minimal}
> \usepackage{pst-func}
> \usepackage{pstricks}
> %\input{rjh-local.tex}
> \newpsobject{myplot}{psplot}{%
>      ,plotstyle=curve%
>      ,plotpoints=200}
> \definecolor{DarkGreen}{rgb}{0.233,0.545,0.133}%
> \begin{document}
>
> \def\xmin{-5}\def\xmax{20}
> \def\ymin{-5}\def\ymax{20}
> \def\dommin{0}\def\dommax{\xmax}
> \psset{unit=4mm,plotpoints=200}
> \pstVerb{%
>      /f at x {dup 2 mul exch 1 atan Pi mul 180 div mul} def %

A short version:
     /f at x { dup 2 mul exch ATAN mul } def %


alternative
       /f at x {dup 2 mul exch 1 atan mul DegtoRad } def %



>      /y0 {4 Pi mul 3 div} def %
>      /x0 {3 sqrt} def %
>      /L at x {x0 sub 2 Pi mul mul x0 div y0 add} def %
>    }
>    \begin{center}
>    \begin{pspicture}(\xmin,\ymin)(\xmax,\ymax)
>    %\showgrid
>    \psaxes[ticks=none,labels=none,linewidth=1pt,linecolor=gray,arrows=->,arrowscale=1.5](0,0)(\xmin,\ymin)(\xmax,\ymax)
>    \psclip{\psframe[linestyle=none](\xmin,\ymin)(\xmax,\ymax)}
>      \myplot[linecolor=gray,linewidth=1.0pt,linestyle=dashed]{\xmin}{\xmax}{x}%
>      %%Function f(x)
>      \rput(!0 x0){\psCumIntegral[linecolor=blue,linewidth=2.0pt]{0}{\xmax}{f at x}}      \myplot[linecolor=gray,linewidth=1.0pt]{\xmin}{\xmax}{x L at x}%
>      %%Inverse function, f^{-1}(x)
>      {%
>      \psset{swapaxes=true}
>      \rput(!x0 0){\psCumIntegral[linecolor=DarkGreen,linewidth=2.0pt]{0}{\xmax}{f at x}}%
>      \myplot[linecolor=gray,linewidth=1.0pt]{\xmin}{\xmax}{x L at x}%
>      }%
>    \endpsclip
>    \SpecialCoor%
>    \pnode(!x0 y0){A}
>    \pnode(!y0 x0){B}

pstricks-add knows \psComment:

\endpsclip

   \psComment[ref=lb,nodesepA=2pt,arrowscale=1.5]{->}(5,10)(!x0 
y0){$(\sqrt{3},4\pi/3)$}

   \psComment[ref=lb,nodesepA=2pt,arrowscale=1.5]{->}(8,5)(!y0 
x0){$(4\pi/3,\sqrt{3})$}

   \psdots[linecolor=red,dotscale=1.125](A)(B)

   \uput{6pt}[-80](15,3){$y=f^{-1}(x)$}

   \uput{6pt}[0](-1,15){$y=f(x)$}

\end{pspicture}


Herbert


>    \psdots[linecolor=red,dotscale=1.125](A)(B)
>    {\psset{arrows=->,arrowscale=1.5}%
>    \psline(8,5)(B)
>    \psline(5,10)(A)
>    }%
>    \uput{3pt}[40](8,5){{$(4\pi/3,\sqrt{3})$}}
>    \uput{3pt}[60](5,10){{$(\sqrt{3},4\pi/3)$}}
>    \uput{6pt}[-80](15,3){{$y=f^{-1}(x)$}}
>    \uput{6pt}[0](-1,15){{$y=f(x)$}}
>    \NormalCoor
>    \end{pspicture}
>    \[ f(x) = \sqrt{3}+\int_0^x 2t\tan^{-1}t\, dt \]
>    \end{center}
> \end{document}



More information about the PSTricks mailing list