Declare the scale for a mapped size aesthetic: data values map linearly to a
point-size range (in mm). A size legend is drawn automatically.
Usage
scale_size(plot, range = c(1, 4), limits = NULL, breaks = NULL, name = NULL)Arguments
- plot
A PlotSpec.
- range
Numeric length-2 output size range in mm (default
c(1, 4)).- limits
Numeric length-2 data domain, or
NULLto train from the data.- breaks
Explicit legend breaks, or
NULL.- name
Legend title, or
NULLto derive from the encoding.
Value
The modified PlotSpec.
Examples
vplot(mtcars) |> mark_point(x = wt, y = mpg, size = hp) |> scale_size(range = c(1, 8))
