R: Returns a gradient color map

blue2red {colorRamps} | R Documentation

## 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

### 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.

### Value

A colormap

### Author(s)

Tim Keitt <tkeitt@gmail.com>

### References

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

### See Also

`rgb`

### Examples

    image(matrix(1:400, 20), col = blue2red(400))
    image(matrix(1:400, 20), col = blue2green(400))
    image(matrix(1:400, 20), col = green2red(400))

[Package colorRamps version 2.3 Index]