Skip to contents

For each layer, the conditions of the calibration area (M), of the records and of each projection on one scale (0 to 1 = the range of M): thin lines span the minimum to the maximum, thick lines the 5th to the 95th percentile, points mark the medians. Records whose thick line reaches an end of M are truncated there; a projection that extends beyond 0 or 1 asks the model for conditions M does not contain.

Usage

plot_niche_truncation(
  x,
  base_size = 12,
  file = NULL,
  width = 2700,
  height = 1800
)

Arguments

x

A niche_truncation object from niche_truncation().

base_size

Base font size.

file

Optional file(s) to save the plot to, e.g. "fig.pdf" or c("fig.png", "fig.pdf"); the format follows the extension, and a name without extension is saved as PNG and PDF. The plot is also returned.

width, height

Size of the saved figure in pixels (PDF and SVG at 300 pixels per inch).

Value

A ggplot object.

Examples

sim <- simulate_enm_data(seed = 1, n_presence = 150)
m <- terra::crop(sim$env, terra::ext(14, 21, 49, 55))
tr <- niche_truncation(sim$presence, m,
                       projections = list(whole_area = sim$env))
plot_niche_truncation(tr)