Defaults

The following module is used to customize the appearance of the plotting module. In particular, the user can set the default backends for 2D and 3D plots, as well as themes.

spb.defaults.get_default_settings()[source]

Return the default setting dictionary for inspection.

Examples

Visualize the default settings.

>>> from spb.defaults import get_default_settings
>>> print(get_default_settings)  
spb.defaults.set_defaults(cfg)[source]

Set the default options for the plotting backends and save them to a file.

Parameters:
cfgdict

Dictionary containing the new values

Notes

This plotting module uses the appdir module [1] to determine the best location where to save the settings. It will save a human readable config.json file, which SHOULD NOT be modified directly with a text editor. Use the set_defaults function to modify the configuration settings!

References

Examples

Change the default 2D plotting backend to MatplotlibBackend.

>>> from spb.defaults import cfg, set_defaults
>>> ## to visualize the current settings
>>> # print(cfg)
>>> cfg["backend_2D"] = "matplotlib"
>>> set_defaults(cfg)
spb.defaults.reset()[source]

Restore original settings.