Learn R Programming

paleomorph (version 0.1.4)

plotSpecimens: Plot an array of specimen landmark data in an interactive 3D frame

Description

This function requires the rgl package. Given a N x 3 x M array (where M is the number of specimens and N is the number of landmarks), as used elsewhere in this package, plot each specimen in a different colour in an intereactive 3D frame.

Usage

plotSpecimens(A, l1 = NULL, midlineSpecimens = NULL, cols = NULL,
  bySpecimen = TRUE, planeOptions = NULL, ...)

Arguments

A
An N x 3 x M array.
l1
Optional vector of indices for which landmarks to use to make a specimen midline. If NULL, no midline plane is plotted.
midlineSpecimens
Numeric vector indicating which specimens should be used to built the midline plane. If NULL, but l1 is defined, all specimens are used.
cols
A vector of colours.
bySpecimen
Logical that determined whether points should be coloured by specimen (default) or by landmark.
planeOptions
Named list of parameters passed to rgl.material to control the appearence of plotted mirror planes.
...
Further parameters passed to plot3d.

See Also

plot3d mirrorfill planes3d rgl.material

Examples

Run this code
A <- array(rep(rnorm(3 * 20, sd = 30), by = 6) + rnorm(6 * 20 * 3), 
       dim = c(20, 3, 6))
plotSpecimens(A)

plotSpecimens(A, bySpecimen = FALSE)

plotSpecimens(A, cols = grey(seq(0, 1, length.out = 6)))

plotSpecimens(A, l1 = c(1:4), planeOptions = list(alpha = 0.4, color = 'red'))


Run the code above in your browser using DataLab