Learn R Programming

seriation (version 1.3.2)

color_palettes: Different Useful Color Palettes

Description

Defines several color palettes for pimage, dissplot and hmap.

Usage

grays(n,  bias = 1, power = 1, ...)
greys(n,  bias = 1, power = 1, ...)
reds(n,  bias = 1, power = 1, ...)
blues(n,  bias = 1, power = 1, ...)
greens(n,  bias = 1, power = 1, ...)

bluered(n, bias = 1, power = 1, ...) greenred(n, bias = 1, power = 1, ...)

Arguments

n

number of different colors produces.

power

used to control how chroma and luminance is increased (1 = linear, 2 = quadratic, etc.)

bias

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

...

further parameters are passed on to sequential_hcl or diverging_hcl.

Value

A vector with n colors.

Details

The color palettes are created with sequential_hcl and diverging_hcl from package colorspace.

The two sequential palettes are: reds and grays (or greys).

The two diverging palettes are: bluered and greenred.

See Also

sequential_hcl, diverging_hcl, pimage, dissplot, hmap.

Examples

Run this code
# NOT RUN {
m <- outer(1:10,1:10)
m

pimage(m)
pimage(m, col = greys(100, power = 2))
pimage(m, col = greys(100, bias = 2))
pimage(m, col = bluered(100))
pimage(m, col = bluered(100, power = .5))
pimage(m, col = bluered(100, bias = 2))
pimage(m - 25, col = greenred(20, bias = 2))

## choose your own color palettes
library(colorspace)
hcl_palettes(plot = TRUE)

## blues (with 20 shades)
pimage(m,
  col = colorspace::sequential_hcl(20, "Blues", rev = TRUE))
## blue to green (aka "Cork")
pimage(m,
  col = colorspace::diverging_hcl(100, "Cork"))
# }

Run the code above in your browser using DataLab