teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
https://teunbrand.github.io/ggh4x/
Other
563 stars 33 forks source link

Add switch to `facet_manual()` for reserving extra space #86

Closed teunbrand closed 1 year ago

teunbrand commented 1 year ago

For use case, see https://stackoverflow.com/questions/75066921/center-facets-in-ggplot2

teunbrand commented 1 year ago
devtools::load_all("~/packages/ggh4x")
#> ℹ Loading ggh4x
#> Loading required package: ggplot2

df <- data.frame(x = 1:6)

design <- c("A##B\nCDDE\n#FF#\n#FF#")

ggplot(df, aes(x, x)) +
  facet_manual(~ x, design, strip.position = "left") +
  guides(x.sec = "axis", y.sec = "axis")

Created on 2023-03-28 with reprex v2.0.2