pyvista.plotting.themes.Theme.save

Contents

pyvista.plotting.themes.Theme.save#

Theme.save(filename: str) None[source]#

Serialize this theme to a json file.

before_close_callback is non-serializable and is omitted.

Parameters:
filenamestr

Path to save the theme to. Should end in '.json'.

Examples

Export and then load back in a theme.

>>> import pyvista as pv
>>> theme = pv.themes.DocumentTheme()
>>> theme.background = 'white'
>>> theme.save('my_theme.json')  
>>> loaded_theme = pv.load_theme('my_theme.json')