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,
  bcpower = NULL,
  breaks = NULL,
  labels = NULL,
  crop_to_grid = FALSE,
  panel_bg = NULL,
  land_fill_colour = NULL,
  legend_title = NULL,
  legend_limits = NULL,
  legend_title_wrap_length = 10,
  title_wrap_length = 60,
  visible_gridlines = TRUE,
  layers = NULL,
  scale = "medium"
)

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').

bcpower

(Optional) Power parameter for the Box-Cox, modulus, or Yeo-Johnson transformations.

breaks

(Optional) Break points for the legend scale.

labels

(Optional) Labels for legend scale break points.

crop_to_grid

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

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.

visible_gridlines

Show gridlines between cells. Default is TRUE.

layers

Additional rnaturalearth layers to plot, e.g. c("reefs", "playas").

scale

Scale of Natural Earth data ("small", "medium", or "large"). Default is 'medium'.

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")
#> Warning: There was 1 warning in `dplyr::mutate()`.
#>  In argument: `cellid = as.integer(cellid)`.
#> Caused by warning:
#> ! NAs introduced by coercion
plot_map(x = evenness_map,
         title = "Map of Species Evenness in Denmark",
         legend_title = "Evenness")