Plot Time Series of Keypoint Position
Source:R/plot_position_timeseries.R
plot_position_timeseries.RdCreates 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.
Arguments
- data
A data frame containing tracked keypoint data with the following columns:
time: Numeric time valueskeypoint: Factor specifying the keypoint namesx: x-coordinatesy: 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.