Dear all, 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? thanks, Huilin
David Winsemius
2008-Feb-18 16:53 UTC
[R] How to change the axis labels of a wind rose plot?
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
Huilin Chen wrote:> Dear all, > > 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? > >Hi Huilin, As it happens, the Australian BoM uses that orientation, so you could try oz.windrose in the plotrix package Jim