将corrplot导出到.eps文件

时间:2013-02-28 14:45:22

标签: r eps r-corrplot

我有一个corrplot,我希望以.eps文件格式。问题是在.eps文件中,圆圈内的数字消失了。是否有任何参数可以让他们回来?

library(corrplot)
test <- structure(c(100, 41.6411042944785, 69.6478873239437, 99.35956084172, 
 100, 99.9295774647887, 90.4849039341263, 54.409509202454, 100
 ), .Dim = c(3L, 3L), .Dimnames = list(c("x1", "x2", "x3"), c("x1", 
 "x2", "x3")))

没有.eps格式:(表现不错)

corrplot(round(test),tl.cex=1.5,title="test", method="circle",is.corr=FALSE,type="full",
    cl.lim=c(0,100),cl.cex=2,addgrid.col="blue",addshade="positive",col=col1, addCoef.col = rgb(0,0,0, alpha =0.6), mar=c(0,0,1,0), diag= FALSE)

以.eps格式:

postscript("test.eps", height=8, width=8, paper="special", family="Helvetica", fonts="Helvetica", horizontal=FALSE, onefile=FALSE)
corrplot(round(test),tl.cex=1.5,title="test", method="circle",is.corr=FALSE,type="full",
         cl.lim=c(0,100),cl.cex=2,addgrid.col="blue",addshade="positive",col=col1, addCoef.col = rgb(0,0,0, alpha =0.6), mar=c(0,0,1,0), diag= FALSE)
dev.off()

1 个答案:

答案 0 :(得分:1)

您是否看到了上述警告

  

警告讯息:   在text.default(Pos [,1],Pos [,2],col = addCoef.col,labels = round((DAT - :     此设备不支持半透明度:每页仅报告一次

?这意味着您尝试使用半透明度(提示,提示:alpha参数中的addCoef.col设置)绘制的任何颜色都不适用于PostScript图。

取消alpha设置如下(只是将颜色从rgb(0,0,0,alpha=0.6)更改为rgb(0,0,0),尽管您可以说"black")在我的系统上正常工作:< / p>

library("corrplot")
col1 <- "green"  ## you didn't tell us what col1 was so I made something up
postscript("test.eps", height=8, width=8, paper="special",
    family="Helvetica", fonts="Helvetica", horizontal=FALSE, onefile=FALSE)
corrplot(round(test),tl.cex=1.5,title="test", method="circle",
    is.corr=FALSE,type="full",
    cl.lim=c(0,100),cl.cex=2,
    addgrid.col="blue",addshade="positive",
    col=col1, addCoef.col = rgb(0,0,0), mar=c(0,0,1,0), diag= FALSE)
dev.off()