| palette | R Documentation |
Defines several color palettes for pimage(), dissplot() and
hmap().
bluered(n = 100, bias = 1, power = 1, ...)
greenred(n = 100, bias = 1, power = 1, ...)
reds(n = 100, bias = 1, power = 1, ...)
blues(n = 100, bias = 1, power = 1, ...)
greens(n = 100, bias = 1, power = 1, ...)
greys(n = 100, bias = 1, power = 1, ...)
grays(n = 100, bias = 1, power = 1, ...)
n |
number of different colors produces. |
bias |
a positive number. Higher values give more widely spaced colors at the high end. |
power |
used to control how chroma and luminance is increased (1 = linear, 2 = quadratic, etc.) |
... |
further parameters are passed on to |
The color palettes are created with colorspace::sequential_hcl() and
colorspace::diverging_hcl().
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
Other plots:
VAT(),
bertinplot(),
dissplot(),
hmap(),
pimage()
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.