[R] Artifacts in filled.contour+pdf

Mario Valle mvalle at cscs.ch
Tue Oct 26 09:59:19 CEST 2010


Thanks Baptiste!
the problem with lattice (or more likely with my ignorance) is that it 
does not accept NA values.
Ciao!
                     mario

On 26-Oct-10 07:38, baptiste auguie wrote:
> Hi,
>
> As an alternative, maybe you could use lattice::panel.levelplot.raster
> which I think doesn't have this problem in pdf viewers.
>
> HTH,
>
> baptiste
>
>
> On 26 October 2010 02:30, David Winsemius<dwinsemius at comcast.net>  wrote:
>> 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.
>> ______________________________________________
>> 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.
>>

-- 
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



More information about the R-help mailing list