forked from tidyverse/ggplot2
/
scale_grey.Rd
70 lines (62 loc) · 2.1 KB
/
scale_grey.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
\name{scale_colour_grey}
\alias{scale_color_grey}
\alias{scale_colour_grey}
\alias{scale_fill_grey}
\title{Sequential grey colour scale.}
\usage{
scale_colour_grey(..., start = 0.2, end = 0.8,
na.value = "red")
scale_fill_grey(..., start = 0.2, end = 0.8,
na.value = "grey50")
scale_color_grey(..., start = 0.2, end = 0.8,
na.value = "red")
}
\arguments{
\item{start}{gray value at low end of palette}
\item{end}{gray value at high end of palette}
\item{...}{Other arguments passed on to
\code{\link{continuous_scale}} to control name, limits,
breaks, labels and so forth.}
\item{na.value}{Colour to use for missing values}
}
\description{
Based on \code{\link{gray.colors}}
}
\examples{
p <- qplot(mpg, wt, data=mtcars, colour=factor(cyl))
p + scale_colour_grey()
p + scale_colour_grey(end = 0)
# You may want to turn off the pale grey background with this scale
p + scale_colour_grey() + theme_bw()
# Colour of missing values is controlled with na.value:
miss <- factor(sample(c(NA, 1:5), nrow(mtcars), rep = TRUE))
qplot(mpg, wt, data = mtcars, colour = miss) + scale_colour_grey()
qplot(mpg, wt, data = mtcars, colour = miss) +
scale_colour_grey(na.value = "green")
}
\seealso{
Other colour scales: \code{\link{scale_color_brewer}},
\code{\link{scale_color_continuous}},
\code{\link{scale_color_discrete}},
\code{\link{scale_color_distiller}},
\code{\link{scale_color_gradient}},
\code{\link{scale_color_gradient2}},
\code{\link{scale_color_gradientn}},
\code{\link{scale_color_hue}},
\code{\link{scale_colour_brewer}},
\code{\link{scale_colour_continuous}},
\code{\link{scale_colour_discrete}},
\code{\link{scale_colour_distiller}},
\code{\link{scale_colour_gradient}},
\code{\link{scale_colour_gradient2}},
\code{\link{scale_colour_gradientn}},
\code{\link{scale_colour_hue}},
\code{\link{scale_fill_brewer}},
\code{\link{scale_fill_continuous}},
\code{\link{scale_fill_discrete}},
\code{\link{scale_fill_distiller}},
\code{\link{scale_fill_gradient}},
\code{\link{scale_fill_gradient2}},
\code{\link{scale_fill_gradientn}},
\code{\link{scale_fill_hue}}
}