[R] polar.plot

John Kane jrkrideau at yahoo.ca
Sat Oct 31 17:00:22 CET 2009



--- On Fri, 10/30/09, Tony Greig <tony.greig at gmail.com> wrote:

> From: Tony Greig <tony.greig at gmail.com>

> Two questions:
> 
> 1 - Say I have average speed and directions for tide and I
> would like to
> plot them on a polar plot, but with different colors so I
> can indicate the
> two directions. I'm using polar.plot from the plotrix
> library. How can I add
> a second "b" and "dir.b" series to a polar.plot?

You may be able to set par(new=TRUE) but it looks to me like polar.plot
sets the radius for each graph so you would need to come up with a way of dealing with this.

> 
> library(plotrix)
> a = 3
> dir.a = 85
> b = 4
> dir.b = 250
> polar.plot(a, dir.a, start = 90, clockwise = T,
> show.grid.labels = T,
> radial.lim=c(0,5), line.col=2, lwd=2)
> 
> 
> 2 - Which parameter in polar.plot can I use to set the
> orientation for the
> grid labels which seem to default at 90 in my example
> above?

start ?

polar.plot(a, dir.a, start = 90, clockwise = T, show.grid.labels = T,
radial.lim=c(0,5), line.col=2, lwd=2)
op <- par(new=TRUE)
polar.plot(b, dir.b, start = 90, clockwise = T, show.grid.labels = T,
radial.lim=c(0,5), line.col=1, lwd=2)
par(op)


      __________________________________________________________________
[[elided Yahoo spam]]




More information about the R-help mailing list