Side-by-side plots with ggplot2

后端 未结 13 2484
轮回少年
轮回少年 2020-11-22 02:06

I would like to place two plots side by side using the ggplot2 package, i.e. do the equivalent of par(mfrow=c(1,2)).

For example, I would like to have t

13条回答
  •  自闭症患者
    2020-11-22 02:36

    In my experience gridExtra:grid.arrange works perfectly, if you are trying to generate plots in a loop.

    Short Code Snippet:

    gridExtra::grid.arrange(plot1, plot2, ncol = 2)
    

提交回复
热议问题