Skip to contents

Two panels. Niche space: the space of the first two principal components of the records of the whole range, with the conditions of the region (green), the niche cells without regional records (red frames; their share is unfilling), the whole-range records outside the region (grey) and inside it (blue), and separate regional records if given (region_points, red crosses); the legends give numbers and shares. Map: the whole-range records coloured by the category of their niche cell (filled by regional records; known only from elsewhere, with conditions available in the region or absent from it), with the region outlined.

Usage

plot_niche_coverage(
  x,
  type = c("both", "pca", "map"),
  base_size = 11,
  file = NULL,
  width = NULL,
  height = NULL
)

Arguments

x

Result of niche_coverage().

type

"both" (default; the two panels side by side), "pca" or "map".

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 (default 4200 x 1800 for both panels, 2250 x 1650 for one; PDF and SVG at 300 pixels per inch).

Value

For one panel a ggplot object; for both, the two ggplots in a list (invisibly), after drawing them.

Examples

# see niche_coverage()