braincell.vis.plot_traces#
- braincell.vis.plot_traces(morpho, time, values_over_time, *, locset=None, labels=None, colors=None, cmap='tab10', layout=None, shape=None, time_unit_label=None, value_unit_label=None, figsize=None, sharex=True, show_morphology=True)[source]#
Plot time-series traces at selected morphology locations.
- Parameters:
morpho (
Morphology) – Source morphology. Used for both the left-hand morphology view (whenshow_morphology=True) and to validate that the number of traces matches the number of locset points.time (ArrayLike) – 1-D array of timestamps with length
T. Units are stripped viabrainunitfor plotting; if no unit is available the axis label is left blank unless time_unit_label is given.values_over_time (ArrayLike) –
(T, n_locations)matrix of trace samples.n_locationsmust equal eitherlen(locset.points)(if locset is supplied) or the number of columns of the array (otherwise).locset (
LocsetMask|None) – Evaluated locset; each point becomes a marker on the morphology and a matching trace panel on the right.labels (
Sequence[str] |None) – Optional labels per trace. WhenNone, panels are labelledLoc 0,Loc 1, ….colors (
Sequence|None) – Optional explicit per-trace colours (any matplotlib colour spec). WhenNone, colours are drawn from cmap.cmap (
str) – Matplotlib colormap name used to auto-colour traces when colors isNone.layout (
str|None) – Layout / shape parameters forwarded toplot2d()for the morphology panel.shape (
str|None) – Layout / shape parameters forwarded toplot2d()for the morphology panel.time_unit_label (
str|None) – Axis-label unit strings. These override any brainunit units attached to time / values_over_time.value_unit_label (
str|None) – Axis-label unit strings. These override any brainunit units attached to time / values_over_time.figsize (
tuple[float,float] |None) – Figure size. WhenNone, defaults to(10, 2 * n_locations).sharex (
bool) – IfTrue(default), all trace panels share the time axis.show_morphology (
bool) – IfFalse, no morphology view is drawn and only the trace stack is returned.
- Returns:
Figure, morphology axes (
Nonewhen the view is hidden), and the tuple of trace axes.- Return type:
TracesResult- Raises:
ValueError – If the column count of values_over_time does not match the number of sampled locations.