plotAddSpiders: Add Spiders to a Plot

View source: R/plot.addSpiders.R

plotAddSpidersR Documentation

Add Spiders to a Plot

Description

This function connects taxa's points with its centroids, thus forms a “spider” diagram.

Usage

plotAddSpiders(result, axes = c(1,2), col = "black", lty = 1, lwd = 1, ...)

Arguments

result

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

axes

x, y axes of plot.

col

the colours for labels.

lty

the line type. Line types can either be specified as one of following types: 0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash.

lwd

the line width.

...

further arguments to be passed to lines 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)

plotPoints(pcaRes, col = c(rgb(255, 0, 0, max = 255, alpha = 150), # red
                           rgb(0, 255, 0, max = 255, alpha = 150), # green
                           rgb(0, 0, 255, max = 255, alpha = 150), # blue
                           rgb(0, 0, 0, max = 255, alpha = 150)), # black
            legend = FALSE, xlim = c(-5, 7.5), ylim = c(-5, 5.5))

plotAddLegend(pcaRes, col = c("red", "green", "blue", "black"), ncol = 2)

plotAddSpiders(pcaRes, col = c("red", "green", "blue", "black"))


plotPoints(pcaRes, col = c("red", "green", "blue","black"), legend = TRUE, cex = 0.4)

plotAddSpiders(pcaRes, col = c(rgb(255, 0, 0, max = 255, alpha = 150), # red
                               rgb(0, 255, 0, max = 255, alpha = 150), # green
                               rgb(0, 0, 255, max = 255, alpha = 150), # blue
                               rgb(0, 0, 0, max = 255, alpha = 150))) # black

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