forked from tidyverse/ggplot2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscale_size.Rd
48 lines (40 loc) · 1.26 KB
/
scale_size.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
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{scale_size}
\alias{scale_size}
\alias{scale_size_continuous}
\alias{scale_size_discrete}
\title{Size scale.}
\usage{
scale_size_continuous(..., range = c(1, 6))
scale_size(..., range = c(1, 6))
scale_size_discrete(..., range = c(1, 6))
}
\arguments{
\item{range}{a numeric vector of length 2 that specifies the minimum and
maximum size of the plotting symbol after transformation.}
\item{...}{common continuous scale parameters: \code{name}, \code{breaks},
\code{labels}, \code{na.value}, \code{limits} and \code{trans}. See
\code{\link{continuous_scale}} for more details}
}
\description{
Size scale.
}
\examples{
\donttest{
(p <- qplot(mpg, cyl, data=mtcars, size=cyl))
p + scale_size("cylinders")
p + scale_size("number\\nof\\ncylinders")
p + scale_size(range = c(0, 10))
p + scale_size(range = c(1, 2))
# Map area, instead of width/radius
# Perceptually, this is a little better
p + scale_size_area()
p + scale_size_area(max_size = 25)
# Also works with factors, but not a terribly good
# idea, unless your factor is ordered, as in this example
qplot(mpg, cyl, data=mtcars, size=factor(cyl))
# To control the size mapping for discrete variable, use
# scale_size_manual:
last_plot() + scale_size_manual(values=c(2,4,6))
}
}