ggplot2 Theme Elements Reference Sheet

A few days ago I came across Henry Wang❜s ❝ ggplot2 Theme Elements Demonstration❞ on Twitter and thought it was such a smart way to refer to the theme elements in ggplot2 (check it out if you haven’t already!). Since I always customize my plots, every time I make one I end up having to google the list of theme elements. In an attempt to minimize the time spent doing that, I decided to make my own version of Henry’s demonstration for myself, using the theme elements I frequently use and tweak.

I also made a PDF version so that it’s easy to copy-paste the code. In case it would be useful to anyone else, I’ve linked them below 😊

June 7, 2020: The example plot used for this sheet was replaced with a plot using mtcars data instead of iris data.

PDF PNG

I included a part in the sheet where I said ❝Set minimal as the baseline theme❞ since I always do this, but of course that’s just my personal workflow.

There are many more theme elements that you can set and inheritances available, so be sure to check them out in ggplot2's documentation!

The plot was made using ggplot2 and the outer part of the sheet describing the theme elements was made using draw.io.

Isabella Benabaye
Isabella Benabaye
Data and Reporting Analyst in Los Angeles, CA
comments powered by Disqus

Related