Saving Screenshots#

from __future__ import annotations

import matplotlib.pyplot as plt

import pyvista as pv
from pyvista import examples

# Get a sample file
filename = examples.planefile
mesh =

You can also take a screenshot without creating an interactive plot window using the pyvista.Plotter:

plotter = pv.Plotter(off_screen=True)
plotter.add_mesh(mesh, color="orange")'airplane.png')

The img array can be used to plot the screenshot in matplotlib:


Total running time of the script: (0 minutes 0.317 seconds)

Gallery generated by Sphinx-Gallery