I am very late to the party, but can we talk about the absolute LEGEND patchwork by @thomasp85.com?!
I have two plots, one with a hidden y axis (it's the same for both plots). But the plot area will greedily take up the space freed up by the axis, so it appears larger in cowplot's plot_grid().
1/4
I have two plots, one with a hidden y axis (it's the same for both plots). But the plot area will greedily take up the space freed up by the axis, so it appears larger in cowplot's plot_grid().
1/4
Comments
The plot areas are now exactly the same size, without me having to say a word!
Code below.
2/4
library(cowplot)
library(patchwork)
p1 <- ggplot(mpg, aes(displ, hwy)) +
geom_point() +
ggtitle("With Axis")
3/4
geom_point() +
theme(
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.ticks.y = element_blank()
) +
ggtitle("Without Axis")
plot_grid(p1, p2) # cowplot
(p1 | p2) # patchwork
4/4