Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collecting axis titles does not work when using more complex designs #349

Open
n-kall opened this issue Jan 25, 2024 · 2 comments · May be fixed by #352
Open

collecting axis titles does not work when using more complex designs #349

n-kall opened this issue Jan 25, 2024 · 2 comments · May be fixed by #352

Comments

@n-kall
Copy link

n-kall commented Jan 25, 2024

The following works:

library(ggplot2)
library(patchwork)

p1 <- ggplot(mtcars) +
  geom_point(aes(mpg, disp)) +
  labs(y = "mpg", x = "collected axis title")

p2 <- ggplot(mtcars) +
  geom_boxplot(aes(gear, disp, group = gear)) +
  labs(y = "gear", x = "collected axis title")

p1 + p2 + plot_layout(axis_titles = "collect", design = "AB")

pwork1

but changing the design leads to the axis collection no longer happening

p1 + p2 + plot_layout(axis_titles = "collect", design = "AAB")

pwrk

p1 + p2 + plot_layout(axis_titles = "collect", design = "AABB")

pwork2

@wagnnerms97
Copy link

axes = "collect" and axis_titles = "collect" it also doesn't work when using coord_equal

image

image

@teunbrand teunbrand linked a pull request Feb 12, 2024 that will close this issue
@teunbrand
Copy link
Contributor

With regards to the coord_equal() thingy, the axis/title merging does not seem to work there because the axes appear to be nested alongside panels and don't have the usual grob names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants