| plot_ntl_panel | R Documentation |
Arranges one map per year into a patchwork grid with a shared title, subtitle, and caption. A shared radiance scale is computed from the 99.5th percentile across all rasters so panels are directly comparable.
plot_ntl_panel(
rasters,
polygons = NULL,
title = "India at night",
subtitle = NULL,
caption = NULL,
palette = c("glow", "bhuvan"),
ncol = 3L,
bg_colour = "#080c14",
title_colour = "#CDD9E5",
subtitle_colour = "#8B949E",
year_colour = "#E8A87C"
)
rasters |
Named list of |
polygons |
Optional |
title |
Overall plot title. Default |
subtitle |
Optional subtitle string. |
caption |
Optional caption string. |
palette |
One of |
ncol |
Number of columns in the grid. Default |
bg_colour |
Background colour of the assembled panel.
Default |
title_colour |
Title text colour. Default |
subtitle_colour |
Subtitle and caption text colour. Default |
year_colour |
Year label colour on each individual map.
Default |
Requires the patchwork package.
A patchwork 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_panel(list("2020" = r, "2021" = r * 1.2), title = "Synthetic example")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.