| color_palettes {seriation} | R Documentation |
Defines several color palettes for pimage, dissplot
and hmap.
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, ...)
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
|
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.
A vector with n colors.
Michael Hahsler
sequential_hcl,
diverging_hcl,
pimage,
dissplot,
hmap.
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"))