Learn R Programming

berryFunctions (version 1.22.5)

catPal: Categorical color palette

Description

Categorical color palette according to IwantHue as displayed on https://rockcontent.com/blog/subtleties-of-color-different-types-of-data-require-different-color-schemes/

Usage

catPal(n = 12, set = 1, alpha = 1)

Value

Character string vector with color names

Arguments

n

Number of colors, max 12. DEFAULT: 12

set

Integer for which set to use. Currently, only 1 is implemented.

alpha

Transparency (0=transparent, 1=fully colored). DEFAULT: 1

Author

Berry Boessenkool, berry-b@gmx.de, Apr 2019

See Also

showPal, seqPal, divPal

Examples

Run this code
plot(rep(1,12), pch=16, cex=5, col=catPal(12), xaxt="n")
showPal()
plot(cumsum(rnorm(40)), type="l", col=catPal()[1], ylim=c(-10,10))
for(i in 2:6) lines(cumsum(rnorm(40)), col=catPal()[i])

Run the code above in your browser using DataLab