braincell.vis.publication_theme#
- braincell.vis.publication_theme(preset=None, *, rc_overrides=None)[source]#
Activate the
PublicationThemefor the duration of a block.On entry this context manager applies the preset’s branch colours and alphas to
_VIS_DEFAULTSand patches matplotlib’srcParamswith the preset’s styling block. On exit both are restored, even if the body raised.- Parameters:
- Yields:
VisDefaults – A snapshot of the vis defaults active inside the block.
Notes
The matplotlib patch goes through
matplotlib.rcParams.update()and is restored from the original values — this is the same mechanismplt.rc_context()uses internally, but scoped to the keys the preset actually sets so unrelated rc state is left alone.