[英]Easiest way how to plot plenty side by side graphs using ggplot
假設我們要使用 ggplot 並排處理 plot 12 個圖形。 例如
qplot(x,3*x+eps) #I want to have 12 graphs of this
plot_grid() #And now I can insert 12 times qplot above into plot_grid to get my result.
我的問題是:有什么辦法我可以 plot 它而不將 qplot 放到 plot_grid 12 次?
提前致謝!
使用replicate
重復繪圖並使用do.call
plot_grid
plot 它們:
do.call(cowplot::plot_grid, replicate(12, qplot(x,3*x+eps), simplify = FALSE))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.