<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Myriad Pro">Hi Hamed,<br>
<br>
here an example file to experiment around a little and to be modified
to your special needs:<br>
<br>
<br>
\documentclass[12pt,a4paper]{article}<br>
\usepackage{geometry}<br>
\geometry{tmargin=1cm,bmargin=1cm}<br>
\usepackage{pst-plot}<br>
\begin{document}<br>
<br>
Without clipping<br>
<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
&nbsp; \psplot{0.5}{4}{2 x div}<br>
\end{pspicture}<br>
\hfill<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psframe*[linecolor=lightgray](4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \psplot{0.5}{4}{2 x div}<br>
&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
\end{pspicture}<br>
<br>
Without and with \verb|\psclip|<br>
<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \pscustom[linecolor=red]{%<br>
&nbsp;&nbsp;&nbsp; \psplot{0.5}{4}{2 x div}<br>
&nbsp;&nbsp;&nbsp; \lineto(4,4)}<br>
&nbsp; \pscustom[linecolor=blue]{%<br>
&nbsp;&nbsp;&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
&nbsp;&nbsp;&nbsp; \lineto(0,0)}<br>
\end{pspicture}<br>
\hfill<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \begin{psclip}{%<br>
&nbsp;&nbsp;&nbsp; \pscustom[linecolor=red]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0.5}{4}{2 x div}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \lineto(4,4)}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \pscustom[linecolor=blue]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \lineto(0,0)%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }%<br>
&nbsp; }<br>
&nbsp; \psframe*[linecolor=lightgray](4,4)<br>
&nbsp; \end{psclip}%<br>
\end{pspicture}<br>
<br>
The next two versions are wrong,<br>
but this is important to understand why... (both with \verb|\psclip|<br>
<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \begin{psclip}{\pscustom[linecolor=red]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0.5}{4}{2 x div}}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \pscustom[linecolor=blue]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}}}<br>
&nbsp;&nbsp;&nbsp; \psframe*[linecolor=lightgray](4,4)<br>
&nbsp; \end{psclip}%<br>
\end{pspicture}<br>
\hfill<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \begin{psclip}{\pscustom[linecolor=red]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0.5}{4}{2 x div}}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \pscustom[linecolor=blue]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}}}<br>
&nbsp;&nbsp;&nbsp; \psframe*[linecolor=lightgray](4,4)<br>
&nbsp; \end{psclip}%<br>
&nbsp; \psline[linecolor=green](0,3)(3,0)<br>
\end{pspicture}<br>
<br>
<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \begin{psclip}{\pscustom[linecolor=red]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0.5}{4}{2 x div}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \lineto(4,4)}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \pscustom[linecolor=blue]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \lineto(0,0)}}<br>
&nbsp;&nbsp;&nbsp; \psframe*[linecolor=lightgray](4,4)<br>
&nbsp; \end{psclip}%<br>
&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
&nbsp; \psplot{0.5}{4}{2 x div}<br>
\end{pspicture}<br>
\hfill<br>
\begin{pspicture}(-0.5,-1)(4,4)<br>
&nbsp; \psaxes(4,4)<br>
&nbsp; \begin{psclip}{\pscustom[linestyle=none]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0.5}{4}{2 x div}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \lineto(4,4)}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \pscustom[linestyle=none]{%<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \lineto(0,0)}}<br>
&nbsp;&nbsp;&nbsp; \psframe*[linecolor=lightgray](4,4)<br>
&nbsp; \end{psclip}%<br>
&nbsp; \psplot{0}{3}{3 x x mul 3 div sub}<br>
&nbsp; \psplot{0.5}{4}{2 x div}<br>
\end{pspicture}<br>
<br>
\end{document} <br>
<br>
<br>
These examples are setup on<br>
<br>
<a class="moz-txt-link-freetext" href="http://tug.org/PSTricks/main.cgi?file=Examples/clip">http://tug.org/PSTricks/main.cgi?file=Examples/clip</a><br>
<br>
Regards,<br>
<br>
Juergen<br>
</font><br>
Hamed wrote:
<blockquote cite="mid:200706112054.l5BKsk121507@tug.org" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Microsoft Sans Serif";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Microsoft Sans Serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
  </style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  <div class="Section1">
  <p class="MsoNormal"><font face="Microsoft Sans Serif" size="2"><span
 style="font-size: 10pt; font-family: &quot;Microsoft Sans Serif&quot;;">Hi,<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Microsoft Sans Serif" size="2"><span
 style="font-size: 10pt; font-family: &quot;Microsoft Sans Serif&quot;;">Can we
do it for a
region bounded by two curve&nbsp; like the region bounded by y=x and
&nbsp;y=x^2 for example. Thanks a lot.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Microsoft Sans Serif" size="2"><span
 style="font-size: 10pt; font-family: &quot;Microsoft Sans Serif&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
pstricks mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pstricks@tug.org">pstricks@tug.org</a>
<a class="moz-txt-link-freetext" href="http://tug.org/mailman/listinfo/pstricks">http://tug.org/mailman/listinfo/pstricks</a>
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="65">-- 
  j&uuml;rgen gilg
  austr. 59
  70376 stuttgart

tel       0711-59 27 88
e-mail    <a class="moz-txt-link-abbreviated" href="mailto:gilg@acrotex.net">gilg@acrotex.net</a>
webpage   <a class="moz-txt-link-abbreviated" href="http://www.acrotex.net">www.acrotex.net</a>
          <a class="moz-txt-link-abbreviated" href="http://www.gilligan-online.de">www.gilligan-online.de</a></pre>
</body>
</html>