number.to.colors: Convert from numbers to colors

number.to.colorsR Documentation

Convert from numbers to colors

Description

Automatically convert a vector of numbers into a color for easy plotting

Usage

number.to.colors(value, colors = c("red", "blue"), num = 100)

Arguments

value

a vector of numbers.

colors

a vector of two or more colors representing the inflection points of the gradients, passed to colorRampPalette.

num

The number of unique intervals for colors. Chose larger numbers for finer gradients (higher resolution).

Value

a vector of colors.

Author(s)

Dustin Fife

See Also

string.to.colors colorRampPalette gradient.legend

Examples

#### plot three variables, represent the third with a color
d = mvrnorm(100, mu=c(0,0,0), Sigma=matrix(c(1, .6, .6, .6, 1, .6, .6, .6, 1), ncol=3))
plot(d[,1:2], col=number.to.colors(d[,3], c("black", "pink")), pch=16)

Jorisvansteenbrugge/TcT documentation built on Sept. 26, 2022, 6:50 a.m.