broman (version 0.70-4)

twocolorpal: Create vector of colors from blue to white to red

Description

Create a two-color palette from one color to another through some third color

Usage

twocolorpal(colors = c("slateblue", "white", "violetred"), n = 256, ...)

Arguments

colors

Vector of three colors

n

Number of colors in output.

Value

Vector of colors, from blue to white to red

See Also

revgray()

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(100, 0.5), ncol=10)
mxabs <- max(abs(x))
image(x, col=twocolorpal(), zlim=c(-mxabs, mxabs))

# }

Run the code above in your browser using DataCamp Workspace