Skip to content

Plot

Bases: BaseClass

Class for plotting data interactively and optionally save part of the figure.

Displays the data using MNE's plot() method. If save options are provided, a screenshot of the figure is saved to disk.

MNE-functions used: mne.io.Raw.plot, mne.viz.plot_sensors, mne.time_frequency.Spectrum.plot, mne.time_frequency.Spectrum.plot_topo, mne.time_frequency.Spectrum.plot_topomap

Parameters:

Name Type Description Default
raw Raw | Epochs

Input data.

required
plot_types PlotTypes | None

Types of plots to make; use | to specify multiple plot types (eg. PlotTypes.PLOT|PlotTypes.SPECTRUM_TOPO)

PLOT
save_folder str | None

Folder in which to save the plot. If None, the figure is not saved.

None
save_postfix str | None

Postfix appended to the plot filename.

None
save_overwrite bool

Whether to overwrite files with the same name.

False
**kwargs

Additional keyword arguments passed to MNE's plot(), plot_sensors(), and time_frequency.Spectrum.plot(), plot_topo(), and plot_topomap() methods. Pass arguments for the different functions by using a dictionary with plot, plot_sensors, spectrum_plot, spectrum_topo, and spectrum_topo_map as keys.

{}

Attributes:

Name Type Description
processed Raw | Epochs

Output data (signal data unchanged; metadata may be modified via the interactive plot).

Wrapper around several plot-functions:

Example settings for config file

Example settings in correct format for the config file.

Plot:
  _biopap_module: <class 'biopap.modules.plot.Plot'>
  plot_types: 8
  save_folder: './examples/data/plots'
  save_postfix: 'participant1'
  save_overwrite: False

The value of plot_types translates to actual types thus:

  • PLOT = 1
  • SENSORS = 2
  • SPECTRUM_PLOT = 4
  • SPECTRUM_TOPO = 8
  • SPECTRUM_TOPO_MAP = 16

To generate different types at the same time, you can add the values. For instance, plot_types: 11 translates to PLOT, SENSORS, and SPECTRUM_TOPO, because 11 equals 1 + 2 + 8.