autoplot.metaMDS: ggplot-based plot for objects of class '"metaMDS"'

autoplot.metaMDSR Documentation

ggplot-based plot for objects of class "metaMDS"

Description

Produces a multi-layer ggplot object representing the output of objects produced by vegan::metaMDS().

Usage

## S3 method for class 'metaMDS'
autoplot(
  object,
  geom = c("point", "text"),
  layers = c("species", "sites"),
  legend.position = "right",
  title = NULL,
  subtitle = NULL,
  caption = NULL,
  ylab,
  xlab,
  ...
)

Arguments

object

an object of class "metaMDS", the result of a call to vegan::metaMDS().

geom

character; which geom to use for the species (variables) and sites (samples) layers. A vector of length 2; if a vector of length 1, geom is extended to the required length.

layers

character; which scores to plot as layers

legend.position

character or two-element numeric vector; where to position the legend. See ggplot2::theme() for details. Use "none" to not draw the legend.

title

character; subtitle for the plot.

subtitle

character; subtitle for the plot.

caption

character; caption for the plot.

ylab

character; label for the y-axis.

xlab

character; label for the x-axis.

...

Additional arguments passed to ⁠\link{fortify.metaMDS}⁠.

Details

TODO

Value

Returns a ggplot object.

Author(s)

Gavin L. Simpson

Examples


library("vegan")

data(dune)

sol <- metaMDS(dune)
autoplot(sol)

ggvegan documentation built on Feb. 28, 2026, 1:07 a.m.