我正在尝试使用 grid.arrange 组合多种类型的图形/表格,其中之一是使用corrplot. 有没有办法将 corrplot 转换为 grob 或导出/导入为与 兼容的图像grid.arrange?由于我组合的其他图来自 ggplot 和 tableGrob,我似乎无法使用par(mfrow = c(2, 2))或layout(matrix(1:2))按照其他帖子中的建议。
P1 <- corrplot(PANAcor, order="hclust", addgrid.col = "gray",
type="full", col = col2(50), tl.cex=1.5, tl.col="black",
method="color", tl.pos="lt", tl.srt=45, hclust.method = "average",
cl.ratio = 0.25, cl.align = "l", number.cex = 2)
summary <- grid.arrange(
top=textGrob(sprintf("%s Summary",subject), gp=gpar(fontsize=16,font=8)),
blank, P1, P2,
blank, T1, T2,
ncol=3, widths = c(0.1, 3, 3),
nrow=2, heights= c(1, 1),
bottom = textGrob(sprintf("%s run %s",version,runtime),
gp=gpar(fontsize=6,font=8), hjust=-1) …Run Code Online (Sandbox Code Playgroud)