[pstricks] area filling

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Mar 28 08:49:25 CET 2009


Hi all,
a nice example for filling an area between two curves without
using psclip.

Herbert

\listfiles
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{pst-eucl,pstricks-add}
\begin{document}

\psset{xAxisLabel=$x$,yAxisLabel=$y$,PointName=none,plotpoints=1000}%
\def\F{x 2 mul sqrt}%
\def\f{x 2 sub dup mul 8 div 1 add}

\begin{psgraph}[ticksize=0,arrowscale=1.5,labels=none,linewidth=0.5pt]{->}%
   (0,0)(-0.1,-0,1)(8,5){0.5\linewidth}{0.5\linewidth}%
  \psplot{0}{8}{\F} \psplot{0}{8}{\f}%
%
\pstInterFF{\F}{\f}{1}{A}%
\pstInterFF{\F}{\f}{8}{B}%
%
\pscustom[linestyle=none,fillstyle=hlines,hatchsep=4pt,hatchcolor=blue]{%
  \code{ \psGetNodeCenter{A} \psGetNodeCenter{B} }
  \psplot{A.x}{B.x}{\F} \psplot{B.x}{A.x}{\f}
}
\end{psgraph}

\end{document}


More information about the PSTricks mailing list