teunbrand / ggh4x

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

Facet size = "variable" not working? #143

Closed Ari04T closed 5 months ago

Ari04T commented 5 months ago

Hello!

I tried to use the code provided on Facets to get some variable facet size but it doesn't seem to be working. I assume this may have something to do with the latest version of ggplot? Or am I doing something wrong? I'm currently working with latest ggh4x (0.2.7.9000) and ggplot2 (3.4.4.9000).

ggplot(df, aes(x, y)) +
    geom_point() +
    theme(strip.text.y.left = element_text(angle = 0),
          strip.placement = "outside",
          plot.title.position = "plot") +
    facet_grid2(long + short ~ ., switch = "y",
                strip = strip_vanilla(size = "variable")) +
    ggtitle('size = "variable"')

image

teunbrand commented 5 months ago

Hi there, thanks for the report. I can indeed reproduce the issue.

teunbrand commented 5 months ago

Fixed by https://github.com/teunbrand/ggh4x/commit/cfbf4dc8f62cd1b4fc0b90817bd12f7d096ac6c3