Plot ectopic beats#

# Author: Nicolas Legrand <nicolas.legrand@cfin.au.dk>
# Licence: GPL v3

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")
Subspace 1   (ectopic beats detection)
<Axes: title={'center': 'Subspace 1 \n (ectopic beats detection)'}, xlabel='Subspace $S_{11}$', ylabel='Subspace $S_{12}$'>

Visualizing ectopic subspace from the artefact dictionary generated by 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)
Subspace 1   (ectopic beats detection)
<Axes: title={'center': 'Subspace 1 \n (ectopic beats detection)'}, xlabel='Subspace $S_{11}$', ylabel='Subspace $S_{12}$'>

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")
)

Total running time of the script: (0 minutes 0.613 seconds)

Gallery generated by Sphinx-Gallery