[pstricks] (no subject)
Juergen Gilg
gilg at acrotex.net
Tue Jun 12 01:30:42 CEST 2007
Hi Hamed,
here an example file to experiment around a little and to be modified to
your special needs:
\documentclass[12pt,a4paper]{article}
\usepackage{geometry}
\geometry{tmargin=1cm,bmargin=1cm}
\usepackage{pst-plot}
\begin{document}
Without clipping
\begin{pspicture}(-0.5,-1)(4,4)
\psaxes(4,4)
\psplot{0}{3}{3 x x mul 3 div sub}
\psplot{0.5}{4}{2 x div}
\end{pspicture}
\hfill
\begin{pspicture}(-0.5,-1)(4,4)
\psframe*[linecolor=lightgray](4,4)
\psaxes(4,4)
\psplot{0.5}{4}{2 x div}
\psplot{0}{3}{3 x x mul 3 div sub}
\end{pspicture}
Without and with \verb|\psclip|
\begin{pspicture}(-0.5,-1)(4,4)
\psaxes(4,4)
\pscustom[linecolor=red]{%
\psplot{0.5}{4}{2 x div}
\lineto(4,4)}
\pscustom[linecolor=blue]{%
\psplot{0}{3}{3 x x mul 3 div sub}
\lineto(0,0)}
\end{pspicture}
\hfill
\begin{pspicture}(-0.5,-1)(4,4)
\psaxes(4,4)
\begin{psclip}{%
\pscustom[linecolor=red]{%
\psplot{0.5}{4}{2 x div}
\lineto(4,4)}
\pscustom[linecolor=blue]{%
\psplot{0}{3}{3 x x mul 3 div sub}
\lineto(0,0)%
}%
}
\psframe*[linecolor=lightgray](4,4)
\end{psclip}%
\end{pspicture}
The next two versions are wrong,
but this is important to understand why... (both with \verb|\psclip|
\begin{pspicture}(-0.5,-1)(4,4)
\psaxes(4,4)
\begin{psclip}{\pscustom[linecolor=red]{%
\psplot{0.5}{4}{2 x div}}
\pscustom[linecolor=blue]{%
\psplot{0}{3}{3 x x mul 3 div sub}}}
\psframe*[linecolor=lightgray](4,4)
\end{psclip}%
\end{pspicture}
\hfill
\begin{pspicture}(-0.5,-1)(4,4)
\psaxes(4,4)
\begin{psclip}{\pscustom[linecolor=red]{%
\psplot{0.5}{4}{2 x div}}
\pscustom[linecolor=blue]{%
\psplot{0}{3}{3 x x mul 3 div sub}}}
\psframe*[linecolor=lightgray](4,4)
\end{psclip}%
\psline[linecolor=green](0,3)(3,0)
\end{pspicture}
\begin{pspicture}(-0.5,-1)(4,4)
\psaxes(4,4)
\begin{psclip}{\pscustom[linecolor=red]{%
\psplot{0.5}{4}{2 x div}
\lineto(4,4)}
\pscustom[linecolor=blue]{%
\psplot{0}{3}{3 x x mul 3 div sub}
\lineto(0,0)}}
\psframe*[linecolor=lightgray](4,4)
\end{psclip}%
\psplot{0}{3}{3 x x mul 3 div sub}
\psplot{0.5}{4}{2 x div}
\end{pspicture}
\hfill
\begin{pspicture}(-0.5,-1)(4,4)
\psaxes(4,4)
\begin{psclip}{\pscustom[linestyle=none]{%
\psplot{0.5}{4}{2 x div}
\lineto(4,4)}
\pscustom[linestyle=none]{%
\psplot{0}{3}{3 x x mul 3 div sub}
\lineto(0,0)}}
\psframe*[linecolor=lightgray](4,4)
\end{psclip}%
\psplot{0}{3}{3 x x mul 3 div sub}
\psplot{0.5}{4}{2 x div}
\end{pspicture}
\end{document}
These examples are setup on
http://tug.org/PSTricks/main.cgi?file=Examples/clip
Regards,
Juergen
Hamed wrote:
>
> Hi,
>
> Can we do it for a region bounded by two curve like the region
> bounded by y=x and y=x^2 for example. Thanks a lot.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>
--
jürgen gilg
austr. 59
70376 stuttgart
tel 0711-59 27 88
e-mail gilg at acrotex.net
webpage www.acrotex.net
www.gilligan-online.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20070612/e4f171df/attachment.html
More information about the PSTricks
mailing list