pyvista.Plotter.save_graphic

pyvista.Plotter.save_graphic#

Plotter.save_graphic(
filename,
title='PyVista Export',
raster=True,
painter=True,
) None[source]#

Save a screenshot of the rendering window as a graphic file.

This can be helpful for publication documents.

The supported formats are:

  • '.svg'

  • '.eps'

  • '.ps'

  • '.pdf'

  • '.tex'

Parameters:
filenamestr

Path to fsave the graphic file to.

titlestr, default: “PyVista Export”

Title to use within the file properties.

rasterbool, default: True

Attempt to write 3D properties as a raster image.

painterbool, default: True

Configure the exporter to expect a painter-ordered 2D rendering, that is, a rendering at a fixed depth where primitives are drawn from the bottom up.

Examples

>>> import pyvista as pv
>>> from pyvista import examples
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(examples.load_airplane(), smooth_shading=True)
>>> _ = pl.add_background_image(examples.mapfile)
>>> pl.save_graphic('img.svg')