Skip to contents

Creates a map visualization of a calculated biodiversity indicator, providing customization options.

Usage

plot_map(
  x,
  title = "auto",
  auto_title = NULL,
  leg_label_default = NULL,
  xlims = NULL,
  ylims = NULL,
  trans = NULL,
  breaks = NULL,
  labels = NULL,
  Europe_crop_EEA = TRUE,
  crop_to_grid = FALSE,
  surround = TRUE,
  panel_bg = NULL,
  land_fill_colour = NULL,
  legend_title = NULL,
  legend_limits = NULL,
  legend_title_wrap_length = 10,
  title_wrap_length = 60
)

Arguments

x

An 'indicator_map' object containing indicator values associated with map grid cells.

title

Plot title. Replace "auto" with your own title if you want a custom title or if calling the function manually.

auto_title

Text for automatic title generation, provided by an appropriate S3 method (if calling the function manually, leave as NULL).

leg_label_default

Default label for the legend, provided by an appropriate S3 method (if calling the function manually, leave as NULL).

xlims

(Optional) Custom x-axis limits.

ylims

(Optional) Custom y-axis limits.

trans

(Optional) Scale transformation for the fill gradient (e.g., 'log').

breaks

(Optional) Break points for the legend scale.

labels

(Optional) Labels for legend scale break points.

Europe_crop_EEA

If TRUE, crops maps of Europe using the EPSG:3035 CRS to exclude far-lying islands (default is TRUE, but does not affect other maps or projections). Will not work if crop_to_grid is set to TRUE.

crop_to_grid

If TRUE, the grid will determine the edges of the map.Overrides Europe_crop_EEA. Default is FALSE.

surround

If TRUE, includes surrounding land area in gray when plotting at the country or continent level. If FALSE, all surrounding area will be colored ocean blue (or whatever colour you set manually using panel_bg). Default is TRUE.

panel_bg

(Optional) Background colour for the map panel.

land_fill_colour

(Optional) Colour for the land area outside of the grid (if surround = TRUE). Default is "grey85".

legend_title

(Optional) Title for the plot legend.

legend_limits

(Optional) Limits for the legend scale.

legend_title_wrap_length

Maximum legend title length before wrapping to a new line.

title_wrap_length

Maximum title length before wrapping to a new line.

Value

A ggplot object representing the biodiversity indicator map. Can be customized using ggplot2 functions.

Examples

evenness_map <- pielou_evenness_map(example_cube_1,
                                    level = "country",
                                    region = "Denmark")
plot_map(x = evenness_map,
         title = "Map of Species Evenness in Denmark",
         legend_title = "Evenness")