2013-02-28 53 views
1

我繪製了一個corplot,並且我想以.eps文件格式存儲它。問題是在.eps文件中,圈內的數字消失了。有沒有任何參數讓他們回來?將corplot導出爲.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

你看到提到警告

警告消息: 在text.default(Pos [,1],Pos [,2],col = addCo ef.col,labels = round((DAT - : 此設備不支持半透明度:每頁僅報告一次

?這意味着您嘗試使用半透明(暗示,提示alpha設置在addCoef.col參數中)繪製的任何顏色在PostScript圖中都不起作用。

省去了alpha設置如下(只是改變了顏色從rgb(0,0,0,alpha=0.6)rgb(0,0,0),雖然你還不如說"black")工作正常,我的系統上:

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() 
+0

您R右:)非常感謝。 – hora 2013-02-28 15:20:00