Learn R Programming

colorRamps (version 2.3.1)

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)

Value

A colormap

Arguments

n

number of colors

Author

Tim Keitt <tkeitt@gmail.com>

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

Examples

Run this code
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