This function generates a ggplot layer representing a trajectory frame based on a specified trajectory segment in a spata2 object. It creates a rectangular frame around the trajectory segment, with customizable appearance.

ggpLayerTrajectoryFrame(
  object,
  id,
  width = getTrajectoryLength(object, id),
  rect_alpha = 1,
  rect_color = "black",
  rect_linesize = 1,
  rect_linetype = "solid"
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

id

The identifier of the trajectory segment within the spata2 object.

width

Distance measure. The width of the trajectory frame, defaulting to the trajectory length.

rect_alpha

The alpha transparency level of the rectangle's border

rect_color

The color of the rectangle's border.

rect_linesize

The size of the line used for the rectangle's border.

rect_linetype

The type of line used for the rectangle's border.

Value

ggpLayer*()-functions return lists of ggproto objects that can be added to ggplots via the + operator. In most of the cases they are supposed to be added to plots created with the plotSurface*() family.