How can I align multiple plots by their titles instead of plot area?

后端 未结 2 946
北恋
北恋 2021-01-14 04:09

I\'m using egg to align multiple plots on a page. I\'m wondering if it\'s possible to align two columns by the titles a) and c) instead of plot are

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 04:46

    Adding a blank dummy faceting variable to plot p1/ a) seems like the easiest solution

    p1 <- ggplot(data.frame(mtcars, dummy=''), 
                 aes(mpg, wt, colour = factor(cyl))) +
      geom_point() + ggtitle("a)") +
      facet_wrap(~dummy)
    

提交回复
热议问题