Skip to contents

Creates a multi-panel visualization of keypoint position data over time. Each keypoint gets its own panel showing its x and/or y coordinates, with different colors distinguishing between x (orange) and y (blue) coordinates. Useful for visually inspecting movement patterns and identifying potential tracking issues.

Usage

plot_position_timeseries(data, reference_keypoint = NULL, dimension = "xy")

Arguments

data

A data frame containing tracked keypoint data with the following columns:

  • time: Numeric time values

  • keypoint: Factor specifying the keypoint names

  • x: x-coordinates

  • y: y-coordinates

reference_keypoint

Optional character string. If provided, all coordinates will be translated relative to this keypoint's position. Must match one of the keypoint levels in the data.

dimension

Character string specifying which coordinates to plot. Options are:

  • "xy": Plot both x and y coordinates (default)

  • "x": Plot only x coordinates

  • "y": Plot only y coordinates

Value

A ggplot object combining individual time series plots for each keypoint using patchwork. The plots are stacked vertically with shared axes and legends.

See also

translate_coords() for the coordinate translation functionality used when reference_keypoint is specified.

Examples

if (FALSE) { # \dontrun{
# Plot all coordinates
check_timeseries(movement_data)

# Plot coordinates relative to "head" keypoint
check_timeseries(movement_data, reference_keypoint = "head")

# Plot only x coordinates
check_timeseries(movement_data, dimension = "x")
} # }