I produced a grid with cowplot:
library(ggplot2)
library(cowplot)
ggg1 <- ggplot(mtcars, aes(mpg,vs)) + geom_point() +
theme(axis.title.x=element_blank(),
axis.title.y=element_blank())
ggg2 <- ggplot(mtcars, aes(mpg,vs)) + geom_point() +
theme(axis.title.x=element_blank(),
axis.title.y=element_blank())
ggg3 <- ggplot(mtcars, aes(mpg,vs)) + geom_point() +
theme(axis.title.x=element_blank(),
axis.title.y=element_blank())
plot_grid(plot_grid(ggg1, ggg2, labels=c("", ""), ncol = 1), ggg3, labels=c("", ""), ncol = 2)
resulting in the image
(of course this is just a minimal working example).
Now I would like to have a xaxis with the title "mpg" and a yaxis with the title "vs" - each centered like so:
How can I do this with ggplot. Nothing I tried with add_sub
or draw_label
or How do I customize the margin and label settings with plot_grid? worked. The answer to ggplot: how to add common x and y labels to a grid of plots does not use cowplot. Can I do this with cowplot?
Important: I want to be able to set the size of the font of the labels.