[pstricks] listplot

Patrice MEGRET Patrice.MEGRET at umons.ac.be
Thu Oct 5 09:20:22 CEST 2017

Dear Riis,
I tried your example but without the dat file I cannot see if I have the same problem as you.
Best regards,
De : PSTricks [mailto:pstricks-bounces at tug.org] De la part de Poul Riis
Envoyé : jeudi 5 octobre 2017 09:13
À : pstricks at tug.org
Objet : Re: [pstricks] listplot

Compiling the example below with xetex everything is perfect but compiling with latex and pdflatex I get a ghostscript error message:
MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1

Poul Riis

Graphics with PSTricks <pstricks at tug.org<mailto:pstricks at tug.org>> writes:
The coordinates are saved in the PS array Points and can be
used later if you put the array Points into the global dict
and the number of points is n.
The points are saved in the wrong order!

\getCoor{8} will get the pair of x,y, counted from 1
It can easily be extended to \getxCoor . In the below example I marked
three points by a cross



\def\psbar at ii{\addto at pscode{startGlobal false \tx at NArray endGlobal
\psbar at iii}}
\def\psbar at iii{%
   n 1 sub {
     /Yval exch def /Xval exch def
     2 copy /YNext exch def Xval sub /DX exch def
     Xval 0 moveto % Start Point
     0 YNext rlineto % relative move
     DX 0 rlineto
     0 YNext neg rlineto
     DX neg 0 rlineto
   } repeat
\let\UserCoor\tx at UserCoor
\def\getCoor#1{Points n #1 sub 2 mul get Points n #1 sub 2 mul 1 add get



\psset{xAxisLabel=Time (minutes),
        yAxisLabel=Load  (W),xAxisLabelPos={c,-10},yAxisLabelPos={-5,c}}%
\begin{psgraph}[axesstyle=frame,xticksize=0 110,yticksize=0
\listplot[linecolor=Blue1, linewidth=2pt]{\data}
\multido{\iA=0+2}{35}{\psdot(!Points \iA\space 2 getinterval aload pop
\psdot[linecolor=red,dotstyle=x,dotscale=3](! \getCoor{3} )
\psdot[linecolor=red,dotstyle=x,dotscale=3](! \getCoor{13} )
\psdot[linecolor=red,dotstyle=x,dotscale=3](! \getCoor{30} )

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20171005/63f1131a/attachment-0001.html>

More information about the PSTricks mailing list