teunbrand / ggh4x

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

New strips resizes wrong strip #45

Closed teunbrand closed 3 years ago

teunbrand commented 3 years ago
library(ggplot2)
library(ggh4x)

df <- data.frame(outer = c("A","B", "B", "C", "C", "C"),
                 inner = paste("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua", 1:6),
                 x=1, y =1)

theme_set(theme_gray() + theme(strip.text.y.right =  element_text(angle = 0)))

ggplot(df, aes(x,y)) +
  geom_point() +
  facet_nested(outer + inner ~ .,
               scales = "free_y",
               space = "free_y",
               labeller = label_wrap_gen(40),
               strip = strip_nested(size = "variable")
  ) +
  scale_y_discrete(label = NULL)

Created on 2021-06-29 by the reprex package (v1.0.0)