pdf of figure in R has unsightly white lines in it

后端 未结 1 1465
一向
一向 2021-01-18 04:46

I\'m trying to make colorbars, as well as raster maps, in R, and the output figures give unsightly lines in them when exported to pdf.

Here is code to generate a c

相关标签:
1条回答
  • 2021-01-18 05:36

    This is invariably an issue with the software used to render the PDF, not with R, and arises because of features such as anti-aliasing and other rendering operations that the PDF Viewer does in order to display the PDF.

    This is discussed in ?pdf, notably

    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 can) 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.
    
         ....
    

    I just viewed your PDF in two different PDF viewers on Linux (Evince and Okular) and the degree to which these artefacts affected the file was different across the two viewers, with Okular giving fewer artefacts on the red-green one and none on the blue-yellow one. As such this seems to be an issue with viewing the PDF and not something with R. Your figure should therefore be publication quality.

    0 讨论(0)
提交回复
热议问题