Skip to contents

Convert numerical values to divergent colors

Usage

vals2cols(x, center = 0)

Arguments

x

Numeric.

center

Integer. Currently only 0 is valid. If center == 0, 0 is used as the center and corresponds to the central color (lightgoldenrod1). Otherwise, x must have values in the range 0, 1.

Value

A vector of hex colors.

Examples

x = rnorm(1e3)
plot(seq(x), x, col= vals2cols(x), pch=19)