[R] pdf: plotting very small points

Rebecca.Hiller at meteoswiss.ch
Wed, 05 Mar 2014 13:34:09 -0000

Dear all,

Ghostscript (version 9.05) cannot open pdfs produced with R (version 3.0.2) that
contain very small points in plots. Other pdf readers (evince, AcrobatReader)
are able to open the file. If setting cex=0, the pdf is readable again:

# does open with gs
pdf("cex_small.pdf")
plot(1,1,cex=10^-3)
dev.off()

# does not open with gs
pdf("cex_verysmall.pdf")
plot(1,1,cex=10^-4)
dev.off()

# does open with gs
pdf("cex_zero.pdf")
plot(1,1,cex=0)
dev.off()

For sure, I can check the value assigned to cex before plotting. However, this
is rather inconvenient. I need to convert the graphs using convert to other file
formats, hence simply using another pdf readers is not an option either. Any
suggestions?

Cheers,
Rebecca Hiller

	[[alternative HTML version deleted]]