Learn R Programming

broman (version 0.84)

revgray: Create vector of colors from white to black

Description

Calls grDevices::gray() then base::rev()

Usage

revgray(n = 256, ...)

Value

Vector of colors, from white to black

Arguments

n

Number of colors.

...

Passed to grDevices::gray().

Details

There's not much to this. It's just gray((n:0)/n))

See Also

Examples

Run this code
x <- matrix(rnorm(100), ncol=10)
image(x, col=revgray())

Run the code above in your browser using DataLab