How to align an ordinary ggplot with a faceted one in cowplot?

后端 未结 5 395
南方客
南方客 2020-12-24 13:40

I\'m trying to arrange plots for publication with the use of cowplot package.
I just want the panels to be equally sized and labelled.

Reproducibl

5条回答
  •  梦毁少年i
    2020-12-24 14:39

    I have a simpler solution sticking with plot_grid and the original example. However some may feel it is a bit of a cheat. One can fine-tune aligning plots with cowplot:plot_grid by adding nested NULL plots and adjusting their height/width ratios. This is applied below:

    gg3<-plot_grid(NULL,gg2, NULL, align = 'h', nrow = 3, rel_heights = c(0.06,1,0.06))
    plot_grid(gg1,gg3, labels = c('A','B'),label_size = 20)
    

提交回复
热议问题