Description Usage Arguments Examples
Modified from Sushi::maptocolors
1 | numberToColorVec(numberVec, palette, range = NULL)
|
numberVec |
Numeric vector |
palette |
color palette to which to be mapped. Any valid palette in "BuenColors" should work. |
range |
The c(min, max) numeric values to make the color at the extremes. |
1 2 3 4 | i <- rnorm(1000)
df <- data.frame(x = i, y = 0, color = numberToColorVec(i^2, "brewer_heat"))
ggplot(shuf(df), aes(x=x, y=y, colour= color)) + geom_point() +
scale_color_manual(values = levels(df$color))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.