Color Schemes for R Bar Plots

March 1, 2009

(This article was first published on "R-bloggers" via Tal Galili in Google Reader, and kindly contributed to R-bloggers)

A recurrent source of irritation for me is the absence of a good default behavior in R for choosing the color scheme for bar plots. A stacked bar plot looks only as good as the color scheme you use. In hope of finding a usable scheme that I could settle on as a personal default, I picked two color schemes, Sunshine over Glacier and Sweet Valentine, from Adobe’s Kuler site that struck me as particularly nice for bar plots. To test them, I plotted data from a recent Gene Expression post on moral beliefs among different religious groups in America. You can see the results below.

Sunshine over Glacier

Sunshine over Glacier Example.png

Sweet Valentine

Sweet Valentine Example.png

What do people think of these color schemes? Also, does anyone have ideas about how to incorporate a legend that doesn’t ruin the balance of this plot? At present, it’s impossible to know what these graphs actually mean, but I haven’t been able to figure out how to add a legend to the graphs without substantially expanding the screen area used by them.

To leave a comment for the author, please follow the link and comment on their blog: "R-bloggers" via Tal Galili in Google Reader. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...


Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)