plotAddLabels.points {MorphoTools2}R Documentation

Add Labels to a Plot

Description

This is a generic function for drawing labels to the data points of pcadata, pcoadata, nmdsdata, and cdadata objects.

Usage

plotAddLabels.points(result, labels = result$objects$ID, include = TRUE,
      axes = c(1,2), pos = NULL, offset = 0.5, cex = 1, col = NULL, ...)

Arguments

result

result of pca.calc, pcoa.calc, nmds.calc, or cda.calc, has to by plotted at first.

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"))
pops = populOTU(centaurea)


pcaRes = pca.calc(pops)
plotPoints(pcaRes, col = c("red", "green", "blue", "red"),
            pch = c(20, 17, 8, 21), pt.bg = "orange", legend = FALSE)

plotAddLabels.points(pcaRes, labels = c("LES", "BUK", "VOL", "OLE1"), include = TRUE)

plotPoints(pcaRes, col = c("red", "green", "blue", "red"),
            pch = c(20, 17, 8, 21), pt.bg = "orange", legend = FALSE)

plotAddLabels.points(pcaRes, labels = c("LES", "BUK", "VOL", "OLE1"), include = FALSE)

[Package MorphoTools2 version 1.0.1.1 Index]