[pstricks] polar plot in \listplot?

Herbert Voss LaTeX at zedat.fu-berlin.de
Sun Apr 2 18:05:52 CEST 2006



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

\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}






More information about the PSTricks mailing list