data2col: Data to color mapping

Description Usage Arguments Value Author(s) Examples

View source: R/data2col.R

Description

data2col provides a mapping from data values to color values by using hsi color space. One can use hueRange, intensityRange, alpha, alpha, numCols, and maxColorValue to adjust the mapping. Also, missingCol specifies the color to the missing data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data2col(
  data,
  cols = NULL,
  hueRange = c(0, 360),
  intensityRange = c(0.4, 1),
  alpha = 1,
  numCols = 1e+05,
  maxColorValue = 255,
  xLow = min(data, na.rm = TRUE),
  origin = NULL,
  xHigh = max(data, na.rm = TRUE),
  missingCol = NULL,
  outRangeCol = NULL
)

Arguments

data

vector of data values

cols

a vector of rgb colours or NULL (default). If NULL, cols is constructed from hueRange, intensityRange, alpha, alpha, numCols, and maxColorValue.

hueRange

numeric vectors with values in [0, 360], it specify the hue range. It does not need to be in ascending order since it is only used in the linear interpolation

intensityRange

numeric vectors with values in [0, 1], it specifies the intersity range. It does not need to be in ascending order since it is only used in the linear interpolation

alpha

number in [0,1]. It specifies the alpha transparency value.

numCols

number. It specifies the number of colors used to do the mapping, and the higher the value is, the more distinguished between different data values.

maxColorValue

number in (0, 255]. giving the maximum of the color values range.

xLow

lower value of one's interested range

origin

middle value in one's interested range in (xLow, xHigh), which specifies the data value mapping to the center of color scale

xHigh

higher value of one's interested range

missingCol

color character specifying the color for the missing data. It is in the form of "#rrggbbaa", and the default is yellow.

outRangeCol

color characters specifying the color for the data outside our interested range. If the length is two, the first will specify the color for the data lower than the range, and the second is for higher. the color should have the same form with missingCol, and the default is "blue" and "red".

Value

a vector of color chacacters which can be used to plot

Author(s)

Jiahua Liu, Wayne Oldford

Examples

1
2
3

rwoldford/glyphs documentation built on Nov. 14, 2020, 2:29 a.m.