I want create a multiplot of ggplot2
plots from a list using grid.arrange
but arrange them by columns before doing it by rows.
gg_list1 <- list(qplot(mpg, disp, data = mtcars),
qplot(hp, wt, data = mtcars),
qplot(qsec, wt, data = mtcars))
gg_list2 <- list(qplot(mpg, disp, data = mtcars),
qplot(hp, wt, data = mtcars),
qplot(qsec, wt, data = mtcars))
I know I can do this:
do.call(grid.arrange,c(gg_list1,gg_list2 , ncol = 2, nrow = 3))
but it fills from left to right before top to bottom.
I've tried this:
do.call(grid.arrange, c(gg_list1, arrangeGrob(gg_list2, nrow = 3), ncol = 2))
But get Error: length(widths) == ncol is not TRUE
Any ideas?