.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Plots/plot_raw.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_raw.py: Plot raw physiological signal ============================= .. GENERATED FROM PYTHON SOURCE LINES 7-18 .. 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_raw from systole import import_dataset1, import_ppg .. GENERATED FROM PYTHON SOURCE LINES 19-21 Plot raw ECG signal -------------------- .. GENERATED FROM PYTHON SOURCE LINES 21-28 .. code-block:: default # Import PPG recording as pandas data frame physio_df = import_dataset1(modalities=['ECG', 'Respiration']) # Only use the first 60 seconds for demonstration ecg = physio_df[physio_df.time.between(60, 90)].ecg plot_raw(ecg, modality='ecg', sfreq=1000, detector='sleepecg') .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_raw_001.png :alt: ECG recording :srcset: /auto_examples/Plots/images/sphx_glr_plot_raw_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/2 [00:00 .. GENERATED FROM PYTHON SOURCE LINES 29-32 Plot raw PPG signal ------------------- Import Respiration recording as pandas data frame .. GENERATED FROM PYTHON SOURCE LINES 32-37 .. code-block:: default rsp = import_dataset1(modalities=['Respiration']) # Only use the first 90 seconds for demonstration rsp = physio_df[physio_df.time.between(500, 600)].respiration plot_raw(rsp, sfreq=1000, modality="respiration") .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_raw_002.png :alt: Respiration :srcset: /auto_examples/Plots/images/sphx_glr_plot_raw_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/1 [00:00 .. GENERATED FROM PYTHON SOURCE LINES 38-40 Plot raw respiratory signal --------------------------- .. GENERATED FROM PYTHON SOURCE LINES 40-47 .. code-block:: default # Import PPG recording as pandas data frame ppg = import_ppg() # Only use the first 60 seconds for demonstration plot_raw(ppg[ppg.time<60], sfreq=75) .. image-sg:: /auto_examples/Plots/images/sphx_glr_plot_raw_003.png :alt: PPG recording :srcset: /auto_examples/Plots/images/sphx_glr_plot_raw_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 48-50 Using Bokeh as plotting backend ------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 50-55 .. code-block:: default output_notebook() show( plot_raw(ppg, backend="bokeh", show_heart_rate=True, 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 2.862 seconds) .. _sphx_glr_download_auto_examples_Plots_plot_raw.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_raw.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_raw.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_