aind_ephys_utils.plots.trajectory module¶
Low-dimensional trajectory plotting helpers.
- aind_ephys_utils.plots.trajectory.trajectory(data: DataArray, *, group_by: str | Sequence[str] | None = None, component_dim: str = 'component', time_dim: str = 'time', components: Sequence[int] | None = None, ax: Axes | None = None, color: str | None = None, alpha: float = 1.0, linewidth: float = 1.5, label: str | None = None) Axes¶
Plot trajectories in low-dimensional space.
- Parameters:
data – Reduced DataArray (e.g., components x time). Selection should be done upstream; this function only plots.
group_by – Optional trial coord(s) to split and plot conditions.
component_dim – Name of the component dimension.
time_dim – Name of the time dimension.
components – Optional component indices to plot (e.g., [0,1] or [0,1,2]).
ax – Matplotlib Axes to draw on; created if None.
color – Plot styling options.
alpha – Plot styling options.
linewidth – Plot styling options.
label – Plot styling options.
- Returns:
The matplotlib Axes.
- Return type:
plt.Axes