Statistical Computing with R Statistical Computing with R / Items

ggplot2: Qualitative Colour Palettes « Learning R

Get Feed
ggplot2: Qualitative Colour Palettes « Learning R
Description

Every now and then I would like to change the colours of my plots. ggplot2 provides several different ways to accomplish this task, however choosing the one that matches my mood on that particular day is always relatively time-consuming. So I decided to make a post highlighting some of the available colour palette options. In this post I will focus on the colour schemes helping to depict categorical data, and will try to use various predetermined colour palettes as much as possible, as I find hard to distinguish between the intricacies of different color spaces including RGB, HSV, HLS, CIEXYZ, CIELUV, HCL (polar CIELUV), CIELAB and polar CIELAB.

Default formatting

First, load the necessary libraries and set up a dummy dataframe of 8 variables for plotting. As the main focus is on the colours I remove the legends, titles and ticks from the plots.

library(ggplot2)

library(colorspace)

df

Original URL

Comments

Report This

Twine is about discovering, collecting and sharing the content that interests you. Learn More

Join Twine

Stats

First Posted By

Who's Interested In This?

Forgot your password?