gpt4 book ai didi

R:标题用par()减半

转载 作者:行者123 更新时间:2023-12-04 12:02:00 27 4
gpt4 key购买 nike

我有这个图:

require(corrplot)
par(oma=c(0,0,2,0), mfrow = c(1, 3))
for (country in c("Italy","Germany","Afghanistan")) {
corrplot.mixed(cor(data.frame(v1=rnorm(40),
v2=rnorm(40),
v3=rnorm(40),
v4=rnorm(40),
v5=rnorm(40),
v6=rnorm(40),
v7=rnorm(40),
v8=rnorm(40)), use="pairwise.complete.obs"),
main=country)
}
par(mfrow = c(1, 1))

产生的标题减少了一半:

this answer之后,我设置了 oma=c(0,0,2,0),但它不会影响结果。我不确定应该修改哪个边距。我查看了 ?par并修改了“oma”,“omd”,“omi”,“mai”,“mar”,但没有结果。

最佳答案

我发现将mar参数传递给corrplot是有效的:

    png(height=300,width=600);par(oma=c(0,0,2,0), mfrow = c(1, 3))
for (country in c("Italy","Germany","Afghanistan")) {
corrplot.mixed(cor(data.frame(v1=rnorm(40),
v2=rnorm(40),
v3=rnorm(40),
v4=rnorm(40),
v5=rnorm(40),
v6=rnorm(40),
v7=rnorm(40),
v8=rnorm(40)), use="pairwise.complete.obs"),
main=country, mar=c(0,0,2,0))
};dev.off()

关于R:标题用par()减半,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28847524/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com