[R] quartz() and dpi

JiHO jo.lists at gmail.com
Thu Jan 28 12:42:29 CET 2010


> As far as I can tell the Cairo device (CairoPNG) doesn't respect the
> size either. It looks like your best option is to switch between pdf()
> and png(type="cairo") using a wrapper like ggplot2::ggsave.

Using a wrapper function is exactly what I am doing (because I need it
to save the occasional base R plot so ggsave won't work all the time).
However, after extensively testing the different devices, quartz is
the most desirable even for PNGs: png(type="cairo") messes up the
fonts. Helvetica is used by default and the X11 part of OS X (the
pango library specifically) cannot properly read the version of
Helvetica provided by the system (in many software, the normal variant
is actually bold). cairo uses pango so the fonts in the PNG don't look
as good as in quartz.

So basically I either have wrong size but correct fonts or wrong fonts
but correct size. I currently chose the fonts over the size since the
size can be corrected and the fonts cannot. BUt of course I would
rather not have to choose ;)

JiHO
---
http://maururu.net



More information about the R-help mailing list