Andreas Fischlin
2009-Aug-17 11:32 UTC
[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
Dear all, I have invested substantial amount of work in a complicated, yet on screen perfect looking graph that uses image(). Unfortunately saving it as pdf (or quartz.save at high resolution) all generate very disturbing border lines around each small rectangle that image() has drawn. While using Preview it helps to turn off antialiasing to make those faint lines disappear on screen (http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Why-are-there-faint-lines-in-image-plots_003f). However, they are far from faint on pdf (Adobe Reader v9.1.3, regardless of settings) or any other high resolution rendering (printer) and do not disappear, whatever I do. What I encounter is also in quite sharp contrast with all I read on this issue, including R mailing lists (e.g. http://finzi.psych.upenn.edu/R/Rhelp02/archive/30588.html), e.g. if someone claims those lines would not matter and go away when printing. In my case they don't. BTW, my image() statement looks like this: image(rfc, y, -t(zVals), zlim=c(-noCols-0.5,0.5), col = heat.colors(noCols), axes=F, add=T) where z is a 127 x 3 matrix. Since I need high resolution variants for final publication I need to know whether it is possible to force image() to give up drawing these borders (I tried already several low level par parameters, all to no avail). On screen everything looks perfect, pdf, clipboard, quartz.save, save all look bad up to inacceptibly bad, especially pdf and any printing! Reading all what I could find on this topic, I fear there might even a bug be present in R (R 2.9.1 GUI 1.28 Tiger build 32-bit (5444)). Can anyone offer some insight or even help? Thanks. Andreas -- ________________________________________________________________________ ETH Zurich Prof. Dr. Andreas Fischlin Systems Ecology - Institute of Integrative Biology CHN E 21.1 Universitaetstrasse 16 8092 Zurich SWITZERLAND andreas.fischlin at env.ethz.ch www.sysecol.ethz.ch/staff/af +41 44 633-6090 phone +41 44 633-1136 fax Make it as simple as possible, but distrust it! ________________________________________________________________________ * *
Uwe Ligges
2009-Aug-23 18:26 UTC
[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
Since it looks like nobody answered so far: Your code is not reproducible, we do not have rfc, y, zVals nor NoCols. You could also try to place a screenshot somewhere on a webpage including the info about the settings of the corresponding viewer. Best, Uwe Ligges Andreas Fischlin wrote:> Dear all, > > I have invested substantial amount of work in a complicated, yet on > screen perfect looking graph that uses image(). Unfortunately saving it > as pdf (or quartz.save at high resolution) all generate very disturbing > border lines around each small rectangle that image() has drawn. While > using Preview it helps to turn off antialiasing to make those faint > lines disappear on screen > (http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Why-are-there-faint-lines-in-image-plots_003f). > However, they are far from faint on pdf (Adobe Reader v9.1.3, regardless > of settings) or any other high resolution rendering (printer) and do not > disappear, whatever I do. What I encounter is also in quite sharp > contrast with all I read on this issue, including R mailing lists (e.g. > http://finzi.psych.upenn.edu/R/Rhelp02/archive/30588.html), e.g. if > someone claims those lines would not matter and go away when printing. > In my case they don't. > > BTW, my image() statement looks like this: > > image(rfc, y, -t(zVals), zlim=c(-noCols-0.5,0.5), col = > heat.colors(noCols), axes=F, add=T) > > where z is a 127 x 3 matrix. > > Since I need high resolution variants for final publication I need to > know whether it is possible to force image() to give up drawing these > borders (I tried already several low level par parameters, all to no > avail). On screen everything looks perfect, pdf, clipboard, quartz.save, > save all look bad up to inacceptibly bad, especially pdf and any printing! > > Reading all what I could find on this topic, I fear there might even a > bug be present in R (R 2.9.1 GUI 1.28 Tiger build 32-bit (5444)). Can > anyone offer some insight or even help? > > Thanks. > > Andreas > > > ------------------------------------------------------------------------ > > ______________________________________________ > 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.