Skip to contents

Produces a publication-ready map of LCZ classes with the official colour scheme (or a colour-vision-deficiency-safe alternative).

Usage

lcz_plot_map(
  x,
  isave = FALSE,
  show_legend = TRUE,
  save_extension = "png",
  inclusive = FALSE,
  max_pixels = 1e+06,
  legend_ncol = 1,
  scalebar = FALSE,
  north_arrow = FALSE,
  ...,
  lang = "en"
)

Arguments

x

A SpatRaster (or path) with LCZ classes (1-17).

isave

Logical. Save the plot in LCZ4r_output/.

show_legend

Logical. Show the LCZ legend.

save_extension

Image format: "png", "jpg", "tif", "pdf" or "svg".

inclusive

Logical. Use the colour-vision-deficiency-safe palette.

max_pixels

Maximum number of cells drawn. Larger rasters are aggregated with a modal filter first, which keeps memory bounded and the plot legible at print resolution.

legend_ncol

Number of legend columns. Default 1, which keeps the map panel as large as possible; use 2 for a shorter, wider legend.

scalebar

Logical. Add a scale bar computed from the raster extent.

north_arrow

Logical. Add a north arrow.

...

Passed to ggplot2::labs() (title, subtitle, caption).

lang

Language used for labels, messages and errors. See lcz_langs(). Defaults to "en".

Value

A ggplot object.

Examples

if (FALSE) { # \dontrun{
my_lcz_map <- lcz_get_map(city = "Juiz de Fora")
lcz_plot_map(my_lcz_map, title = "LCZ - Juiz de Fora")
lcz_plot_map(my_lcz_map, inclusive = TRUE, lang = "pt")
} # }