1 min read

ggplot2 themes examples

andreacirilloac

this short post is exactly what it seems: a showcase of all ggplot2 themes available within the ggplot2 package. I was doing such a list for myself ( you know that feeling …“how would it look like with this theme? let’s try this one…”) and at the end I thought it could have be useful for my readers. At least this post will save you the time of trying all differents themes just to have a sense of how they look like.

Enjoy!

theme_bw()

theme_bw

theme_classic()

theme_classic

theme_dark()

theme_dark

theme_gray()

theme_gray

theme_grey()

theme_grey

theme_light()

theme_light

theme_linedraw()

theme_linedraw

theme_minimal()

theme_minimal

Bonus Track: The Code

Since copy and pasting and right-clicking 9 times to produce all the plots was definitely not acceptable, starting from a good post by Tony Cookson I wrote a small function to dinamically create and save a png file with different name and content:

[gist https://gist.github.com/8a0efe2b120ac01f2526a79f2ab33678 /]

Final notes

Inner ggplot2 structure allows for a nearly infinite number of customizations and extensions.You can have a sense of what I am talking about looking at ggplot2 extensions website or to the ggthemes package vignette by the package author  Jeffrey B. Arnold.

comments disclaimer
thank you for taking the time to comment. If the comment you are about to write is related to a piece of code I wrote, please reach its Github respository and place there any request of improvement or report of bugs.