View source: R/color_functions.R
gradient | R Documentation |
Get color gradients
gradient(colors, breaks = NULL, type = c("ggplot2", "colorRamp2"), name = NULL)
colors |
vector of colors |
breaks |
vector of breaks (required for 'colorRamp2') |
type |
generate gradient as ggplot2, colorRamp2 or none |
name |
use a pre-defined gradient |
gradient(colors = c("-3 "= "blue", "0" = "white", "3" = "orangered"))
gradient(name = "bluered3", type = "colorramp2")
ggplot(iris, aes(Sepal.Length, Petal.Length, color = Sepal.Width)) + geom_point() + gradient(c("red", "green", "blue"), breaks = c(0,1,5))
ggplot(iris, aes(Sepal.Length, Petal.Length, color = Sepal.Width)) + geom_point() + gradient(c("red", "green", "blue"))
ComplexHeatmap::Heatmap(iris[,-5], col = gradient(name = "blueyellow3", type = "colorramp2", breaks = c(0,4,8)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.