ValueSpec#
- class braincell.vis.ValueSpec(values, cmap='viridis', vmin=None, vmax=None, norm=None, label=None, unit_label=None, show_colorbar=True)[source]#
Styling parameters for a color-by-values overlay.
- Parameters:
values (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) –Per-element scalar array. The number of elements is interpreted against the morphology:
n_branches— one scalar per branch (the whole branch is shaded with that single colour);total segment count — one scalar per segment (matplotlib
LineCollection/PolyCollectionuses the corresponding per-segment colour);total centerline-point count (
segments + branches) — one scalar per polyline point (used directly aspolydata.point_data).
Values may carry
brainunitunits; the units are used to generate a default colourbar label whenunit_labelis unset.cmap (
str) – Matplotlib colormap name, forwarded tomatplotlib.cm.ScalarMappableand PyVistaadd_mesh.vmin (
float|None) – Fixed colour-scale bounds. When either isNonethe missing bound is derived from the data range.vmax (
float|None) – Fixed colour-scale bounds. When either isNonethe missing bound is derived from the data range.norm (
Any|None) – Optional matplotlibNormalize-compatible object. Takes precedence over vmin/vmax for the 2D backend.label (
str|None) – Colourbar title. WhenNoneno title is drawn.unit_label (
str|None) – Optional unit string appended to label on the colourbar.show_colorbar (
bool) – Whether to render a colourbar alongside the scene (matplotlib only; PyVista always draws its own scalar bar when scalars are present).