Learn R Programming

trajr (version 1.5.1)

plot.Trajectory: Plot method for trajectories

Description

The plot method for Trajectory objects.

Usage

# S3 method for Trajectory
plot(
  x,
  add = FALSE,
  draw.start.pt = TRUE,
  start.pt.cex = 0.8,
  start.pt.pch = 16,
  start.pt.col = "black",
  turning.angles = NULL,
  xlim = grDevices::extendrange(x$x),
  ylim = grDevices::extendrange(x$y),
  xlab = ifelse(is.null(TrajGetUnits(x)), "x", sprintf("x (%s)", TrajGetUnits(x))),
  ylab = ifelse(is.null(TrajGetUnits(x)), "y", sprintf("y (%s)", TrajGetUnits(x))),
  ann = graphics::par("ann"),
  axes = TRUE,
  frame.plot = axes,
  asp = 1,
  ...
)

Arguments

x

An object of class "Trajectory", the trajectory to be plotted.

add

If TRUE, the trajectory is added to the current plot.

draw.start.pt

If TRUE, draws a dot at the start point of the trajectory.

start.pt.cex

Scale to apply when drawing the start point dot.

start.pt.pch

Pch (i.e. plot character, symbol or shape) to apply when drawing the start point dot.

start.pt.col

Colour to apply when drawing the start point dot.

turning.angles

If "random" or "directed", draws step turning angles. "directed" assumes errors are relative to the first recorded step angle. "random" assumes errors are relative to the previous step.

xlim, ylim, xlab, ylab, asp, ann, axes, frame.plot

plotting parameters with useful defaults.

...

Additional arguments are passed to both plot and lines.

See Also

TrajFromCoords

Examples

Run this code
set.seed(42)
trj <- TrajGenerate(angularErrorSd = 1.3)
plot(trj)

Run the code above in your browser using DataLab