how to set maximum radius limit in a ggopenair polar_plot() in R

34 views Asked by At

I am attemptin to generate a smoothened polar plot with winddirection, wind speed, and pollutant concentration using ggopenair package in R, which is based on ggplot2 plotting. ( https://github.com/jack-davison/ggopenair ) However, I am unable to customize plot appearenace. I want to get rid of the outermost circle. No matter what limit I choose it the plotting fuction extends it. Also, I want change orientation of key.header (which is the colorbar label). The plot I am getting:enter image description here

I went through the ggopenair documentation and tried annotate and theme functions but it's not working.

plt <- ggopenair::polar_plot(mydata, pollutant = "nox") 

plt +
  ggopenair::theme_polar(base_size = 13,base_family = "Times new roman" ) +
  theme(
    panel.background = element_blank(),
    panel.grid = element_blank(),
    plot.background = element_rect(fill = "white"),
    axis.line.x = element_blank(),
    axis.line.y = element_blank(),
    axis.text = element_text(color = "black"),
    legend.background = element_blank(),
    legend.text = element_text(color = "black"),
    legend.title = element_text(color = "black"),
    legend.title.align=0,
    panel.ontop = TRUE,
    text = element_text(family = "Times new roman"),
  ) +
  scale_y_limitval(marker_values = 24, marker_linetypes = 1, limits=c(0,24),breaks = seq(0, 24,4))+
  ggopenair::scale_opencolors_c(limits=c(0, 400), scheme = "turbo") +
  ggopenair::annotate_polar_axis(
    seq(0, 24,4),
    direction = "NW",
    labels = seq(0, 24,4),
    drop=TRUE,
  )

Any help would be highly appreciated. Thanks.

0

There are 0 answers