divPal | R Documentation |
Diverging color palette: brown to blue, light colors in the middle, darker at the extremes, good for displaying values in two directions
divPal(
n = 100,
reverse = FALSE,
alpha = 1,
rwb = FALSE,
ryb = FALSE,
gp = FALSE,
br = FALSE,
colors = NULL,
...
)
n |
Number of colors. DEFAULT: 100 |
reverse |
Reverse colors? DEFAULT: FALSE |
alpha |
Transparency (0=transparent, 1=fully colored). DEFAULT: 1 |
rwb |
Should colors be in red-white-blue instead of brown-blue? DEFAULT: FALSE |
ryb |
Use red-yellow-blue instead of the default, with "khaki" in the center. DEFAULT: FALSE |
gp |
Use green-purple instead of the default. DEFAULT: FALSE |
br |
Use blue-red instead of the default. DEFAULT: FALSE |
colors |
If not NULL, a color vector used in |
... |
Further arguments passed to |
Character string vector with color names
Berry Boessenkool, berry-b@gmx.de, Jan 2016
The default palette is originally in 12 shades in the IPCC Assessment Report 5
Chapter 12 Fig 12.22, https://www.ipcc.ch/report/ar5/wg1/.
The green-purple and blue-red palettes are from NYtimes (originally with 8 shades),
https://www.nytimes.com/interactive/2017/03/21/climate/how-americans-think-about-climate-change-in-six-maps.html
showPal
, seqPal
, catPal
, addAlpha
,
colorRampPalette
, package RColorBrewer
plot(rep(1,12), pch=16, cex=5, col=divPal(12), xaxt="n")
showPal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.