PublicationTheme

Contents

PublicationTheme#

class braincell.vis.PublicationTheme(branch_type_colors=<factory>, branch_type_edge_colors_2d=None, rc_params=<factory>, alpha_2d=0.7, frustum_edge_linewidth_2d=0.9, alpha_3d_tube=1.0)[source]#

Publication-quality styling preset for braincell.vis.

Bundles a VisDefaults diff (serif-friendly branch colours, thicker strokes) with a matplotlib rcParams block so a single context manager flips both at once.

Parameters:
  • branch_type_colors (dict[str, tuple[int, int, int]]) – Branch-type colour overrides shared by 2D and 3D. Defaults to PUBLICATION_BRANCH_TYPE_COLORS.

  • branch_type_edge_colors_2d (dict[str, tuple[int, int, int]] | None) – Optional 2D frustum border colour overrides. When None, border colours are derived automatically from the fill colours.

  • rc_params (dict[str, object]) – Matplotlib rcParams applied inside the theme. Defaults to PUBLICATION_RC_PARAMS.

  • alpha_2d (float) – Shared 2D opacity used by both line and frustum rendering.

  • frustum_edge_linewidth_2d (float) – Border linewidth used by 2D frustum rendering.

  • alpha_3d_tube (float) – Tube alpha used by the 3D backend. Defaults to 1.0.

Examples

>>> from braincell.vis import publication_theme, plot2d
>>> with publication_theme():
...     plot2d(tree, layout='stem')