Reading in multiple png files in order to create a new plot with grid.arrange

前端 未结 2 1393
北荒
北荒 2021-01-06 02:51

Let\'s say that I just created 4 histograms in ggplot2. After finishing, I realized that I should have used grid.arrange to combine some of the plots into a single graphics

2条回答
  •  無奈伤痛
    2021-01-06 03:27

    rl = lapply(sprintf("my_viz%i.png", 1:4), png::readPNG)
    gl = lapply(rl, grid::rasterGrob)
    gridExtra::grid.arrange(grobs=gl)
    

提交回复
热议问题