plotBiplot: The Default Biplot Function

View source: R/plot.biplot.R

plotBiplotR Documentation

The Default Biplot Function

Description

A generic function for plotting ordination scores and the character's contribution to ordination axes in a single plot.

Usage

plotBiplot(result, axes = c(1,2), xlab = NULL, ylab = NULL,
      pch = 16, col = "black", pt.bg = "white", breaks = 1,
      xlim = NULL, ylim = NULL, labels = FALSE, arrowLabels = TRUE,
      colArrowLabels = "black", angle = 15, length = 0.1, arrowCol = "red",
      legend = FALSE, legend.pos = "topright", ncol = 1, ...)

Arguments

result

an object of class pcadata, or cdadata.

axes

x, y axes of plot.

xlab, ylab

a title of the respective axes.

pch

a vector of plotting characters or symbols: see points.

col

the colours for points. Multiple colours can be specified so that each taxon can be given its own colour. If there are fewer colours than taxa, they are recycled in the standard fashion.

pt.bg

the background colours for points. Multiple colours can be specified, as above.

breaks

a numeric, giving the width of one histogram bar.

xlim, ylim

the range of x and y axes.

labels

logical, if TRUE, object's labels are displayed.

arrowLabels

logical, if TRUE, character's labels are displayed.

colArrowLabels

the colours for character's labels.

angle

angle from the shaft of the arrow to the edge of the arrow head.

length

length of the edges of the arrow head (in inches).

arrowCol

the colour for arrows.

legend

logical, if TRUE, legend is displayed. Only restricted number of legend parameters are supported. For more precise legend plotting, use plotAddLegend directly.

legend.pos

a single keyword from the list "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", and "center", to be used to position the legend.

ncol

the number of columns in which to set the legend items.

...

further arguments to be passed to plot.default or other graphical parameters in par.

Details

This generic method holds separate implementations of plotting biplots for pcadata, and cdadata objects. If only one axis exists, sample scores are displayed as a histogram.

Value

None. Used for its side effect of producing a plot.

Examples

data(centaurea)
centaurea = naMeanSubst(centaurea)
centaurea = removePopulation(centaurea, populationName = c("LIP", "PREL"))

pcaRes = pca.calc(centaurea)

plotBiplot(pcaRes, axes = c(1,2), col = c("red", "green", "blue", "red"),
  pch = c(20, 17, 8, 21), pt.bg = "orange", legend = TRUE, legend.pos = "bottomright")

plotBiplot(pcaRes, main = "My PCA plot", cex = 0.8)

cdaRes = cda.calc(centaurea)

plotBiplot(cdaRes, col = c("red", "green", "blue", "red"),
  pch = c(20, 17, 8, 21), pt.bg = "orange", legend = TRUE)

MorphoTools2 documentation built on Oct. 2, 2024, 5:07 p.m.