m3resp.visualization.plot_synchronization_comparison#

m3resp.visualization.plot_synchronization_comparison(session, *, max_seconds=120.0, emg_channel=None, eit_waveform='global_impedance_(raw)', backend='matplotlib', max_points=5000)[source]#

Plot each signal before and after synchronization.

Each row shows one signal: on its own clock at the left, and on the shared clock at the right. The lines mark the breaths of each modality.

Parameters:
  • session (M3Session) – The session after synchronize_raw_modalities or after synchronize_multimodal_breaths.

  • max_seconds (float | None) – Show the first max_seconds seconds of each signal. None shows the full signal.

  • emg_channel (int | None) – The EMG channel to show. It must be the channel that the EMG processing used. None shows that channel.

  • eit_waveform (str) – The name of the EIT signal to show.

  • backend (str) – "matplotlib" gives a static figure. "plotly" gives an interactive figure for a web page or a notebook.

  • max_points (int | None) – For backend="plotly" only. The largest number of points drawn for one signal. See plot_session_overview().

Returns:

The figure.

Return type:

matplotlib.figure.Figure | plotly.graph_objects.Figure

Raises:
  • ValueError – If backend is unknown, or if the session has no synchronization data or no signal to plot.

  • ImportError – If the plot library of backend is not installed.