# [pstricks] 4 different colors in a psplotImp curve

Michael Sharpe msharpe at ucsd.edu
Wed Jul 14 00:22:21 CEST 2010

On Jul 13, 2010, at 2:15 PM, Luís 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?
>
> Thank you for your help.
>
> Luis
>
> \usepackage{pst-func} %09/07/10
> \begin{document}
> \thispagestyle{empty}
> \begin{figure}[ht!] %[H] %
> \begin{center}
> \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{->}(0,0)(-4.4,-16.5)(16,4.8)[$x$,-135][$y$,-45]
> \pscircle(2.5,3.1754264805){2.020726442}
> \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 }
> \rput[tl](6.1,5.9){$\Gamma$}
> \end{pspicture*}
> \caption{Exercício 29 --- Lugar geométrico de $D_{_{\!b}}$ e $E_{_{b}}$.}
> \label{figuraexer29b}
> \end{center}
> \end{figure}
> \end{document}
>
>

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