gridExtra 2.0.0 更改标题大小 [英] gridExtra 2.0.0 change title size
问题描述
我知道 gridExtra 已更新.结果,我想知道如何更改标题大小.这不再有效
I know that gridExtra has been updated. As a result, I'm left wondering how to change title sizes. This no longer works
grid.arrange(a, b, c, d,ncol=2,
nrow=2, main=textGrob("Title", gp=gpar(fontsize=15,font=8)))
这不再有效,主要选项已更改为顶部,但我无法弄清楚 textGrob 功能来改变字体大小).有什么线索吗?谢谢
That no longer works, the option for main has been changed to top but I can't figure out the textGrob features to alter the font size). Any clues? Thanks
推荐答案
首先,使用 library()
或 require()<导入包
grid
/代码>.其次,将代码中的 main
更改为 top
.
First, import the package grid
with either library()
or require()
.
Second, change main
to top
in your code.
见下文:
library(grid)
grid.arrange(a, b, c, d,ncol=2,
nrow=2, top=textGrob("Title", gp=gpar(fontsize=15,font=8)))
我在使用 gridExtra v2.0.0
时遇到了类似的问题,收到以下错误:
I ran into a similar issue with gridExtra v2.0.0
, receiving the following error:
arrangeGrob(...) 中的错误:找不到函数textGrob"
Error in arrangeGrob(...) : could not find function "textGrob"
表示网格没有作为 gridExtra
的依赖项加载.我通过要求或导入库 grid
解决了这个问题:require(grid)
或 library(grid)
.
indicating that grid wasn't loaded as a dependency for gridExtra
. I resolved it by requiring or importing the library grid
by either:require(grid)
or library(grid)
.
希望有所帮助.
这篇关于gridExtra 2.0.0 更改标题大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!