grid.arrange中地块之间的边距 [英] Margins between plots in grid.arrange

查看:455
本文介绍了grid.arrange中地块之间的边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法找到有关如何使用grid.arrange增加两个图之间的间距的解决方案.我不知道如何进行.我不想改变地块的大小或类似的东西.

I dont seem to be able to find a solution as to how to increase the space between two plots with grid.arrange. I find no clue as to how to proceed. I dont want to change the size of the plots or anything like that.

grid.arrange(plot1, plot2, ncol=2)

(下面添加了以下内容):

(The stuff below was added later):

这是我的代码:

x11()

cs <- grid.arrange(arrangeGrob(b, a, ncol=2, top = textGrob(
                    "B", vjust = 0.5, hjust = 19.5, gp = gpar(
                     fontface = "bold", cex = 1.5)),
                     left = textGrob(~ Delta * "SCR (p - d)" ~ mu * 'S', 
                     gp=gpar(fontsize=18), rot = 90, vjust = 1)))
soc_sph <- grid.arrange(arrangeGrob(p, g, ncol=2, top = textGrob(
                     "A", vjust = 0.5, hjust = 19.5, gp = gpar(
                     fontface = "bold", cex = 1.5)),
                     left = textGrob(~ Delta * "SCR (p - d)" ~ mu * 'S', 
                     gp=gpar(fontsize=18), rot = 90, vjust = 1)))

grid.arrange(soc_sph, cs, ncol=2)

因此,在最后一个grid.arrange中,soc_sph和cs之间的空间要增加.

So it is in this last grid.arrange, the space between soc_sph and cs that is to be increased.

推荐答案

标准方法是更改​​绘图边距,

the standard way is to change the plot margins,

pl = replicate(3, ggplot(), FALSE)
grid.arrange(grobs = pl)  # default settings

margin = theme(plot.margin = unit(c(2,2,2,2), "cm"))
grid.arrange(grobs = lapply(pl, "+", margin))

这篇关于grid.arrange中地块之间的边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆