2

Does anyone know how to add addition text and expand its character in any desired position in windrose plot in R? I am using the the package openair for plotting windrose diagram.

Consider the following code that I am using:

windRose(ambala.march.12hrs, ws = "FFF", wd = "WD_Deg",key.header = "(km/h)"
     ,paddle = F,breaks = c(0,10,20,30,40,50,60)
     ,key = list(plot.style = c("ticks", "border"),
                 fit = "all", height = 1,width=0.5)
     ,key.footer = "(a)",par.settings=list(fontsize=list(text=20),cex=2))

dput(ambala.march.12hrs)

structure(list(Date = structure(c(1L, 35L, 68L, 102L, 136L, 170L, 
204L, 238L, 272L, 306L, 340L, 374L, 408L, 442L, 476L, 510L, 544L, 
578L, 612L, 646L, 680L, 714L, 748L, 782L, 815L, 849L, 883L, 917L, 
951L, 985L, 1019L, 2L, 36L,.... , .Label = c("01-03-1970", 
"01-03-1971", "01-03-1972", "01-03-1973", "01-03-1974", "01-03-1975", 
"01-03-1976", "01-03-1977", "01-03-1978", "01-03-1979", "01-03-1980", 
"01-03-1981", "01-03-1982", "01-03-1983",...), class = "factor"), DD = c(29L, 29L, 29L, 27L, 
18L, 27L, 25L, 0L, 29L, 9L, 27L, 29L, 18L, 5L, 20L, 29L, 27L, 
29L, 32L, 29L, 29L, 32L, 27L, 29L, 29L, 29L, 23L, 27L, 18L, 27L, 
27L, 32L, 29L, 5L, 32L, 36L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 
32L, 32L, 23L, 0L, 27L, 32L, 32L, 29L,......), 
    WD_Deg = c(290L, 290L, 290L, 270L, 180L, 270L, 250L, 0L, 
    290L, 90L, 270L, 290L, 180L, 50L, 200L, 290L, 270L, 290L, 
    320L, 290L, 290L, 320L, 270L, 290L, 290L, 290L, 230L, 270L, 
    180L, 270L, 270L, 320L, 290L, 50L, 320L, 360L, 320L, 320L, 
    320L, 320L, 320L, 320L, 320L,....)), .Names = c("Date", "DD", 
"FFF", "WD_Deg"), class = "data.frame", row.names = c(NA, -1052L
))

I am calling FFF wind speed and WD_Deg wind direction in this data frame.

Any suggestions are most welcome.

zx8754
  • 52,746
  • 12
  • 114
  • 209
user2968058
  • 25
  • 2
  • 11
  • Considering SO is not a code writing service, would you be able to provide us with some of your work, what you have tried and what has and has not worked? A `dput()` of your data is also very helpful. Thanks! – Badger Oct 09 '15 at 21:51
  • Consider the following code that I have used; windRose(ambala.march.12hrs, ws = "FFF", wd = "WD_Deg",key.header = "(km/h)" ,paddle = F,breaks = c(0,10,20,30,40,50,60) ,key = list(plot.style = c("ticks", "border"), fit = "all", height = 1,width=0.5) ,key.footer = "(a)",par.settings=list(fontsize=list(text=20),cex=2)) – user2968058 Oct 09 '15 at 22:02
  • When adjust the question head into [edit](http://stackoverflow.com/posts/33047591/edit) and make the ammendments, could we get a `dput(ambala.march)` in the question too so we know what we're working with? – Badger Oct 09 '15 at 22:06
  • In this code written above I have tried to expand the size of key.footer from par.setting, but that did not work. Is it possible to expand the key.footer only? – user2968058 Oct 09 '15 at 22:45

1 Answers1

0

key.header and key.footer use drawOpenKey and can therefore not be set independent from the scale.

From ? drawOpenKey:
Notes: header and footer formatting can not be set locally, but instead are matched to those set in labels.

So the short answer is: it is not possible. The long answer is that you can try to add your text as a seperate layer with text.

RHA
  • 3,677
  • 4
  • 25
  • 48