Plot ectopic beats#

# Author: Nicolas Legrand <nicolas.legrand@cfin.au.dk>
# Licence: Apache-2.0

from systole.plots import plot_ectopic

Visualizing ectopic subspace from RR time series#

from systole import import_rr

# Import PPG recording as numpy array
rr = import_rr().rr.to_numpy()

plot_ectopic(rr, input_type="rr_ms")
<Axes: title={'center': 'Subspace 1 \n (ectopic beats detection)'}, xlabel='Subspace $S_{11}$', ylabel='Subspace $S_{12}$'>
../../_images/9cc55af66a5d14526b4460b91aa7b6ae5a3743bdde36def1a34d76fd3317feab.png

Visualizing ectopic subspace from the artefact dictionary generated by :py:func:systole.detection.rr_artefacts()#

from systole.detection import rr_artefacts

# Use the rr_artefacts function to find ectopic beats
artefacts = rr_artefacts(rr)

plot_ectopic(artefacts=artefacts)
<Axes: title={'center': 'Subspace 1 \n (ectopic beats detection)'}, xlabel='Subspace $S_{11}$', ylabel='Subspace $S_{12}$'>
../../_images/9cc55af66a5d14526b4460b91aa7b6ae5a3743bdde36def1a34d76fd3317feab.png

Using Bokeh as plotting backend#

from bokeh.io import output_notebook
from bokeh.plotting import show
from systole.detection import rr_artefacts

output_notebook()

# Use the rr_artefacts function to find ectopic beats
artefacts = rr_artefacts(rr)
show(
    plot_ectopic(artefacts=artefacts, backend="bokeh")
)
Loading BokehJS ...