[pstricks] Re: \fill part of a figure

Herbert Voss Herbert.Voss at gmx.net
Tue Jun 14 20:47:44 CEST 2005


Mikhail wrote:
> I need to fill/shade/crosshatch part of a figure - for example, area
> underneath a standard normal curve.  Any thoughts on how to accomplish
> that?
> 
> I drew the curve using pst-func like this
> 
> \usepackage{pst-func}
> \begin{document}
> 
> \psset{yunit=5, xunit=1}
> \begin{pspicture}(-5,-0.5)(5,0.5)
> \tiny
> \psaxes[tickstyle=bottom]{-}(-4,0)(4,0)
> \psGauss[sigma=1,linecolor=blue,linewidth=0.5pt]{-3.5}{3.5}
> \end{pspicture}
> \end{document}
> 
> Say I want to shade the area under this curve to the right of 1.  I
> tried using \pscustom following an example in the Graphics Companion,
> but that doesn't seem to work with \psGauss.
> Any suggestions?

\documentclass{minimal}
\usepackage{pst-func}
\begin{document}

\psset{yunit=5, xunit=1}
\begin{pspicture}(-5,-0.5)(5,0.5)
   \psaxes[tickstyle=bottom](0,0)(-4,0)(4,0.01)
   \psGauss[sigma=1,linecolor=blue,linewidth=0.5pt]{-3.5}{3.5}
   \pscustom[fillstyle=solid,fillcolor=lightgray,sigma=1,linestyle=none]{
     \psGauss{1}{4}
     \psline(4,0)(1,0)(1,0.25) }
   \psGauss[sigma=1,linecolor=blue,linewidth=0.5pt]{-3.5}{3.5}
\end{pspicture}
\end{document}

the first one of psGauss is needed for the initialization,
the last one for painting the curve again in blue.

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