Last data update: 2014.03.03

R: Different Useful Color Palettes
color_palettesR Documentation

Different Useful Color Palettes

Description

Defines several color palettes for pimage, dissplot and hmap.

Usage

bluered(n, bias = 1)
greenred(n, bias = 1)
grays(n, power = 1)
greys(n, power = 1)

Arguments

n

number of different colors produces.

bias

a positive number. Higher values give more widely spaced colors at the high end.

power

control parameter determining how luminance should be increased (1 = linear, 2 = quadratic, etc.).

Details

bluered creates a blue-red color palette.

greenred creates a green-red color palette.

greys and grays creates gray scales.

See colorRampPalette to create your own color palettes.

Value

A vector with n colors.

Author(s)

Michael Hahsler

See Also

colorRampPalette, pimage, dissplot, hmap.

Examples

pimage(rbind(1:100))
pimage(rbind(1:100), col = greys(100, power=2))
pimage(rbind(1:100), col = bluered(100))
pimage(rbind(1:100), col = bluered(100, bias = 2))
pimage(rbind(-100:100), col = greenred(10))

## create your own color palettes 
## red to green (with 10 colors)
pimage(rbind(1:100), 
  col = colorRampPalette(colors = c("red", "yellow", "green"))(10))
## white to blue (with 100 colors)
pimage(rbind(1:100), 
  col = colorRampPalette(colors = c("white", "blue"))(100))

Results