[R] image() generates many border lines in pdf, not on screen (quartz) - R 2.9.1 GUI 1.28 Tiger build 32-bit (5444) - OS X 10.5.8

Stefan Evert stefan.evert at uos.de
Mon Aug 24 13:42:44 CEST 2009

On 23 Aug 2009, at 20:26, Uwe Ligges wrote:

> Since it looks like nobody answered so far:
> Your code is not reproducible, we do not have rfc, y, zVals nor  
> NoCols.

It's much easier to reproduce: just type in the first example from the  
"image" help page

	x <- y <- seq(-4*pi, 4*pi, len=27)
	r <- sqrt(outer(x^2, y^2, "+"))
	image(z = z <- cos(r^2)*exp(-r/6), col=gray((0:32)/32))

then save from the quartz() display (I used the menu) and view with  
Adobe Reader 9 (I seem to have 9.0.0).  Instead of the fine white  
lines you always get with Preview.app and other inaccurate PDF  
renderers, there are now huge gaps between the pixels (around 1/10th  
of pixel width).

This is very probably a bug in the Quartz device (or Quartz itself),  
as the lines go away if you save the plot with dev.copy2pdf(), which I  
normally use.

@OP: Do you have any particular reason for using quartz.save() or the  
menu item instead of dev.copy2pdf()?

> You could also try to place a screenshot somewhere on a webpage  
> including the info about the settings of the corresponding viewer.

I've tried switching off _all_ of the numerous anti-aliasing options  
of Adobe Reader 9; absolutely no difference.

Hope this helps,

More information about the R-help mailing list