.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Plots/plot_ectopic.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_ectopic.py: Plot ectopic beats ================== .. GENERATED FROM PYTHON SOURCE LINES 7-13 .. code-block:: default # Author: Nicolas Legrand # Licence: GPL v3 from systole.plots import plot_ectopic .. GENERATED FROM PYTHON SOURCE LINES 14-16 Visualizing ectopic subspace from RR time series ------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 16-22 .. code-block:: default from systole import import_rr # Import PPG recording as numpy array rr = import_rr().rr.to_numpy() plot_ectopic(rr, input_type="rr_ms") .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_ectopic_001.png :alt: Subspace 1 (ectopic beats detection) :srcset: /auto_examples/Plots/images/sphx_glr_plot_ectopic_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 23-25 Visualizing ectopic subspace from the `artefact` dictionary generated by :py:func:`systole.detection.rr_artefacts()` -------------------------------------------------------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 25-31 .. code-block:: default from systole.detection import rr_artefacts # Use the rr_artefacts function to find ectopic beats artefacts = rr_artefacts(rr) plot_ectopic(artefacts=artefacts) .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_ectopic_002.png :alt: Subspace 1 (ectopic beats detection) :srcset: /auto_examples/Plots/images/sphx_glr_plot_ectopic_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 32-34 Using Bokeh as plotting backend ------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 34-44 .. code-block:: default 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") ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.613 seconds) .. _sphx_glr_download_auto_examples_Plots_plot_ectopic.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_ectopic.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ectopic.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_