R:标题用par()减半

时间:2015-03-04 05:54:48

标签: r plot r-corrplot

我有这个数字:

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))

产生的标题减半:

enter image description here

关注this answer我设置oma=c(0,0,2,0)但不会影响结果。我不确定应修改哪个边距。我查看?par并修改了" oma"," omd"," omi"," mai"," MAR"没有结果。

1 个答案:

答案 0 :(得分:9)

我发现将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()

enter image description here