jack-davison / ggopenair

{ggplot2} incarnation of {openair} ☁️
https://jack-davison.github.io/ggopenair/
GNU General Public License v3.0
7 stars 0 forks source link

polar_plot does not respect order of factor levels in facet #1

Closed mooibroekd closed 1 year ago

mooibroekd commented 1 year ago

I have just noticed that the ggopenair::polar_plot does not respect the order of factor levels in the column that is provided to the facet parameter (if this is indeed a factor).

The function plots the output with the values in the column used to display facets sorted alphabetically.

Workaround:

p +
  facet_wrap(~ facet_col)
jack-davison commented 1 year ago

Hi Dennis,

This should be fixed now:

dat <- openair::importAURN("my1", 2020)

polar_plot(dat, "o3", facet = "month") +
  scale_opencolours_c() +
  theme_polar() +
  ggplot2::scale_y_continuous(breaks = seq(0, 15, 5)) +
  annotate_polar_axis(breaks = c(5, 10, 15))

image