View source: R/scale-continuous.r
scsize | R Documentation |
The mapping between size and the original variable value is not linear, but square rooted. This is because the human brain tends to percieve area rather than radius.
scsize(plot, name = "", to = c(0.8, 5))
plot |
plot |
name |
namen of the scale (used in the legend) |
to |
size range in mm (numeric vector, length 2) |
You can manipulate the range of the result by modifying the to
argument.
p <- ggplot(mtcars, aes=list(x=mpg, y=hp))
ggpoint(p)
ggpoint(p, list(size=wt))
scsize(ggpoint(p, list(size=wt)), c(1,10))
scsize(ggpoint(p, list(size=sqrt(wt))), c(1,5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.