[pstricks] A little help deciphering code and a question
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Tue May 6 08:58:03 CEST 2014
Am 05.05.2014 19:34, schrieb Scott, Randy:
> And finally realized that \pscustom was finishing the horizontal line at (2,2), then jumping down to (0,2) to begin the parabola.
>
> When I changed this to
>
> \definecolor{SuperLightBlue}{cmyk}{0.2,0,0,0}
> \pscustom[fillstyle=solid,fillcolor=SuperLightBlue,
> linestyle=none]
> {
> \psplot{0}{2}{2}
> \psplot{2}{0}{0.25*x^2+1}
> }
>
> so the parabola is being drawn from (2,2) to (0,2), everything worked great.
Use \lineto or \moveto for lines (\closepath draws a strait line to the
beginning of the path):
\documentclass{article}
\usepackage{pst-plot}
\definecolor{SuperLightBlue}{cmyk}{0.2,0,0,0}
\begin{document}
\begin{pspicture}(4,4)
\psaxes{->}(4,3)
\pscustom[fillstyle=solid,fillcolor=SuperLightBlue,linecolor=blue]{%
\moveto(0,2)
\psplot[algebraic]{2}{0}{0.25*x^2+1}% x=2...0
\closepath
}
\end{pspicture}
\begin{pspicture}(4,4)
\psaxes{->}(4,3)
\pscustom[fillstyle=solid,fillcolor=SuperLightBlue,linecolor=blue]{%
\psplot[algebraic]{0}{2}{0.25*x^2+1}% x=0...2
\lineto(0,2)
\closepath
}
\end{pspicture}
\end{document}
Herbert
More information about the PSTricks
mailing list