plotAddLabels.characters: Add Labels to a Plot

View source: R/plot.addLabels.characters.R

plotAddLabels.charactersR Documentation

Add Labels to a Plot

Description

This is a generic function for drawing labels to the character arrows of pcadata and cdadata objects.

Usage

plotAddLabels.characters(result, labels = characters(result), include = TRUE,
      axes = c(1,2), pos = NULL, offset = 0.5, cex = 0.7, col = NULL, ...)

Arguments

result

an object of class pcadata or cdadata.

labels

a vector of label names, which should be included / excluded from plotting, see include.

include

logical, specify if labels in labels argument should be plotted or excluded from plotting.

axes

x, y axes of plot.

pos

a position specifier for the text. Values of 1, 2, 3 and 4, respectively indicate positions below, to the left of, above and to the right of the point.

offset

when pos is specified, this value controls the distance (offset) of the text label from the point in fractions of a character width.

cex

character expansion factor for text.

col

the colours for labels.

...

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

Value

None. Used for its side effect of adding elements to a plot.

Examples

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


pcaRes = pca.calc(centaurea)

plotCharacters(pcaRes, labels = FALSE)
plotAddLabels.characters(pcaRes, labels = c("MW", "IW", "SFT", "SF", "LW"), pos = 2, cex = 1)
plotAddLabels.characters(pcaRes, labels = c("LLW", "ILW", "LBA"), pos = 4, cex = 1)
plotAddLabels.characters(pcaRes, labels = c("ML", "IV", "MLW"), pos = 1, cex = 1)

MorphoTools2 documentation built on March 7, 2023, 6:18 p.m.