R: Different Useful Color Palettes

color_palettes {seriation} | R Documentation

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

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

### Value

A vector with `n` colors.

### Author(s)

Michael Hahsler

### See Also

`sequential_hcl`, `diverging_hcl`, `pimage`, `dissplot`, `hmap`.

### Examples

    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"))

[Package seriation version 1.3.2 Index]