cscale {scales} | R Documentation |
Continuous scale
Description
Continuous scale
Usage
cscale(x, palette, na.value = NA_real_, trans = transform_identity())
Arguments
x |
vector of continuous values to scale |
palette |
palette to use. Built in palettes:
|
na.value |
value to use for missing values |
trans |
transformation object describing the how to transform the raw data prior to scaling. Defaults to the identity transformation which leaves the data unchanged. Built in transformations:
|
Examples
with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale())))
with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_rescale(),
trans = transform_sqrt()
)))
with(mtcars, plot(disp, mpg, cex = cscale(hp, pal_area())))
with(mtcars, plot(disp, mpg,
pch = 20, cex = 5,
col = cscale(hp, pal_seq_gradient("grey80", "black"))
))