[pstricks] psclip, psframe and area between two curves

Derek Collis iscah3195 at earthlink.net
Sun Apr 8 16:28:47 CEST 2007


Hi,

Can someone tell me why the first set of commands shades the area 
between the two curves, yet the second only shades the region between 
y=1 and y=4? The only difference is ftnA which changes from -x2 + 4 to 
-x2 + 5, but it is still in the bounds of the psframe, or so I thought...

\begin{center}
\begin{pspicture}(-2,-0.5)(2,6)
\def\ftnA{x 2 exp}
\def\ftnB{x 2 exp neg 4 add}
  \begin{psclip}
  {
  \pscustom[linestyle=none]{
    \psplot{-2}{2}{\ftnA}}
  \pscustom[linestyle=none]{
    \psplot{2}{-2}{\ftnB}}
  }
  \psframe*[linecolor=blue](-2,0)(2,5)
  \end{psclip}
  \psaxes[subticks=0,labelFontSize=\footnotesize]{->}(0,0)(-2,-0.5)(2,6)
  \psplot{-2}{2}{\ftnA}
  \psplot{-2}{2}{\ftnB}
%  \uput[-90](2,0){$\bm{x}$}
%  \uput[180](0,6){$\bm{y}$}
\end{pspicture}
\end{center}


\begin{center}
\begin{pspicture}(-2,-0.5)(2,6)
\def\ftnA{x 2 exp}
\def\ftnB{x 2 exp neg 5 add}
  \begin{psclip}
  {
  \pscustom[linestyle=none]{
    \psplot{-2}{2}{\ftnA}}
  \pscustom[linestyle=none]{
    \psplot{2}{-2}{\ftnB}}
  }
  \psframe*[linecolor=blue](-2,0)(2,5)
  \end{psclip}
  \psaxes[subticks=0,labelFontSize=\footnotesize]{->}(0,0)(-2,-0.5)(2,6)
  \psplot{-2}{2}{\ftnA}
  \psplot{-2}{2}{\ftnB}
%  \uput[-90](2,0){$\bm{x}$}
%  \uput[180](0,6){$\bm{y}$}
\end{pspicture}
\end{center}

Thanks,
Derek
_______________________________________________
pstricks mailing list
pstricks at tug.org
http://tug.org/mailman/listinfo/pstricks




More information about the PSTricks mailing list