cbPalette: Colorblind color palettes

Description Usage Format Details Source Examples

Description

Colorblind-friendly color palettes for graphing. From Winston Chang's Cookbook for R.

Usage

1
2
data("cbPalette")
data("cbbPalette")

Format

The format is: chr [1:8] "#999999" "#E69F00" "#56B4E9" "#009E73" "#F0E442" "#0072B2" "#D55E00" ...

Details

cbPalette gives a colorblind-friendly color palette with grey. cbbPalette gives a colorblind-friendly color palette with black.

Source

http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/

Examples

1
2
3
4
5
6
7
8
9
data(cbPalette)

df <- data.frame(species = c(rep("dog", 3), rep("cat", 3)), 
                 weight = c(5, 10, 12, 7, 4, 5), 
                 height = c(3.2, 4.5, 4.7, 4, 3.5, 3.3))
ggplot(data = df, aes(x = height, y = weight, color = species)) + 
  geom_point() + 
  geom_line() + 
  scale_colour_manual(values=cbPalette)

wgaul/wgutil documentation built on June 1, 2020, 3:39 a.m.