Grid of multiple ggplot2 plots which have been made in a for loop

I would be inclined to agree with Richie, but if you want to arrange them yourself: library(gridExtra) library(ggplot2) p <- list() for(i in 1:4){ p[[i]] <- qplot(1:10,10:1,main=i) } do.call(grid.arrange,p) take a look at the examples at the end of ?arrangeGrob for ways to eliminate the for loop altogether: plots = lapply(1:5, function(.x) qplot(1:10,rnorm(10),main=paste(“plot”,.x))) require(gridExtra) do.call(grid.arrange, … Read more

Arrange base plots and grid.tables on the same page

To combine base plots and grid objects the package gridBase is useful. A rough worked example base on your layout above library(grid) library(gridBase) library(gridExtra) layout(matrix(c(1,3, 2,3, 4,3), nrow = 3, ncol = 2, byrow = TRUE)) # First base plot plot(1:10) # second base plot frame() # Grid regions of current base plot (ie from … Read more

How can I obtain an ‘unbalanced’ grid of ggplots?

grid.arrange draws directly on the device; if you want to combine it with other grid objects you need arrangeGrob, as in p = rectGrob() grid.arrange(p, arrangeGrob(p,p,p, heights=c(3/4, 1/4, 1/4), ncol=1), ncol=2) Edit (07/2015): with v>2.0.0 you can use the layout_matrix argument, grid.arrange(p,p,p,p, layout_matrix = cbind(c(1,1,1), c(2,3,4)))