This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/gray.colors.html
gray.colors {grDevices}R Documentation

Gray Color Palette

Description

Create a vector of n gamma-corrected gray colors.

Usage

gray.colors(n, start = 0.3, end = 0.9, gamma = 2.2)
grey.colors(n, start = 0.3, end = 0.9, gamma = 2.2)

Arguments

n

the number of gray colors (\ge 1) to be in the palette.

start

starting gray level in the palette (should be between 0 and 1 where zero indicates "black" and one indicates "white").

end

ending gray level in the palette.

gamma

the gamma correction.

Details

The function gray.colors chooses a series of n gamma-corrected gray levels between start and end: (\mathit{start}^\gamma, \dots, \mathit{end}^\gamma)^(1/\gamma). The returned palette contains the corresponding gray colors. This palette is used in barplot.default.

grey.colors is an alias for gray.colors.

Value

A vector of n gray colors.

See Also

gray, rainbow, palette.

Examples

require(graphics)

pie(rep(1,12), col = gray.colors(12))
barplot(1:12, col = gray.colors(12))

[Package grDevices version 2.9.0 ]