Set the height of the graphs y-axis in grid.arrange, but not of the entire plot area

后端 未结 2 1702
醉话见心
醉话见心 2021-01-18 05:49

When using grid arrange I encountered the following problem : \"inital I want all my panels (a,b,c) to

2条回答
  •  爱一瞬间的悲伤
    2021-01-18 06:05

    You should use rbind instead of grid.arrange,

    plots <- list(p_a, p_b, p_c)
    grobs <- lapply(plots, ggplotGrob)
    # for gridExtra < v2.3, use do.call(gridExtra::rbind.gtable, grobs)
    # for gridExtra >= v2.3 use:
    g <- do.call(gridExtra::gtable_rbind, grobs)
    
    library(grid)
    grid.newpage()
    grid.draw(g)
    

提交回复
热议问题