colorVal: Colors Based on Values

View source: R/colorVal.R

colorValR Documentation

Colors Based on Values

Description

Assign a range of unique colors based on values.

Usage

colorVal(x, n = 100, low = 4/6, high = 0/6)

Arguments

x

A numeric vector of values on which the colors are based.

n

A numeric scalar giving the number of unique colors in the palette, default 100.

low

A numeric scalar giving the hue in [0, 1] at which the color palette begins for low values, default 4/6 for blue.

high

A numeric scalar giving the hue in [0, 1] at which the color palette ends for high values, default 0 for red.

See Also

rainbow

Examples

rand <- rnorm(20)
plot(rand, rand, pch=16, col=colorVal(rand))


krphillips/EchoNet2Fish documentation built on March 19, 2022, 11:59 p.m.