utils_color: Color utilities

get_paletteR Documentation

Color utilities

Description

From given values, generate colors for plotting.

Usage

get_palette()

colvec(x)

Arguments

x

Vector of values to evaluate.

Value

get_palette returns a vector of 99 hex color values. colvec returns a hex color vector of same length as x, corresponding to values of x.

Examples

# generate data
x <- y <- seq(-3, 3, length = 30)

# color points by numeric values
plot(x, y, col=colvec(x), pch=16)

# color points by factor values
trmt <- gl(3, 10, labels = c('Q', 'R', 'S'))
plot(x, y, col=colvec(rev(trmt)), pch=16)


phytomosaic/esa2021 documentation built on Aug. 10, 2022, 3 a.m.