davidhodge931 / ggblanket

Simplify ggplot2 visualisation
https://davidhodge931.github.io/ggblanket/
Other
149 stars 8 forks source link

docs: update vignette multiple layers example #898

Closed davidhodge931 closed 1 month ago

davidhodge931 commented 1 month ago
penguins |>
  drop_na() |> 
  group_by(species, sex) |>
  summarise(
    lower = quantile(flipper_length_mm, probs = 0.05),
    upper = quantile(flipper_length_mm, probs = 0.95),
    flipper_length_mm = mean(flipper_length_mm, na.rm = TRUE),
  ) |>
  gg_blanket(
    x = flipper_length_mm,
    xmin = lower, 
    xmax = upper,
    y = species,
    col = sex,
    position = position_dodge(width = 0.75),
    x_expand_limits = 0,
  ) +
  geom_col(
    width = 0.75,
    position = position_dodge(width = 0.75),
    alpha = 0.9,
  ) +
  geom_errorbar(
    width = 0.1, 
    position = position_dodge(width = 0.75),
    colour = lightness[1],
  )  
davidhodge931 commented 1 month ago

Updated :)