Create a vector of n
gamma-corrected gray colors.
gray.colors(n, start = 0.3, end = 0.9, gamma = 2.2, alpha = NULL, rev = FALSE)
grey.colors(n, start = 0.3, end = 0.9, gamma = 2.2, alpha = NULL, rev = FALSE)
the number of gray colors (
starting gray level in the palette (should be between
0
and 1
where zero indicates "black"
and one
indicates "white"
).
ending gray level in the palette.
the gamma correction.
the opacity, is specified.
logical indicating whether the ordering of the colors should be reversed.
A vector of n
gray colors.
The function gray.colors
chooses a series of n
gamma-corrected gray levels between start
and end
:
seq(start^gamma, end^gamma, length = n)^(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
.
# NOT RUN {
require(graphics)
pie(rep(1, 12), col = gray.colors(12))
barplot(1:12, col = gray.colors(12))
# }
Run the code above in your browser using DataLab