| plot_ntl_map | R Documentation |
Renders a single SpatRaster as a map. Two palettes are available:
plot_ntl_map(
raster,
polygons = NULL,
title = "Nighttime lights",
caption = NULL,
palette = c("glow", "bhuvan"),
dark = TRUE,
limits = NULL
)
raster |
A single-layer |
polygons |
Optional |
title |
Plot title. Default |
caption |
Optional caption string. |
palette |
One of |
dark |
Logical. If |
limits |
Numeric vector of length 2 for the continuous scale. Only used
when |
"glow" (default): continuous dark-olive-to-cream-white ramp modelled on
the NASA Black Marble composite. Suited to dark backgrounds and multi-panel
year comparisons.
"bhuvan": 4-class categorical legend matching the Bhuvan portal: black
(< 5 nW/cm2/sr), dark blue-grey (5-25), cream (26-200), red (> 200).
A ggplot2 object.
r <- terra::rast(
nrows = 20, ncols = 20, xmin = 77, xmax = 78, ymin = 28, ymax = 29,
crs = "EPSG:4326", vals = seq_len(400) / 2
)
plot_ntl_map(r)
plot_ntl_map(r, palette = "bhuvan")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.