Left align two graph edges (ggplot)

前端 未结 9 1539
梦谈多话
梦谈多话 2020-11-22 01:08

I\'m using ggplot and have two graphs that I want to display on top of each other. I used grid.arrange from gridExtra to stack them. The problem is I want the

9条回答
  •  眼角桃花
    2020-11-22 01:42

    I know this is an old post, and that it has already been answered, but may I suggest combining @baptiste's approach with purrr to make it nicer-looking:

    library(purrr)
    list(A, B) %>% 
      map(ggplotGrob) %>% 
      do.call(gridExtra::gtable_rbind, .) %>% 
      grid::grid.draw()
    

提交回复
热议问题