braincell.vis.compare_morphologies

braincell.vis.compare_morphologies#

braincell.vis.compare_morphologies(morphologies, *, titles=None, layout=None, shape=None, align='soma', figsize=None, min_branch_angle_deg=25.0, root_layout='type_split', layout_config=None)[source]#

Render several morphologies side by side with a shared layout.

Parameters:
  • morphologies (Sequence[Any]) – Morphologies to compare. Order left → right matches panel order. Must contain at least one element.

  • titles (Sequence[str] | None) – Optional panel titles; defaults to morpho.name (or "morpho_{i}" for unnamed trees).

  • layout (str | None) – Layout family passed to plot2d() for every panel.

  • shape (str | None) – "line" or "frustum", forwarded to plot2d().

  • align (str | None) – Origin alignment hint. Currently informational — the per-morphology layout engine always roots at the soma — but recorded on the axes title so scripts can cross-reference a stated alignment policy.

  • figsize (tuple[float, float] | None) – Figure size. Defaults to (4.5 * n_panels, 4.5).

  • min_branch_angle_deg (float | None) – Forwarded verbatim to plot2d().

  • root_layout (str) – Forwarded verbatim to plot2d().

  • layout_config (LayoutConfig | None) – Forwarded verbatim to plot2d().

Returns:

figure, axes – The composed figure and a tuple of the panel axes, left to right.

Return type:

tuple[object, tuple[object, ...]]

Raises:

ValueError – If morphologies is empty.

Notes

All panels share data-space aspect ratio through plot2d() (each call invokes ax.set_aspect('equal')); the wrapper does not synchronise axis limits across panels because morphologies with different footprints would then be rendered at different scales.