patchwork
patchwork copied to clipboard
collecting axis titles does not work when using more complex designs
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")
but changing the design leads to the axis collection no longer happening
p1 + p2 + plot_layout(axis_titles = "collect", design = "AAB")
p1 + p2 + plot_layout(axis_titles = "collect", design = "AABB")
axes = "collect" and axis_titles = "collect" it also doesn't work when using coord_equal
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.