.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Plots/plot_rr.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_Plots_plot_rr.py: Plot instantaneous heart rate ============================= .. GENERATED FROM PYTHON SOURCE LINES 7-17 .. code-block:: default # Author: Nicolas Legrand # Licence: GPL v3 from bokeh.io import output_notebook from bokeh.plotting import show from systole.plots import plot_rr from systole import import_rr .. GENERATED FROM PYTHON SOURCE LINES 18-20 Plot instantaneous heart rate from a RR interval time series (in milliseconds). ------------------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 20-25 .. code-block:: default # Import R-R intervals time series rr = import_rr().rr.values plot_rr(rr=rr, input_type="rr_ms"); .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_rr_001.png :alt: Instantaneous heart rate :srcset: /auto_examples/Plots/images/sphx_glr_plot_rr_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 26-28 Only show the interpolated instantaneous heart rate, add a bad segment and change the default unit to beats per minute (BPM). ----------------------------------------------------------------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 28-29 .. code-block:: default plot_rr(rr=rr, input_type="rr_ms", unit="bpm", points=False); .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_rr_002.png :alt: Instantaneous heart rate :srcset: /auto_examples/Plots/images/sphx_glr_plot_rr_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 30-32 Use Bokeh as a plotting backend, only show the scatterplt and highlight artefacts in the RR intervals ----------------------------------------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 32-39 .. code-block:: default output_notebook() show( plot_rr( rr=rr, input_type="rr_ms", backend="bokeh", line=False, show_artefacts=True ) ) .. rst-class:: sphx-glr-script-out .. code-block:: none BokehDeprecationWarning: CDSView.source is no longer needed, and is now ignored. In a future release, passing source will result an error. BokehDeprecationWarning: CDSView.filters was deprecated in bokeh 3.0. Use CDSView.filter instead. BokehDeprecationWarning: CDSView.source is no longer needed, and is now ignored. In a future release, passing source will result an error. BokehDeprecationWarning: CDSView.filters was deprecated in bokeh 3.0. Use CDSView.filter instead. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.671 seconds) .. _sphx_glr_download_auto_examples_Plots_plot_rr.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_rr.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_rr.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_