Statistical Computing with R / Items
ggplot2: Qualitative Colour Palettes « Learning R
Get Feed
- 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 ThisTwine is about discovering, collecting and sharing the content that interests you. Learn More
Join TwineStats
- 2 Twines
- Make a comment
Who's Interested In This?
-
dekaysion added to Statistical Computing with R, Visualization 6 months ago
Public Comments
Add a Comment