I have a list of ggplots that may be too complex to arrange using facet_wrap. All plots must share the same legend and should be arranged in a grid. Each column of the grid needs a different title, also each row of the grid needs a differen title.
An absurdly simple example:
library(ggplot2)
library(ggpubr)
plot1<- ggplot() + geom_point(aes(x=1, y=1, col="a"))
plot2<- ggplot() + geom_point(aes(x=1, y=1, col="a"))
plot3<- ggplot() + geom_point(aes(x=1, y=1, col="a"))
plot4<- ggplot() + geom_point(aes(x=1, y=1, col="a"))
plotlist<- list(plot1, plot2, plot3, plot4)
ggarrange(plotlist = plotlist, ncol = 2, nrow = 2, common.legend = TRUE, legend="bottom")
This produces everything needed except the column and row titles, and annotate_figure only adds a global title to the figure. The desired output should look like:
plot1<-plot2<-plot3<-plot4<-
when all objects are the same – Globe