landmark.plot: Plot the relative position of landmarks

landmark.plotR Documentation

Plot the relative position of landmarks

Description

Plot the relative position of landmarks

Usage

landmark.plot(
  A,
  specimen.number = NULL,
  square = TRUE,
  axes = FALSE,
  def.grids = FALSE,
  landmark.numbers = TRUE,
  links = NULL,
  panels = c(1, 1),
  text.color = "darkred",
  line.color = "darkgray",
  ...
)

Arguments

A

A 2D matrix of X and Y shape coordinates, a 3-dimensional array containing XY coordinates for multiple specimens, or a list containing such as an array.

specimen.number

If an array is provided, the specimen number(s) to plot.

square

A logical factor specifying whether the aspect ratio of the plot should be equal.

axes

A logical factor specifying whether to include x and y axes.

def.grids

A logical factor specifying whether to plot deformation grids (thin plate splines) using geomorph::plotRefToTarget. If so, the function uses method = "TPS" and the reference is set to the censusus shape for the entire the coordinate array.

landmark.numbers

A logical factor specifying whether landmarks should appear as numbers (if TRUE) or as dots.

links

A matrix with two columns indicating landmarks to connect by lines. Alternatively, enter "chull" to draw a convex hull or "ordinal" to link landmarks in numerical order.

panels

A vector with exactly two integers specifying the number of rows and columns of specimens to plot. If the number of panels exceeds the number of values entered in specimen.number then the next consecutive specimens will be shown, starting from specimen 1 if no value is provided for specimen.number.

text.color

Color names or value for the text.

line.color

Color names or value for lines.

Source

Dave Angelini david.r.angelini@gmail.com [aut, cre]

Examples

data(plethodon, package = "geomorph")

# The function will detect whether the input object is
# a 2D set of coordinates or a 3D array
# The following are all equivalent
landmark.plot(plethodon)
landmark.plot(plethodon$land, specimen.number = 1)
landmark.plot(plethodon$land[,,1])

# Convex hull
landmark.plot(plethodon$land, links = "chull")
# Link landmarks in numerical order
landmark.plot(plethodon$land, links = "ordinal")

# Custom landmark connections
pletho.links <- matrix(c(4,5,5,6,6,7,7,8,8,9,9,10,10,11,2,4,12,2,3,5),
                       ncol = 2, byrow = TRUE)
landmark.plot(plethodon$land, links = pletho.links)

# Change colors
landmark.plot(plethodon$land, links = pletho.links,
              text.color = "grey40",
              line.color = "darkblue")

# Multiple panels
landmark.plot(plethodon$land, links = pletho.links, specimen.number = 1:4 )
landmark.plot(plethodon$land, links = pletho.links, panels = c(3,2) )


aphanotus/borealis documentation built on Nov. 4, 2022, 8:44 p.m.