powered by
Several useful colour palettes for plots and other visualizations.
The function alpha.col can be used to turn colours (partially) translucent for used in crowded scatterplots.
alpha.col
corpora.palette(name=c("seaborn", "muted", "bright", "simple"), n=NULL, alpha=1)alpha.col(col, alpha)
alpha.col(col, alpha)
A character vector with colour names or hexadecimal RGB specifications.
name of the desired colour palette (see Details below)
optional: number of colours to return. The palette will be shortened or recycled as necessary.
a vector of R colour specifications (as accepted by col2rgb)
col2rgb
alpha value between 0 and 1; values below 1 make the colours translucent
Stephanie Evert (https://purl.org/stephanie.evert)
Every colour palette starts with the colours black, red, green and blue in this order.
seaborn, muted and bright are 7-colour palettes inspired by the seaborn data visualization library, but add a shade of dark grey as first colour.
seaborn
muted
bright
simple is a 10-colour palette based on R's default palette.
simple
rgb for R colour specification formats, palette for setting the default colour palette
rgb
palette
par.save <- par(mfrow=c(2, 2)) for (name in qw("seaborn muted bright simple")) { barplot(rep(1, 10), col=corpora.palette(name, 10), main=name) } par(par.save)
Run the code above in your browser using DataLab