[R] Artifacts in filled.contour+pdf

David Winsemius dwinsemius at comcast.net
Tue Oct 26 02:30:20 CEST 2010


On Oct 25, 2010, at 6:50 AM, Mario Valle wrote:

> Dear all,
> I'm using R 2.12.0 on Windows 7 (32bits)
> I created a filled contour from the attached data using the  
> following code:
>
> load('bug.RData')
> pdf('bug.pdf', width=14, height=7)
> filled.contour(o4$x, o4$y, o4$z, color=rainbow, xlim=c(4,18),  
> ylim=c(0,35), zlim=c(14,36))
> dev.off()
>
> If you look (I used acrobat reader 9.4) at the attached bug.pdf, you  
> see an incomplete grid of gray lines.

 From the pdf help page:
"Note
If you see problems with PDF output, do remember that the problem is  
much more likely to be in your viewer than in R. Try another viewer if  
possible. Symptoms for which the viewer has been at fault are apparent  
grids on image plots (turn off graphics anti-aliasing in your viewer  
if you) and missing or incorrect glyphs in text (viewers silently  
doing font substitution).

Unfortunately the default viewers on most Linux and Mac OS X systems  
have these problems, and no obvious way to turn off graphics anti- 
aliasing. "

Are they there when printed?

On a Mac I can make the lines in that pdf graphic "appear and  
disappear" in different places on my screen by changing the "Page  
Display" settings for Resolution in Acrobat Reader, and viewing in  
other applications like GraphicConverter I see even more lines tha I  
do in Acrobat Reader.

-- 

David.

> This artifact is not present if the output is PNG (attached,  
> obtained in the above code using png('bug.png', width=800,  
> height=400) instead of pdf()).
> Seems like a off-by-one bug. Is it a known bug? Is there any  
> workaround? I tried lattice::contourplot but it does not support NA.
> Thanks for your help!
>                                                mario
>
> -- 
> Ing. Mario Valle
> Data Analysis and Visualization Group            | http://www.cscs.ch/~mvalle
> Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91)  
> 610.82.60
> v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91)  
> 610.82.82
>
>
> <bug.pdf><bug.png>______________________________________________
> 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