Reputation: 1119
I am trying to prepare figures for a publication. The journal guidelines say that figures need to be in RGB mode. I was wondering if the default ggplot() and ggsave() plots are in RGB mode or not.
Upvotes: 1
Views: 3502
Reputation: 263451
I don't think you understand the plotting model in R. And I don't think that description in the journal guidelines is very helpful either, since "rgb mode" does not really describe a particular file format. The ggplot object is a complex description of how a plot is to be drawn using the 'grid' plotting engine that then gets sent to a plotting device that creates the file to be distributed. You have a variety of plotting devices to choose from. Type:
?Devices
You will notice that ggsave
has as one of its parameters,...device = default_device(filename),
(although that is no longer the default option as of Feb 2019), and another important one for journal publication is ... dpi = 300,
and many journals will specify they want 1200 dpi if they request bitmapped graphics.
Most color specifications are done in sRGB at the device level. Journals will sometimes indicate a preference for either bitmap(tiff or jpg, where dpi will matter) or vector graphics (pdf or SVG, where dpi would not matter). There is an additional aspect of colors encoded in the transparency bytes and the fact that you do not mention that level of color values makes me wonder if transparency is supported.
Upvotes: 2
Reputation: 693
Printer formats traditionally used CMYK, and RGB was long considered specifically for computer monitors and televisions.
Its more likely to find CMYK with offset printers and very high-quality inkjets, and RGB with (relatively) low-cost, laser printers. CMYK tends to be more expensive as offsets require setup and inkjets get costly.
Also, because publishing is now often done by personal computer, its become more common to ask for the image format to be in RGB instead of CMYK. Unfortunately, image quality of RGB is very poor compared to CMYK. Its not great but generally okay to convert from CMYK to RGB, but not the other way around.
As far as image formats, PNG, JPG, and GIF are RGB compatible but do not support CMYK. TIFF supports CMYK, RGB, LAB and other indexed formats.
Adobe has some color profile embedding to mimic CMYK in RGB, but its not an open-standard.
If a journal is requesting 1200dpi, its probably for a black & white image that doesn't have any halftoning (grey scaling).
By default, GGPLOT2 saves PNG and PDF.
To be safe, specify the image as a 300dpi PNG and avoid PDF.
Correction: Adobe's PDF supports a proprietary vector based format. I've never seen a PDF actually used within page layout software except as a bundling/transport for the final product to the printer. When using vector based imagery, its commonly as an EPS format. In the workflows that I'm familiar with, the EPS is then extracted from the PDF and used independently.
Upvotes: 0