[pstricks] Re: pstricks (pst-plot) and listplot

Denis Girou Denis.Girou at idris.fr
Sat May 18 15:10:54 CEST 2002

The following message is a courtesy copy of an article
that has been posted to comp.text.tex as well.

>>>>> "Herbert.Voss" == Herbert Voss <voss at perce.de> writes:

    Herbert.Voss> I'm looking for an example for the use of
    Herbert.Voss> \listplot[<parameter>]{<list>}

    Herbert.Voss> which doesn't do the same than the other two
    Herbert.Voss> plot commands fileplot and dataplot. <list>
    Herbert.Voss> can have PostScript-commands which will be
    Herbert.Voss> passed direct to the PostScript-interpreter.
    Herbert.Voss> I do not found a senseful example for this.

  I think that this can be useful in case of repetitive and automatic plots of
external data, when you want to pre-process these data without modifying them
explicitely. Of course, this can be done by an external program which reformat
the data and create a new file, but the \listplot command allow to do rather
directly some automatic changes in the data without requiring an external

  I give you here a simple example, where I decide that the y maximum value
must be 3. I just modify the ScalePoints PostScript macro, which is used to
loop inside the coordinates, to translate user ones into the PostScript ones.

  Perhaps that somebody else would propose other convincing examples...






    0   1
    0.5 3
    1   5
    1.5 1
    3   4.5
    5   0.5}


\pst at def{ScalePoints}<%
  /y ED /x ED
  counttomark dup dup cvi eq not { exch pop } if
  /m exch def /n m 2 div cvi def
  n {
% D.G. modification begin - May. 18, 2002
     % If the y coordinate is greater than 3, we change it for 3
     dup 3 gt {pop 3} if
% D.G. modification end
     y mul
     m 1 roll
     x mul
     m 1 roll
     /m m 2 sub
     def } repeat>




Denis Girou
Institut du Développement et des Ressources en Informatique Scientifique |
Centre National de la Recherche Scientifique                             |
Bâtiment 506 - B.P. 167 - 91403 Orsay Cedex - France                     |

More information about the PSTricks mailing list