[R] loss of information in pdf plots

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 17 15:27:35 CEST 2012


There must be loss of accuracy: coordinates in PDF are recorded to 
finite accuracy (for pdf(), something like 0.01" as I recall).  In 
addition, the R plot engine assumes finite accuracy, a minimum width for 
lines ....  And as people are pointing out, so do PDF viewers.

Do not expect to zoom into a plot (PDF or otherwise): if you want a 
large plot, plot it large in the first place.

On 17/04/2012 13:58, Marc Schwartz wrote:
> On Apr 17, 2012, at 7:08 AM, Unger, Kristian, Dr. wrote:
>
>> Hi there
>>
>> is it possible that pdfs generated using the pdf() function with default settings leads to loss of information? I was plotting copy number changes from Agilent 180k data in form of rectangles (rect()) while each rectangle represents one region of copy number change. When plotting into a pdf I noticed that some very small rectangles do not appear (even after extensive zooming) in the pdf using the pdf() function. But they do when writing the screen output into a pdf using the GUI. Does anyone have some advice on this how I can plot pdfs without losing information?
>>
>> Best wishes
>>
>> Kristian
>>
>> R version 2.14.0 (2011-10-31)
>> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

Which is already 3 versions old: see what the posting guide has to say 
about that ....

>>
>> locale:
>> [1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] CGHregions_1.12.0 CGHcall_2.14.0    CGHbase_1.12.0    marray_1.32.0
>> [5] limma_3.10.3      Biobase_2.14.0    DNAcopy_1.28.0    impute_1.28.0
>>
>> loaded via a namespace (and not attached):
>> [1] tools_2.14.0
>
>
>
> If you can provide some reproducible code (small example that yields the problem), that would help. However, you may be experiencing a problem in your PDF viewer (Preview?) due to anti-aliasing, which is noted here:
>
>    http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-there-unwanted-borders
>
> Regards,
>
> Marc Schwartz
>
> ______________________________________________
> 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.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list