plot_gd: Plot moving window map of genetic diversity

View source: R/plot_gd.R

plot_gdR Documentation

Plot moving window map of genetic diversity

Description

Plot genetic diversity layer produced by window_gd or krig_gd

Usage

plot_gd(
  x,
  bkg = NULL,
  index = NULL,
  col = viridis::magma(breaks),
  breaks = 100,
  main = NULL,
  box = FALSE,
  range = NULL,
  legend = TRUE,
  ...
)

Arguments

x

output from window_gd or krig_gd (SpatRaster where first layer is genetic diversity)

bkg

optional SpatRaster or other spatial object that will be plotted as the "background" in gray

index

if a raster stack is provided, index of the layer to plot (defaults to plotting all layers except layers named "sample_count")

col

color palette to use for plotting (defaults to magma palette)

breaks

number of breaks to use in color scale (defaults to 100)

main

character. Main plot titles (one for each layer to be plotted). You can use arguments cex.main, font.main, col.main to change the appearance; and loc.main to change the location of the main title (either two coordinates, or a character value such as "topleft")

box

whether to include a box around the Raster plot (defaults to FALSE)

range

numeric. minimum and maximum values to be used for the continuous legend

legend

whether to include legend

...

arguments passed to plot("SpatRaster", "numeric") and additional graphical arguments

Value

plot of genetic diversity

Examples

data("mini_lyr")
plot_gd(mini_lyr)


wingen documentation built on May 29, 2024, 9:59 a.m.