Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I adjust the windRose legend? #360

Open
spencer-tassone opened this issue Aug 15, 2023 · 1 comment
Open

How can I adjust the windRose legend? #360

spencer-tassone opened this issue Aug 15, 2023 · 1 comment
Labels
directional 🧭 Directional analysis, e.g. polar plots question Questions about function use or interpretation

Comments

@spencer-tassone
Copy link

spencer-tassone commented Aug 15, 2023

I am working on making a wind rose figure using the openair package. How can I increase the legend text font size, legend title font size, and left-align the legend title?

library(openair)

dd <- data.frame(
  datetime = seq.POSIXt(as.POSIXct('2022-05-07 00:00:00'),
                        as.POSIXct('2022-05-07 23:00:00'),
                        '1 hour'),
  windDir_deg = c(290, 272, 290, 272, 298, 295, 298, 289, 314, 337, 335, 320, 331, 351, 359, 7, 289, 341, 348, 279, 354, 278, 156, 173),
  windgust_ms = c(3.5, 1.4, 3.4, 2.6, 4.3, 20.4, 13.3, 12.5, 17.6, 2.9, 18.0, 5.2, 6.9, 7.3, 7.1, 7.0, 5.6, 5.9, 5.7, 5.1, 5.0, 2.7, 4.5, 4.2)
)

windRose(dd, ws = 'windgust_ms', wd = 'windDir_deg',
         breaks = c(0,1,2,3,5,8,11,14,17,21),
         cols = c('gray95','#ffffcc','#ffeda0','#fed976','#feb24c',
                  '#fd8d3c','#fc4e2a','#e31a1c','#b10026'),
         annotate = F,
         paddle = F,
         key.position = 'right',
         key.header = expression(Wind~Speed~(m~s^-1)),
         key.footer = NULL,
         key.cex.labels = 2.5)

Created on 2023-08-15 with reprex v2.0.2

UPDATE: UPDATE: I was able to increase the font size of the legend text and title using fontsize = but still unsure how to left-align the legend title.

windRose(dd, ws = 'windgust_ms', wd = 'windDir_deg',
         breaks = c(0,1,2,3,5,8,11,14,17,21),
         cols = c('gray95','#ffffcc','#ffeda0','#fed976','#feb24c',
                  '#fd8d3c','#fc4e2a','#e31a1c','#b10026'),
         annotate = F,
         paddle = F,
         key.position = 'right',
         key.header = expression(Wind~Speed~(m~s^-1)),
         key.footer = NULL,
         fontsize = 15)
@spencer-tassone spencer-tassone added the question Questions about function use or interpretation label Aug 15, 2023
@rs028
Copy link

rs028 commented Aug 15, 2023

@spencer-tassone this may be relevant #100

@jack-davison jack-davison added the directional 🧭 Directional analysis, e.g. polar plots label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
directional 🧭 Directional analysis, e.g. polar plots question Questions about function use or interpretation
Projects
None yet
Development

No branches or pull requests

3 participants