Learn R Programming

colorplane (version 0.5.0)

map_colors: map data values to a set of colors

Description

instantiate a vector of colors from a ColorPlane specification.

Usage

map_colors(x, ...)

# S4 method for ConstantColorPlane map_colors(x)

# S4 method for HexColorPlane map_colors(x)

# S4 method for DiscreteColorPlane map_colors(x, values, ...)

# S4 method for IntensityColorPlane map_colors(x, alpha = 1, threshold = NULL, irange = NULL)

Value

a HexColorPlane instance containing the mapped colors

Arguments

x

the object to map over

...

extra args

values

the values to map to colors via the discrete lookup table

alpha

alpha multiplier from 0 to 1.

threshold

two-sided threshold as a 2-element vector, e.g. `threshold=c(-3,3)` indicating two-sided transparency thresholds.

irange

the intensity range defining min and max of scale.

Examples

Run this code

cp <- IntensityColorPlane(seq(1,100), cols=rainbow(25))
cl <- map_colors(cp, irange=c(0,50))
stopifnot(cl@clr[50] == rainbow(25)[25])

Run the code above in your browser using DataLab