View source: R/gradient_scale.R
scale_gradient | R Documentation |
Depending on min and max will apply gradient to the plot if min < 0, use 3 colours and set limits to -max_val, +max_val else use 2 colours and set limits to 0, max
Alternative dark red-blue: c("#750e13", "#ffffff", "#003a6d") Alternative violet-green: c("#491d8b", "#ffffff", "#004144")
scale_gradient(
min,
max,
aesthetics = "fill",
gradient = c("#D62929", "#ffffff", "#2982D6"),
na.value = "#dddddd"
)
min |
Minimal value in the data |
max |
Maximal value in the data |
aesthetics |
"colour" or "fill" or both |
gradient |
A vector of 3 colours: low, middle and high |
na.value |
What colour to put on the na.value |
a scale_fill_gradient
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.