Jupyter Notebook Plotting

Jupyter Notebook Plotting#

Plot with pyvista interactively within a Jupyter notebook.

Note

We recommend using the Trame-based backend. See Trame Jupyter Backend for PyVista.

Supported Modules#

The PyVista module supports a variety of backends when plotting within a jupyter notebook:

  • Server and client-side rendering with PyVista streaming to the notebook through trame

  • Static images.

Usage With PyVista#

There are two ways to set the jupyter plotting backend. First, it can be done on a plot by plot basis by setting the jupyter_backend parameter in either Plotter.show() or dataset.plot(). You can also set it globally with the pyvista.set_jupyter_backend() or the PYVISTA_JUPYTER_BACKEND environment variable (see Global Configuration). Custom backends are also supported with pyvista.register_jupyter_backend(). For further details:

import pyvista as pv

pv.set_jupyter_backend('trame')

register_jupyter_backend(name, handler, *[, ...])

Register a custom Jupyter backend handler.

registered_jupyter_backends()

Return every custom Jupyter backend currently registered.

set_jupyter_backend(backend[, name])

Set the plotting backend for a jupyter notebook.