[pstricks] psplot, own plotstyle?

Herbert Voss LaTeX at zedat.fu-berlin.de
Fri May 18 08:05:20 CEST 2007

Ludwig Meyerhoff wrote:
> I would like to have horizontal lines from a plotted cosine to the
> y-axis to show the increasing density of the values with equidistant angles.
> To plot the cosine is not the problem, but the horizontal lines is!
> On the examples on http://tug.org/PSTricks/main.cgi?file=examples I have
> found something similar to what I am looking for, but the lines are
> vertical and not horizontal (http://tug.org/PSTricks/Examples/line0.tex).
> >From the example code I can see an own plotstyle was defined, but I do
> not understand the Postscript code (honestly, I already have some
> problems understanding the introducing TeX-defines).
> Maybe some one can help me out with an appropriate definition?
\let\beginplot at LineToYAxis\beginplot at line
\def\endplot at LineToYAxis{\psLineToYAxis at ii}
\let\beginqp at LineToYAxis\beginqp at line
\let\doqp at LineToYAxis\doqp at line
\let\endqp at LineToYAxis\endqp at line
\let\testqp at LineToYAxis\testqp at line
\def\psLineToYAxis at ii{%
\addto at pscode{\pst at cp \psline at iii \tx at LineToYAxis}%
\end at OpenObj}
\def\tx at LineToYAxis{LineToYAxis }
% Adapted from Line
\pst at def{LineToYAxis}<{%
  n 0 eq not {
    n 1 eq { 0 0 /n 2 def } if
    0 0 moveto
    /n n 2 sub def
    CP 2 copy moveto exch pop exch 0 Lineto
    n { 2 copy moveto exch pop 0 exch Lineto } repeat
    CP 4 2 roll
    2 copy moveto exch pop 0 exch L
    pop pop
  } if }>
            showpoints=true,dotstyle=o,dotsize=0.2]{0}{360}{x cos}



More information about the PSTricks mailing list