palette_color_continuous | R Documentation |
Maps continuous values to an interpolated colors gradient.
palette_color_continuous(
colors = NULL,
domain = NULL,
midpoint = NULL,
missing = "#DDDDDD"
)
palette_colour_continuous(
colors = NULL,
domain = NULL,
midpoint = NULL,
missing = "#DDDDDD"
)
colors |
A vector of colors or a |
domain |
A |
midpoint |
A length-one |
missing |
The color to return for |
A palette function
that when called with a single argument
(a numeric
vector of continuous values) returns a character
vector
of colors.
grDevices::colorRamp()
Other palettes:
palette_color_discrete()
,
palette_color_picker()
,
palette_shape()
,
palette_size_range()
## Visualize a simple DEM model
## Distribution of elevation values
elevation <- hist(volcano)
## Where are breaks?
elevation$breaks
## Build palette functions
BuRd <- color("BuRd")
ramp_BuRd <- palette_color_continuous(colors = BuRd(10))
## Plot image
image(volcano, col = ramp_BuRd(elevation$breaks))
legend("topright", legend = elevation$breaks, fill = ramp_BuRd(elevation$breaks))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.