plot_signals_with_algorithm_results#

pepbench.plotting.plot_signals_with_algorithm_results(datapoint: BasePepDatasetWithAnnotations, *, collapse: bool = False, algorithm: BaseExtraction, normalize_time: bool = False, heartbeat_subset: Sequence[int] | None = None, **kwargs: Any) tuple[Figure, Axes | Sequence[Axes]][source]#

Plot signals and overlay detections from an algorithm.

Parameters:
datapointBasePepDatasetWithAnnotations

Dataset to annotate with algorithm detections.

collapsebool, optional

If True, plot ECG and ICG on a single axis. Default: False.

algorithmbiopsykit.signals._base_extraction.BaseExtraction

Extraction algorithm instance used to detect peaks/points. The function will call algorithm.extract(...) and then plot algorithm.points_.

normalize_timebool, optional

If True, convert time index to seconds. Default: False.

heartbeat_subsetSequence[int] | None, optional

Subset of heartbeat indices to run the algorithm on. If None, all are used.

**kwargsAny

Additional plotting options.

Returns:
(fig, axs)tuple[

Figure, Axes | Sequence[Axes] ] Figure and axis (or axes) with algorithm detections added.

Notes

Supports ECG algorithms implementing heartbeat-aware extraction (biopsykit.signals.ecg.event_extraction.BaseEcgExtractionWithHeartbeats) and B-point extraction algorithms (biopsykit.signals.icg.event_extraction.BaseBPointExtraction).