I have two graphs that I'm placing one above the other, in the following way:
library(ggplot2)
library(gridExtra)
p1 <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
p2 <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
p2 <- p2 + facet_grid(cyl ~ .)
grid.arrange(p1, p2, ncol=1)
For this I need the x axes of the top and bottom graphs to line up, however because of the strip to the left, the faceted graph is narrower than the top graph. I can make the strip invisible using:
theme(strip.text.y = element_blank())
theme(strip.background = element_blank())
However this does not get rid of the space that the strip takes up. So I either need a way to get rid of the strip entirely, or have a way to split my faceted graph into separate graphs, yet somehow sharing the same y-axis label across them. In my graph I have two faceted panels that are not very tall, and there isn't enough space for them to each have a decent-sized y-axis.
Any suggestions?