Learn R Programming

colorRamps (version 2.3)

blue2red: Returns a gradient color map

Description

blue2red makes a color map that runs from blue -> cyan -> yellow -> red. blue2green makes a color map that runs from blue -> magenta -> yellow -> green. green2red makes a color map that runs from green -> cyan -> magenta -> red

Usage

blue2red(n)
blue2green(n)
green2red(n)

Arguments

n

number of colors

Value

A colormap

Details

These are double-ramp maps with a sharp transition from cooler colors to warmer colors at the midpoint. With proper scaling, this will highlight the mean, median, etc.

References

Keitt, T. H. (2008) Coherent ecological dynamics induced by large scale disturbance. Nature 454:331-334

See Also

rgb

Examples

Run this code
# NOT RUN {
image(matrix(1:400, 20), col = blue2red(400))
image(matrix(1:400, 20), col = blue2green(400))
image(matrix(1:400, 20), col = green2red(400))
# }

Run the code above in your browser using DataLab