[R-SIG-Mac] problems with the png(type = quartz) device

Kasper Daniel Hansen khansen at stat.berkeley.edu
Tue Jan 12 14:50:01 CET 2010


Steffen Neuman has provided the following reproducible example

for (subtype in c("cairo", "Xlib", "quartz")) {
png(filename=paste("test",subtype,"plot%003d.png", sep="_"),
    width = 640, height = 480, type=subtype)
for (i in c(1,2,3)) {
  plot(0,0, type="n", main=i,
       xlim=c(-1 + 0.1*i, +1 + 0.1*i),
       ylim=c(-1 + 0.1*i, +1 + 0.1*i),
       xlab="xlab",ylab="ylab")
  points(0.1*i, 0.1*i , col=i)
  Sys.sleep(1)
}
dev.off()
}

which shows that there is a clear problem with png(type = "quartz").  I am even ready to mention the dreaded "b"-word :)

As an aside I find the difference between cairo and Xlib a bit strange: in the cairo device you can clearly see a difference between the box around the plot and where the x-axis / y-axis has been plotted.  This might be a rendering issue, but personally I find it less aesthetically pleasing.

Kasper


More information about the R-SIG-Mac mailing list