[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
Uwe Ligges
ligges at statistik.tu-dortmund.de
Mon Aug 24 14:50:01 CEST 2009
Stefan Evert wrote:
>
> 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
Well, not possible for me on Windows .....
Anyway, please use the pdf() device directly and see if it works:
pdf("path/to/file.pdf")
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))
dev.off()
> (I used the menu) and view with
> Adobe Reader 9 (I seem to have 9.0.0).
You should upgrade (even just for security reasons and many bugfixes),
9.1.3 is recent on Windows.
Uwe Ligges
> 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,
> Stefan
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list