使用grid.arrange在multiplot ggplot2中更改多行标题

car*_*rol 2 r ggplot2

我遵循了讨论的建议

使用grid.arrange在multiplot ggplot2中更改标题

但我的2行标题不会改变字体大小.

1-我应该在grid.arrange中声明main还是在没有main的情况下使用grid.arrange然后添加以下脚本

main=textGrob(paste("titleLine1", "titleLine2", sep = "\n"),gp=gpar(fontsize=20))
Run Code Online (Sandbox Code Playgroud)

谢谢

颂歌

bap*_*ste 7

这是一种可能性,

在此输入图像描述

library(grid); library(gridExtra)
tg <- textGrob("Title Goes Here", gp=gpar(fontsize=30))
sg <- textGrob("more subtle subtitle ", gp=gpar(fontsize=15, fontface=3L))
margin <- unit(0.5, "line")
grid.newpage()
grid.arrange(tg, sg, rectGrob(), 
             heights = unit.c(grobHeight(tg) + 1.2*margin, 
                              grobHeight(sg) + margin, 
                              unit(1,"null")))
Run Code Online (Sandbox Code Playgroud)