cyxxxxxxxx 发表于 2016-10-5 18:39 
楼主,为什么我运行完之后得到的图里面上半部分数字和星号都巨小,要怎么调整参数才能有你上传的这种效果。
library(corrgram)
panel.conf<-function (x, y, corr = NULL, col.regions, digits = 2, cex.cor,
...)
{
auto <- missing(cex.cor)
usr <- par("usr")
on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
if (!is.null(corr)) {
est <- corr
est <- formatC(est*100, digits = digits, format = "d")
if (auto)
cex.cor <- 0.7/strwidth(est)
text(0.1, 0.6, est, cex = cex.cor)
text(0.8, 0.8, Signif, cex=cex.cor, col = 2)
}
else {
results <- cor.test(x, y, alternative = "two.sided")
est <- results$estimate
est <- round(est, 2)
Signif <- symnum(results$p.value, corr = FALSE, na = FALSE,
cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
symbols = c("***", "**", "*", ".", " "))
if (auto)
cex.cor <- 1.5
text(0.4, 0.5, est, cex=cex.cor,col=2)
text(0.8, 0.8, Signif, cex=cex.cor, col = 2)
}
}
corrgram(shuju1,lower.panel=panel.shade,upper.panel=panel.conf,text.panel=panel.txt,
cex.labels=1.2,font.labels = 1, main = "相关性")
我改了下,有数字和星号了。