ggplot绘图之一页多图

可以用ggupr包中的multiplot函数

multiplot(…,plotlist=NULL, cols=1,layout=NULL)

plotlist: a list of ggplot objescts

cols: Number of columns in layout

layout: A matrix specifying the layout. If present, 'cols' is ignored

If the layout is something like matrix(c(1,2,3,3), nrow=2, byrow=TRUE), then plot 1 will go in the upper left, 2 will go in the upper right, and 3 will go all the way across the bottom

注意,一般默认是按列填充,如设定图片类型为两行,则先填充第一列,再填充第二列,以此类推。

例:multiplot(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,cols=5)

猜你喜欢

转载自blog.csdn.net/qq_42458954/article/details/82669363