inst/examples/ex-palette-continuous.R

## 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))

Try the khroma package in your browser

Any scripts or data that you put into this service are public.

khroma documentation built on Sept. 11, 2024, 5:26 p.m.