[R] plot polar coordinates
Thomas Steiner
finbref.2006 at gmail.com
Thu Jun 3 16:08:44 CEST 2010
Hi,
I'd like to plot in in polar coordinates a line which is given as a
vector of lengths and angles.
library("plotrix")
polar.plot(length=c(1,-13,3,-1),polar.pos=c(20,20,45,55),rp.type="p",line.col="red",lwd=3,clockwise=TRUE,label.pos=seq(30,360,by=30),labels=c("ESE","SSE","S","SSW","WSW","W","WNW","NNW","N","NNE","ENE","E"),radial.lim=c(0,90))
lines(seq(0,285,by=15),rep(c(40,60),times=10),col="blue")
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
source)
Thanks for hints and help,
Thomas
PS: I asked a close question last year:
http://www.mail-archive.com/r-help@r-project.org/msg64998.html
More information about the R-help
mailing list