Plot instantaneous heart rate#

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

from bokeh.io import output_notebook
from bokeh.plotting import show
from systole.plots import plot_rr

from systole import import_rr

Plot instantaneous heart rate from a RR interval time series (in milliseconds).#

# Import R-R intervals time series
rr = import_rr().rr.values

plot_rr(rr=rr, input_type="rr_ms");
../../_images/466df3a418e7d476a7dd1d15c76356d303d4bd08b703b0d49ae9f8d5c7ded8ef.png

Only show the interpolated instantaneous heart rate, add a bad segment and change the default unit to beats per minute (BPM).#

plot_rr(rr=rr, input_type="rr_ms", unit="bpm", points=False);
../../_images/0ac6ac6f89c2cd0bcaf51142b10b46584007dbf28d2c571d34c577dbff407842.png

Use Bokeh as a plotting backend, only show the scatterplt and highlight artefacts in the RR intervals#

output_notebook()

show(
    plot_rr(
    rr=rr, input_type="rr_ms", backend="bokeh", 
    line=False, show_artefacts=True
    )
)
Loading BokehJS ...