Hacker News new | ask | show | jobs
by minimaxir 3830 days ago
This is a pretty effective guide for the custom features that ggplot2 excels at, namely faceting. That being said, optimizing the chart requires a few more steps in each case, especially when working with real world data.

For those who want a step-by-step guide on plotting with ggplot2, I wrote a tutorial that has been well-liked with an emphasis on making pretty charts: http://minimaxir.com/2015/02/ggplot-tutorial/

Yesterday, I also pushed a screencast working explicitly with R and ggplot2, with an emphasis on processing/organizing data for charting in ggplot2: http://minimaxir.com/2015/12/lets-code-1/

TL;DR R/ggplot2 can be very fussy, but when it isn't, it's magical.

1 comments

In your tutorial you recommend rendering charts on OS X in order to get proper antialiasing. Isn't it easier to render to a vector format and then batch rasterize outside R with e.g. ImageMagick? Or even better, just use the vector format?
That workflow is neither the most user-friendly nor the most web-friendly.

SVGs don't have the same flexibility and compatibility as PNGs yet, unfortunately.

On Windows, use ggsave, or if not using ggplot2, use Cairo. Linux's png output device has antialiasing.