How can I define a "heated body" or "black-body radiation" color scheme for color-coding sequential data in R?
Standard R color palettes don't give an indication of ordinal, interval or ratio scaling. The rainbow
palette is problematic for multiple reasons described by Borland & Taylor ("Rainbow Color Map (Still) Considered Harmful", IEEE Computer Graphics and Applications, 2007). (See also xkcd's painbow.) They instead recommend using a "black-body radiation" color palette, which is elsewhere called a "heated body" palette:
Unfortunately, I don't seem to find an R function to create this palette. ColorBrewer and the RColorBrewer
package are not helpful (although this palette comes close), especially if I need more than 9 colors.
This question at CrossValidated is related: Most effective use of colour in heat/contour maps
grDevices::colorRamp()
Here is a function:
And here is an example, where we indicate the years in a seasonplot of the AirPassengers data using the rainbow vs. the black-body radiation color palette: