[pstricks] 4 different colors in a psplotImp curve

Luís Lopes qed_texte at hotmail.com
Wed Jul 14 18:51:17 CEST 2010


Dear list members, Michael Sharpe, 

Michael's suggestions were both very useful and accurate. 
Thank you very much. 

Actually I had to draw two figures. After some tests I came up 
with the code in this message. I put it here because I think 
it may help other people. 

Luis 

\usepackage{pstricks-add} %11/02/10
\usepackage{pst-func} %09/07/10


\begin{document}
\thispagestyle{empty}
\begin{figure}[ht!] %[H]
\begin{center}
\setlength{\fboxrule}{1pt} \setlength{\fboxsep}{3mm}
\fbox{%\framebox[\textwidth]{}
\psset{xunit=0.5cm,yunit=0.5cm,algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-5.1,-17)(17,7.5)
\psaxes[Dx=4,Dy=1,subticks=2]{->}(0,0)(-4.4,-16.5)(16,4.8)[$x$,-135][$y$,-45]
\pscircle(2.5,3.1754264805){2.020726442}
%part in fourth quadrant in green not too low
\psclip{\psframe[linestyle=none](-5,-16)(14,4)}
\psplotImp[algebraic,linecolor=green,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
%overdraw part in second quadrant with yellow
\psclip{\psframe[linestyle=none](-5,0)(0,4)}
\psplotImp[algebraic,linecolor=yellow,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
%overdraw part in first quadrant with red
\psclip{\psframe[linestyle=none](0,0)(6,4)}
\psplotImp[algebraic,linecolor=red,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
%overdraw part in fourth quadrant with blue
\psclip{\psframe[linestyle=none](0,0)(6,-2)}
\psplotImp[algebraic,linecolor=blue,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
\rput[tl](6.1,5.9){$\Gamma$}
\end{pspicture*}}
\caption{Lugar geométrico de $D_{_{\!b}}$ e $E_{_{b}}$ quando $\mathbf A$  percorre $\Gamma$.}
\label{figuraexer29b}
\end{center}
\end{figure}


\clearpage
\thispagestyle{empty}

\begin{figure}[ht!] %[H]
\begin{center}
\setlength{\fboxrule}{1pt} \setlength{\fboxsep}{3mm}
\fbox{%\framebox[\textwidth]{}
\newrgbcolor{zzttqq}{0.6 0.2 0}
\psset{xunit=1cm,yunit=1cm,algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-3.1,-9.1)(8.1,7.5)
\pspolygon[linestyle=none,fillstyle=solid,fillcolor=yellow,opacity=0.1](4,6.9282032303)(0,0)(5,0)
\pscircle(2.5,3.1754264805){4.0414518843}
\psline[linewidth=1.2pt](5.6859330091,0.6888295701)(0,0)
\parametricplot{-0.3530103733484262}{0.9578293132860366}{1*5.3293871002*cos(t)+0*5.3293871002*sin(t)+0|0*5.3293871002*cos(t)+1*5.3293871002*sin(t)+0}
\rput[tl](5.8,5.9){$\Gamma$}
\rput[lb](3.4,4.15){$\phi$}
\psline[linewidth=1.2pt](4,6.9282032303)(0,0)
\psline[linewidth=1.2pt](0,0)(5,0)
\psline[linewidth=1.2pt](5,0)(4,6.9282032303)
\psline[linewidth=1.2pt](5.6859330091,0.6888295701)(5,0)
\psdots[dotstyle=*,linecolor=blue](0,0)
\rput[bl](-0.47,-0.3){$\mathbf B$}
\psdots[dotstyle=*,linecolor=blue](5,0)
\rput[bl](4.9179224864,-0.3907301549){$\mathbf C$}
\psdots[dotstyle=*,linecolor=darkgray](4,6.9282032303)
\rput[bl](3.9,7.05){$\mathbf A$}
\psdots[dotstyle=*,linecolor=darkgray](4.6153846154,2.6646935501)
\rput[bl](4.7,2.67){$D_{_{\!b}}$}
\psdots[dotstyle=*,linecolor=darkgray](5.6859330091,0.6888295701)
\rput[bl](5.8,0.56){$\mathbf A{\boldsymbol'}$}
\psdots[dotstyle=*,linecolor=darkgray](5.3197075904,0.3210576531)
\rput[bl](5.4328074219,0.0){$D'_{_{\!b}}$}
%part in green not too low
\psclip{\psframe[linestyle=none](-4,-8)(9,4.5)}
\psplotImp[algebraic,linecolor=green,linewidth=2pt](-4.1,-9.5)(10,4.5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
%overdraw part in first quadrant with red
\psclip{\psframe[linestyle=none](0,0)(6,4)}
\psplotImp[algebraic,linecolor=red,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
%overdraw part in fourth quadrant with blue
\psclip{\psframe[linestyle=none](0,0)(6,-2)}
\psplotImp[algebraic,linecolor=blue,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
\rput[tc](2.5,-8.9){Triângulo dados \texttt<$\,\alpha,a,d_{_b}$\texttt>}
\end{pspicture*}}
\vspace*{0pt}
\caption{Exercícios 29 e 34.}
\label{figuraexer29a}
\end{center}
\end{figure}
\end{document}


========
> Message: 6
> Date: Tue, 13 Jul 2010 15:22:21 -0700
> From: Michael Sharpe <msharpe at ucsd.edu>
> To: Graphics with PSTricks <pstricks at tug.org>
> Subject: Re: [pstricks] 4 different colors in a psplotImp curve
> Message-ID: <BD5018BB-7937-4CD9-9497-0704E2BCCF76 at ucsd.edu>
> Content-Type: text/plain; charset=iso-8859-1
> 
> 
> On Jul 13, 2010, at 2:15 PM, Luis Lopes wrote:
> 
> > Dear list members,
> > 
> > Hello.
> > 
> > I am a new member of this list. This is my first email, hope I will be
> > able to send it correctly.
> > 
> > I have three requests concerning the code below:
> > 
> > 1) I would like to have 4 different colors in the red curve,
> > one for which natural part of the curve.
> > 
> > 2) the curve should stop around the point (13,-16).
> > 
> > 3) the two <-1> label of the axes are not well placed.
> > How NOT to put them in the axes?

[....]clip
 
 
> 1. I'm not sure what your four natural parts are, but clipping seems like the solution. See below.
> 
> 2. Use a tighter pspicture bound (or clipping to a smaller region. See below.
> 
> 3. Use Dx=2,Dy=2 to space the labels better.
> 
> \psaxes[Dx=2,Dy=2,subticks=2]{->}(0,0)(-4.4,-16.5)(16,4.8)[$x$,-135][$y$,-45]
> \pscircle(2.5,3.1754264805){2.020726442}
> %draw entire curve in red
> \psplotImp[algebraic,linecolor=red,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }
> %overdraw part in second quadrant with blue
> \psclip{\psframe[linestyle=none](-5,0)(0,4)}
> \psplotImp[algebraic,linecolor=blue,linewidth=2pt](-6.1,-18)(19,5){ y*(x^2-10*x+y^2)*11/14+(x^3-5*x^2+y^2*x+5*y^2)*5*sqrt(3)/14 }\endpsclip
>  
> Michael

 		 	   		  
_________________________________________________________________
ACESSE SEUS EMAILS DE QUALQUER LUGAR PELO SEU CELULAR. CLIQUE E VEJA COMO FAZER ISSO.
http://celular.windowslive.com.br/hotmail.asp?produto=Hotmail&utm_source=Live_Hotmail&utm_medium=Tagline&utm_content=ACESSESEUS85&utm_campaign=MobileServices
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100714/c25de552/attachment.html>


More information about the PSTricks mailing list