cet_pal | R Documentation |
Extract n
RGB Hexadecimal colors from the perceptually uniform color
maps developed by Peter Kovesi.
cet_pal(n, name = "rainbow", alpha = 1)
n |
A |
name |
A |
alpha |
A |
A character
vector containing the RGB hexadecimal
representation of the requested color map.
Peter Kovesi. Good Colour Maps: How to Design Them. arXiv:1509.03700 cs.GR 2015
# Grab 8 colors from rainbow or rainbow_bgyr_35-85_c73_n256
colors = cet_pal(8)
plot(1:8, 1:8, col=colors, pch=19, cex=3, xlab="", ylab="")
# Grab 25 colors from coolwarm or diverging_bwr_40-95_c42_n256
colors = cet_pal(25, name = "coolwarm")
plot(1:25, 1:25, col=colors, pch=19, cex=3, xlab="", ylab="")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.