Site icon R-bloggers

ggplot dodged vs faceted bar chart

[This article was first published on Stats and things, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I’ve been bowling once per year at a charity event for the last few years and have kept track of the outcomes to share my group. I used ggplot2 to create a bar chart for the scores. Below are two graphs, one is dodged, the other is faceted. There’s no right way here, but you can see the code and decide for yourself which is more aesthetically pleasing.

First is the dodged one…

And next is the faceted one…

The color is redundant in the faceted one, since there are labels for the game number. I kept the color in to make comparison with the dodged one easier.

Here’s the code to produce these two graphs.
The full code with the data is available in my github repo.

@corynissen on twitter

To leave a comment for the author, please follow the link and comment on their blog: Stats and things.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.