It\'s relatively simple using grid.arrange
in the gridExtra
package to arrange multiple plots in a matrix, but how can you arrange plots (the ones
An alternative with gtable
library(gtable)
gl <- lapply(1:9, function(ii) grobTree(textGrob(ii), rectGrob()))
# gl <- lapply(1:9, function(ii) ggplotGrob(qplot(1,1) + ggtitle(ii)))
gt <- gtable(widths=unit(rep(1,5), "null"),
heights=unit(rep(1,3), "null"))
gtable_add_grobs <- gtable_add_grob # alias
gt <- gtable_add_grobs(gt, gl,
l=c(1,4,5,4,5,1,2,3,4),
r=c(3,4,5,4,5,1,2,3,5),
t=c(1,1,1,2,2,3,3,3,3),
b=c(2,1,1,2,2,3,3,3,3))
grid.newpage()
grid.draw(gt)