ggplot2 多圖排版

和R自帶的繪圖系統不一樣,ggplot2不能直接經過par(mfrow) 或者 layout()來排版多張圖片。終於發現,其實能夠經過一個『gridExtra』包來搞定:html

require(gridExtra)
plot1 <- Make_Smoking_Plot_TCGA("CLDN18", type = "Normal")
plot2 <- Make_Smoking_Plot_TCGA("CLDN18", type = "Tumor")
plot3 <- Make_Smoking_Plot_TCGA("CLDN18", type = "Tumor", exp_data = Expression_TvN_TCGA_Sel1)
plot4 <- Make_Smoking_Plot_TCGA("CLDN18", type = "Tumor", exp_data = Expression_TvN_TCGA_Sel2)
plot5 <- Make_Smoking_Plot_TCGA("CLDN18", type = "Tumor", exp_data = Expression_TvN_TCGA_Sel3)
plot6 <- Make_Smoking_Plot_TCGA("CLDN18", type = "Tumor", exp_data = Expression_TvN_TCGA_Sel4)
grid.arrange(plot1, plot2, plot3, plot4, plot5, plot6, ncol=2)

Reference: http://rstudio-pubs-static.s3.amazonaws.com/2852_379274d7c5734f979e106dcf019ec46c.htmlui

相關文章
相關標籤/搜索