teunbrand / ggh4x

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

Ggh4x not responding to aspect ratio #56

Closed reubebe closed 2 years ago

reubebe commented 2 years ago

I am unable to manipulate my aspect ratio with the nested facets. Is there a way around it

teunbrand commented 2 years ago

Hello there,

Thank you for reporting this issue. At the moment, there isn't really a way around this, but it seems relatively easy to fix, so I'll have a look if I can fix it later today.

Best, Teun

teunbrand commented 2 years ago

Should now be able to do the following

library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.1.1
library(ggh4x) # devtools::install_github("teunbrand/ggh4x")

p <- ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  facet_grid2(~ year)

p + theme(aspect.ratio = 2)

p + theme(aspect.ratio = 0.5)

Created on 2021-10-28 by the reprex package (v2.0.1)

reubebe commented 2 years ago

Thank you.