mne.viz.set_3d_backend#

mne.viz.set_3d_backend(backend_name, verbose=None)[source]#

Set the 3D backend for MNE.

The backend will be set as specified and operations will use that backend.

Parameters:
backend_namestr

The 3d backend to select. See Notes for the capabilities of each backend ('pyvistaqt', 'notebook' and 'jupyterlite_notebook').

Changed in version 0.24: The 'pyvista' backend was renamed 'pyvistaqt'.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
old_backend_namestr | None

The old backend that was in use.

Notes

To use PyVista, set backend_name to pyvistaqt but the value pyvista is still supported for backward compatibility.

The jupyterlite_notebook backend is not in the table below because it is not a desktop choice: it draws with vtk.js rather than VTK, which has no WebAssembly build, and it is what the documentation’s browser notebooks run on. It covers the static 3D figures, so plot_alignment() (without channel-name labels) and plot_sparse_source_estimates() work, while mne.viz.Brain, plot_evoked_field() and snapshot_brain_montage() do not. On a desktop the other two are better in every way, so it is never selected automatically.

This table shows the capabilities of each backend (”✓” for full support, and “-” for partial support):

3D function:

pyvistaqt

notebook

plot_vector_source_estimates()

plot_source_estimates()

plot_alignment()

plot_sparse_source_estimates()

plot_evoked_field()

snapshot_brain_montage()

link_brains()

Feature:

Large data

Opacity/transparency

Support geometric glyph

Smooth shading

Subplotting

Inline plot in Jupyter Notebook

Inline plot in JupyterLab

Inline plot in Google Colab

Toolbar