Note
Go to the end to download the full example code
Plot raw physiological signal#
# Author: Nicolas Legrand <nicolas.legrand@cfin.au.dk>
# 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
Plot raw ECG signal#
0%| | 0/2 [00:00<?, ?it/s]
Downloading ECG channel: 0%| | 0/2 [00:00<?, ?it/s]
Downloading ECG channel: 50%|█████ | 1/2 [00:00<00:00, 2.85it/s]
Downloading Respiration channel: 50%|█████ | 1/2 [00:00<00:00, 2.85it/s]
Downloading Respiration channel: 100%|██████████| 2/2 [00:00<00:00, 1.93it/s]
Downloading Respiration channel: 100%|██████████| 2/2 [00:00<00:00, 2.03it/s]
<Axes: title={'center': 'ECG recording'}, ylabel='ECG (mV)'>
Plot raw PPG signal#
Import Respiration recording as pandas data frame
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")
0%| | 0/1 [00:00<?, ?it/s]
Downloading Respiration channel: 0%| | 0/1 [00:00<?, ?it/s]
Downloading Respiration channel: 100%|██████████| 1/1 [00:00<00:00, 2.63it/s]
Downloading Respiration channel: 100%|██████████| 1/1 [00:00<00:00, 2.63it/s]
<Axes: title={'center': 'Respiration'}, ylabel='Respiratory signal'>
Plot raw respiratory signal#
<Axes: title={'center': 'PPG recording'}, ylabel='PPG level (a.u.)'>
Using Bokeh as plotting backend#
output_notebook()
show(
plot_raw(ppg, backend="bokeh", show_heart_rate=True, show_artefacts=True)
)
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.
Total running time of the script: (0 minutes 2.862 seconds)