scale_size

0th

Percentile

Size scale.

Size scale.

Usage
scale_size_continuous(..., range = c(1, 6))

scale_size(..., range = c(1, 6))

scale_size_discrete(..., range = c(1, 6))

Arguments
range
a numeric vector of length 2 that specifies the minimum and maximum size of the plotting symbol after transformation.
...
common continuous scale parameters: name, breaks, labels, na.value, limits and trans. See continuous_scale for m
Aliases
  • scale_size
  • scale_size_continuous
  • scale_size_discrete
Examples
(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_area()
p + scale_area(range = c(1, 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))
Documentation reproduced from package ggplot2, version 0.9.3.1, License: GPL-2

Community examples

Looks like there are no examples yet.