.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Plots/plot_shortlong.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_shortlong.py: Plot short and long invertvals ============================== Visualization of short, long, extra and missed intervals detection. The artefact detection is based on the method described in [1]_. .. [1] Lipponen, J. A., & Tarvainen, M. P. (2019). A robust algorithm for heart rate variability time series artefact correction using novel beat classification. Journal of Medical Engineering & Technology, 43(3), 173–181. https://doi.org/10.1080/03091902.2019.1640306 .. GENERATED FROM PYTHON SOURCE LINES 15-19 .. code-block:: Python # Author: Nicolas Legrand # Licence: GPL v3 .. GENERATED FROM PYTHON SOURCE LINES 20-22 Visualizing short/long and missed/extra intervals from a RR time series ----------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 22-29 .. code-block:: Python from systole import import_rr from systole.plots import plot_shortlong # Import PPG recording as numpy array rr = import_rr().rr.to_numpy() plot_shortlong(rr) .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_shortlong_001.png :alt: Subspace 2 (long and short beats detection) :srcset: /auto_examples/Plots/images/sphx_glr_plot_shortlong_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 30-32 Visualizing ectopic subspace from the `artefact` dictionary ----------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 32-39 .. code-block:: Python from systole.detection import rr_artefacts # Use the rr_artefacts function to short/long and extra/missed intervals artefacts = rr_artefacts(rr) plot_shortlong(artefacts=artefacts) .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_shortlong_002.png :alt: Subspace 2 (long and short beats detection) :srcset: /auto_examples/Plots/images/sphx_glr_plot_shortlong_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 40-42 Using Bokeh as plotting backend ------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 42-51 .. code-block:: Python from bokeh.io import output_notebook from bokeh.plotting import show from systole.detection import rr_artefacts output_notebook() show( plot_shortlong( artefacts=artefacts, backend="bokeh" ) ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.348 seconds) .. _sphx_glr_download_auto_examples_Plots_plot_shortlong.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_shortlong.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_shortlong.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_