[pstricks] - plotstyle=line versus curve in pscustom
Hensh, Richard
hensh at math.msu.edu
Mon Oct 24 00:42:13 CEST 2011
The code below introduces an unwanted slanted line along the left-hand side of the resulting image. Changing the plotsyle from line to curve OR uncommenting the \newpath macro removes the unwanted line. Ran across this quite by accident but thought it might be worth mentioning.
BTW, finally picked up my copy of the new PSTricks book. Great job Herbert.
thanks
rick
\documentclass[10pt,dvips]{minimal}
\usepackage{pst-func}
\usepackage{pstricks}
\newpsobject{myplot}{psplot}{%
,plotstyle=line%
,plotpoints=200}
\begin{document}
\def\xmin{-5}\def\xmax{20}
\def\ymin{-5}\def\ymax{20}
\def\dommin{0}\def\dommax{\xmax}
\psset{unit=4mm}
\pstVerb{%
/f at x {dup 2 mul exch 1 atan Pi mul 180 div mul} 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](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}%
\pscustom[plotpoints=200,linecolor=gray,linewidth=0.0pt]{%
\translate(!0 x0)%
\psCumIntegral{0}{\xmax}{f at x}%
\stroke[linecolor=blue,linewidth=2.0pt]
%\newpath
\translate(!0 x0 neg)%
\myplot{\xmin}{\xmax}{x L at x}%
\stroke[linecolor=gray,linewidth=1.0pt]
}
\endpsclip
\SpecialCoor%
\psdots[linecolor=red,dotscale=1.125](!x0 y0)
\NormalCoor
\end{pspicture}
\end{center}
\end{document}
More information about the PSTricks
mailing list