[R] How to change the axis labels of a wind rose plot?

David Winsemius dwinsemius at comcast.net
Mon Feb 18 17:53:05 CET 2008


Huilin Chen <hchen at bgc-jena.mpg.de> wrote in
news:47B9A6C0.6090502 at bgc-jena.mpg.de: 


> I am make plots using the function windrose() from the package
> "circular". I would like to have the north on the top instead of
> having 0 degree on the right side.
> Does anybody know how to change the labels in a windrose plot?

There are probably better ways, but this is the record of my experiments 
starting with the help file example:

set.seed(1)
dir <- circular(runif(100, 0, 360), units="degrees")
mag <-  rgamma(100, 15)
sample <- data.frame(dir=dir, mag=mag)
 
par(mfrow=c(2,2))
res <- windrose(sample)
#Rotates the data
sample$dir<-sample$dir+90
res <- windrose(sample)
axis.circular(labels=c("E","N","W","S"))
#Overlayed the letter labels but leaves the degree labels

#Read the help file again and now suppress the axes 
res <- windrose(sample,axes=FALSE)
# and correctly(?) position labels
axis.circular(labels=c("E","N","W","S"),tcl.text = -0.1)

-- 
David Winsemius



More information about the R-help mailing list