Adding x and y laxis label to ggplot-grid build with cowplot

后端 未结 2 628
情书的邮戳
情书的邮戳 2021-01-16 10:33

I produced a grid with cowplot:

library(ggplot2)
library(cowplot)

ggg1 <- ggplot(mtcars, aes(mpg,vs)) + geom_point() +
  theme(axis.title.x=element_blank         


        
2条回答
  •  天涯浪人
    2021-01-16 11:36

    Here's an alternative strategy

    library(grid)
    library(gridExtra)
    library(egg)
    grid.arrange(gtable_cbind(gtable_frame(ggarrange(ggg1, ggg2, draw=F)), 
                              gtable_frame(ggplotGrob(ggg3))),
                 left = textGrob("Left",rot=90), 
                 bottom = textGrob("Bottom"))
    

    enter image description here

提交回复
热议问题