RHA
RHA

Reputation: 3862

Changing the legend labels in a windrose from R openair

I made a graph using windRose from the openair package. Here is a reproducible example.

library(openair)
windRose(mydata, ws="ws", wd="wd", breaks=c(0,1.5,3.3,5.4,7.9,10.7), 
             auto.text= FALSE, paddle = FALSE, annotate = FALSE)

I found that I can change the legend title, footer and position by key.header, key.footer and key.position. But I would like to change the legend labels, so the "1.5 to 3.3", to be used in another language than English ("1.5 zu 3.3") or for example to "2 Beaufort". Is there an easy way?

Upvotes: 0

Views: 3643

Answers (1)

user3710546
user3710546

Reputation:

In windRose function, you can add argument key = list(labels = c()). You can define your own labels, such as:

library(openair)
windRose(mydata, ws="ws", wd="wd", breaks=c(0,1.5,3.3,5.4,7.9,10.7), 
         auto.text= FALSE, paddle = FALSE, annotate = FALSE,
         key = list(labels = c("0 zu 1.5", "1.5 zu 3.3", "3.3 zu 5.4", 
                               "5.4 zu 7.9", "7.9 zu 10.7", 
                               "10.7 zu 20.16")))

enter image description here

Upvotes: 4

Related Questions