map_colors {colorplane} | R Documentation |
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 signature 'ConstantColorPlane'
map_colors(x)
## S4 method for signature 'HexColorPlane'
map_colors(x)
## S4 method for signature 'DiscreteColorPlane'
map_colors(x, values, ...)
## S4 method for signature 'IntensityColorPlane'
map_colors(x, alpha = 1, threshold = NULL, irange = NULL)
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. |
Value
a HexColorPlane
instance containing the mapped colors
Examples
cp <- IntensityColorPlane(seq(1,100), cols=rainbow(25))
cl <- map_colors(cp, irange=c(0,50))
stopifnot(cl@clr[50] == rainbow(25)[25])
[Package colorplane version 0.5.0 Index]