[pstricks] polar plot in \listplot?

Boris Dušek borisdusek at cmail.cz
Sun Apr 2 20:21:04 CEST 2006


On Sunday 02 April 2006 18:05, Herbert Voss wrote:
> Boris Dušek wrote:
> > I have two questions regarding the fact that \listplot does not support
> > the "polarplot=true|false" option (\psplot does):
> >
> > 1. Do you recommend any workaround? (I will probably solve it by normal
> > "xy" listplot for which I will specially prepare the data by converting
> > from polar coords to cartesian coords in spreadsheet program)
>
> hope, this helps
>
> Herbert

Dear Herbert,

thank you very much for your answer. The example compiles fine (latex 
polar.tex; dvips -o polar.ps polar.tex), but viewing it crashes ghostscript 
(see below). I also do not know where to use the macro \ScalePoints (IMHO you 
just define it, but not use it). Any ideas?

Thank you for your answer.
Regards,
Boris dusek


boris at domov ~/doc $ gs polarorig.ps
AFPL Ghostscript 8.53 (2005-10-20)
Copyright (C) 2005 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in
Operand stack:
   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--   
--nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   
%oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2   
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push   
--nostringval--
Dictionary stack:
   --dict:1121/1686(ro)(G)--   --dict:0/20(G)--   --dict:72/200(L)--   
--dict:177/300(L)--   --dict:38/200(L)--   --dict:86/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 49034
AFPL Ghostscript 8.53: Unrecoverable error, exit code 1

>
> \documentclass{minimal}
> \usepackage{pstricks}
> \usepackage{pst-plot}
>
> \def\data{% x-> degrees  y->radius
>    0 1 30 1  45 1  60 1  90 1
>       120 1 135 1 150 1 180 1
>       210 1 225 1 240 1 270 1
>       300 1 315 1 330 1 360 1
> }
>
> \makeatletter
> \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 { /RAD exch def  % save y as radius
>        dup            % xVal xVal
>        cos exch sin RAD mul y mul m 1 roll
>        RAD mul x mul m 1 roll
>        /m m 2 sub def } repeat>
> \makeatother
>
> \begin{document}
> \psset{yunit=5,xunit=5}
>
> \begin{pspicture}(-1,-1)(1,1)
>    \psaxes[Dx=0.2,Dy=0.2](0,0)(-1,-1)(1,1)
> %  \readdata{\data}{test.dat}
>    \listplot[linecolor=red,plotstyle=dots]{\data}
> \end{pspicture}
>
> \end{document}
>
>
>
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks



More information about the PSTricks mailing list