我在这里读到了巴普蒂斯特对gridextra的tableGrob函数的出色解释:https://github.com/baptiste/gridextra/wiki/tableGrob
从他关于美学格式的一节来看:
tt1 <- ttheme_default()
tt2 <- ttheme_minimal()
tt3 <- ttheme_minimal(
core=list(bg_params = list(fill = blues9[1:4], col=NA),
fg_params=list(fontface=3)),
colhead=list(fg_params=list(col="navyblue", fontface=4L)),
rowhead=list(fg_params=list(col="orange", fontface=3L)))
grid.arrange(
tableGrob(iris[1:4, 1:2], theme=tt1),
tableGrob(iris[1:4, 1:2], theme=tt2),
tableGrob(iris[1:4, 1:2], theme=tt3),
nrow=1)
我想知道是否有可能为特定的tableGrob修改主题“动态”,例如:
grid.arrange(
tableGrob(iris[1:4, 1:2], theme=tt1 + theme_default(core=list(fg_params=list(cex=0.7))),
tableGrob(iris[1:4, 1:2], theme=tt2),
tableGrob(iris[1:4, 1:2], theme=tt3),
nrow=1)
最后一段代码不起作用,但我想做的是动态修改主题"tt1“,以更改仅用于第一个tableGrob的核心文本大小,而不永久地更改主题"tt1”。
谢谢!
发布于 2015-10-21 19:57:15
主题似乎只是清单。您可以使用modifyList
更新列表的属性。例如
grid.arrange(
tableGrob(iris[1:4, 1:2], theme=modifyList(tt1, list(core=list(fg_params=list(cex=0.7))))),
tableGrob(iris[1:4, 1:2], theme=tt2),
tableGrob(iris[1:4, 1:2], theme=tt3),
nrow=1)
https://stackoverflow.com/questions/33267814
复制相似问题