4

Given this elegant solution that allows one to vary the color along plots, I'm wondering if there is a simple way to change the color along PSTricks lines, arcs, circles, ellipses and so on.

4

Only possible for plots which can be defined as a parametric equation or a simple line. You need package pst-hsb from

http://archiv.dante.de/~herbert/texnik/tex/generic/pst-hsb/pst-hsb.tex http://archiv.dante.de/~herbert/texnik/tex/latex/pst-hsb/pst-hsb.sty

See also: http://pstricks.blogspot.de/2011/09/vos-courbes-aux-couleurs-de-larc-en.html

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pst-hsb}
\begin{document}

\begin{pspicture}(-0.5,-5)(11,5)
\psaxes{->}(0,0)(0,-4)(11,5)
\psset{plotpoints=300,linewidth=1mm}
\psparametricplotHSB[HSB=false,linecolor=red]{0}{360}{t 36 div t sin 4 mul}
\psparametricplotHSB[algebraic]{0}{6.3}{t/0.628 | cos(t)*4}
\psparametricplotHSB[algebraic]{0}{6.3}{4*sin(t)+5 | 4*cos(t)}
\pslineHSB(0,-4)(10,4)
\pslineHSB[HueBegin=0.2,HueEnd=0.9](0,4)(10,-4)
\end{pspicture} 

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy