[pstricks] Re : Lines (curves) with gradient color...

Herbert Voss Herbert.Voss at fu-berlin.de
Wed Jul 11 10:33:07 CEST 2007


Werner Grundlingh wrote:
> My problem lies more with the outcome around curves in a function.
> I've added 2 images showing how functions drawn with
> \parametericplotHSB are not as smooth around the function curves. Both
> images have a \parametricplotHSB plot as well as a (regular)
> \parametricplot in it, to show the difference in smoothness. Is it
> possible to eliminate this, and therefore not have the coloured line
> segments 'stroked' together, but rather 'curved' together, if you
> understand what I mean?
try this one. Replace the macro definition in your example file.

Herbert


\def\parametricplotHSB{\pst at object{parametricplotHSB}}
\def\parametricplotHSB at i#1#2#3{{%
  \begin at ClosedObj
  \addto at pscode{%
    /t #1 def
    /dt #2 t sub \psk at plotpoints\space div def
    /t t dt sub def
    /Counter 0 def
    1 setlinejoin
    \psk at plotpoints {
      /t t dt add def
      /Counter Counter 1 add def
      #3
      \pst at number\psyunit mul exch
      \pst at number\psxunit mul exch
      1 Counter eq { moveto currentpoint /OldY ED /OldX ED } % First point
        {\ifPst at HSB % Other points than the first one
          /PointY exch def
          /PointX exch def
          Counter \psk at plotpoints\space div
          \PstParametricplotHSB at HueEnd\space
          \PstParametricplotHSB at HueBegin\space sub mul
          \PstParametricplotHSB at HueBegin\space add
          1 1 sethsbcolor
          OldX OldY PointX PointY lineto lineto
          stroke
          PointX PointY moveto
          /OldX PointX def /OldY PointY def
        \else lineto \fi } ifelse
     } repeat }% fin du code ps
   \end at ClosedObj}%
  \ignorespaces} % fin de la commande PSTricks




More information about the PSTricks mailing list