Theme.transparent_background#
- property Theme.transparent_background: Literal[True, False, 'straight', 'premultiplied'][source]#
Return or set whether the background is transparent by default.
Accepts the same values as the
transparent_backgroundparameter ofpyvista.Plotter.screenshot(). With'straight'and'premultiplied', every screenshot,pyvista.Plotter.image, and movie frame renders the scene again over a black background.Added in version 0.50: The
'straight'and'premultiplied'options.Changed in version 0.50: Other values raise a
ValueError.
Examples#
Download Python source code | Download Jupyter notebook
Set transparent_background globally to True.
>>> import pyvista as pv
>>> pv.global_theme.transparent_background = True
Remove the background color from the edges of transparent screenshots.
>>> pv.global_theme.transparent_background = 'straight'