corpora.palette {corpora} | R Documentation |
Colour palettes for linguistic visualization (corpora)
Description
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.
Usage
corpora.palette(name=c("seaborn", "muted", "bright", "simple"),
n=NULL, alpha=1)
alpha.col(col, alpha)
Arguments
name |
name of the desired colour palette (see Details below) |
n |
optional: number of colours to return. The palette will be shortened or recycled as necessary. |
col |
a vector of R colour specifications (as accepted by |
alpha |
alpha value between 0 and 1; values below 1 make the colours translucent |
Details
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.
simple
is a 10-colour palette based on R's default palette.
Value
A character vector with colour names or hexadecimal RGB specifications.
Author(s)
Stephanie Evert (https://purl.org/stephanie.evert)
See Also
rgb
for R colour specification formats, palette
for setting the default colour palette
Examples
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)