aind_ephys_utils.plots.annotations module

Annotation helpers for plot overlays.

aind_ephys_utils.plots.annotations.add_scale_bars(ax: Axes, *, x_unit: str, y_unit: str, x_length: float | None = None, y_length: float | None = None, x_text: str | None = None, y_text: str | None = None) None

Draw simple scale bars and hide axes.

aind_ephys_utils.plots.annotations.annotate_events(*, ax: Axes | None = None, events: Sequence[float] | ndarray | DataArray | None = None, intervals: Sequence[Tuple[float, float]] | ndarray | DataArray | None = None, event_labels: Sequence[str] | Dict[float, str] | None = None, interval_labels: Sequence[str] | Dict[Tuple[float, float], str] | None = None, event_style: dict | None = None, interval_style: dict | None = None) Axes

Overlay events (vertical lines) and intervals (shaded spans).

Parameters:
  • ax – Matplotlib Axes to draw on; defaults to plt.gca().

  • events – 1D sequence or DataArray of event times.

  • intervals – Sequence of (start, end) tuples or DataArray with shape (n, 2).

  • event_labels – Optional labels for events (sequence aligned with events or mapping).

  • interval_labels – Optional labels for intervals (sequence aligned with intervals or mapping).

  • event_style – Optional styling dict passed to ax.axvline.

  • interval_style – Optional styling dict passed to ax.axvspan.