set_plot_theme

Contents

set_plot_theme#

set_plot_theme(theme)[source]#

Set plotting parameters to a predefined theme using a string or Theme.

Parameters:
themestr | Theme

Theme to apply. Accepts any of:

  • A registered theme name. Built-in names include 'dark', 'default', 'document', 'document_build', 'document_pro', 'paraview', 'testing', and 'vtk'. Third-party plugins can add more via the pyvista.themes entry-point group. Use registered_themes() to list everything that is currently available.

  • A "package.module:ClassName" dotted path to any importable Theme subclass.

  • A Theme instance.

See also

pyvista.registered_themes

List all registered theme names.

pyvista.plotting.themes.Theme

Base class. Subclasses with a class-level _default_name are discoverable by name; see the class docstring for details aimed at theme authors and plugin packages.

Examples

Set to the default theme.

>>> import pyvista as pv
>>> pv.set_plot_theme('default')

Set to the document theme.

>>> pv.set_plot_theme('document')

Set to the dark theme.

>>> pv.set_plot_theme('dark')

Set to the ParaView theme.

>>> pv.set_plot_theme('paraview')

Load a theme from any importable module using a dotted path.

>>> pv.set_plot_theme('pyvista.plotting.themes:DarkTheme')