[R] plot polar coordinates
Greg.Snow at imail.org
Thu Jun 3 19:35:46 CEST 2010
It looks like polar.plot does not handle negative lengths, you can preprocess the data and just add 180 degrees to the angles corresponding to negative lengths and then use their absolute values.
The radial.lim is not ignored, based on the documentation the range is then made pretty (and 100 is apparently prettier than 90), if you pass a longer vector (e.g. c(30,60,90) ) then those exact values will be used.
The lines function is plotting in Cartesian coordinates, not the polar coordinates.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Thomas Steiner
> Sent: Thursday, June 03, 2010 8:09 AM
> To: r-help at r-project.org
> Subject: [R] plot polar coordinates
> I'd like to plot in in polar coordinates a line which is given as a
> vector of lengths and angles.
> My questions:
> a) Why is the radial.lim=c(0,90) ignored?
> b) Why is there no red line?
> c) Why is the blue line not "jumping" between two circles of radius 40
> respectively 60 (The first argument of "line" should be the angle, the
> second the length.)? Or: which function plots in existing polar plots?
> (Remark the the polygone is not complete, eg going around)
> My final goal will be such a plot:
> http://www.mysundial.ca/tsp/images/sun_chart_50_solar_polar.jpg which
> is the polar-coordinate version of my wikimedia plot
> http://commons.wikimedia.org/wiki/File:Sonnenstand.png (made in R, see
> Thanks for hints and help,
> PS: I asked a close question last year:
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help