powered by
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, ... )
Character string vector with color names
Number of colors. DEFAULT: 100
Reverse colors? DEFAULT: FALSE
Transparency (0=transparent, 1=fully colored). DEFAULT: 1
Should colors be in red-white-blue instead of brown-blue? DEFAULT: FALSE
Use red-yellow-blue instead of the default, with "khaki" in the center. DEFAULT: FALSE
Use green-purple instead of the default. DEFAULT: FALSE
Use blue-red instead of the default. DEFAULT: FALSE
If not NULL, a color vector used in colorRampPalette. DEFAULT: NULL
colorRampPalette
Further arguments passed to colorRamp
colorRamp
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
showPal
seqPal
catPal
addAlpha
RColorBrewer
plot(rep(1,12), pch=16, cex=5, col=divPal(12), xaxt="n") showPal()
Run the code above in your browser using DataLab