ggplot2 - Correctly arrange odd number of plots into one figure

后端 未结 4 1652
攒了一身酷
攒了一身酷 2020-12-19 11:42

I have an odd number of plots to arrange into one figure and I desire to show the last plot centered in the last row of the figure.

Here some sample data:

         


        
4条回答
  •  生来不讨喜
    2020-12-19 11:55

    A not-terribly elegant solution would be to leave the middle plot empty on the first row:

    p_no_labels2<-list(p_no_labels[[1]],NULL,p_no_labels[[2]],NULL,p_no_labels[[3]])
    p_grid = cowplot::plot_grid(plotlist = p_no_labels2, ncol = 3) 
    

提交回复
热议问题