【发布时间】:2021-04-07 12:53:22
【问题描述】:
我有两个可以这样创建的 ggplot:
df1 = data.frame(x=1:10, y1=11:20, y2=21:30)
gg1 = ggplot(df1) + geom_point(aes(x=x, y=y1))
gg2 = ggplot(df1) + geom_point(aes(x=x, y=y2))
grid.arrange(gg1, gg2, top=textGrob("Here should be some space above",
gp=gpar(fontsize=18,
fontfamily="Times New Roman")))
现在输出如下所示:
这里看不到它,因为它是白底白字,但我想在标题上方的输出图像中创建更多空间。而且我不确定该怎么做。这里描述了如何在单个图 Margins between plots in grid.arrange 之间添加空格,但我没有设法在标题上方添加空格。
【问题讨论】:
-
如何使用
padding=unit(1, "cm")在注释周围增加一点空间
标签: r ggplot2 gridextra r-grid