Question

I have a plotted a corrplot and I want to have it in .eps file format. The problem is that in the .eps file, the numbers inside the circles are vanished. Is there any parameter to get them back?

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

without .eps format: (perform well)

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)

In .eps format:

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()
Was it helpful?

Solution

Did you see the warning that said

Warning message: In text.default(Pos[, 1], Pos[, 2], col = addCoef.col, labels = round((DAT - : semi-transparency is not supported on this device: reported only once per page

? That means that any colours you try to draw with semi-transparency (hint, hint: the alpha settings in your addCoef.col argument) won't work in a PostScript plot.

Eliminating the alpha setting as follows (just changing the colour from rgb(0,0,0,alpha=0.6) to rgb(0,0,0), although you might as well say "black") works fine on my system:

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()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top