neurom.view.matplotlib_impl

Morphology draw functions using matplotlib.

Functions

plot_dendrogram(obj[, ax, show_diameters])

Plots Dendrogram of obj.

plot_morph(morph[, ax, neurite_type, plane, ...])

Plots a 2D figure of the morphology, that contains a soma and the neurites.

plot_morph3d(morph[, ax, neurite_type, ...])

Generates a figure of the morphology, that contains a soma and a list of trees.

plot_soma(soma[, ax, plane, soma_outline, ...])

Generates a 2d figure of the soma.

plot_soma3d(soma[, ax, color, alpha])

Generates a 3d figure of the soma.

plot_tree(tree[, ax, plane, diameter_scale, ...])

Plots a 2d figure of the tree's segments.

plot_tree3d(tree[, ax, diameter_scale, ...])

Generates a figure of the tree in 3d.

neurom.view.matplotlib_impl.plot_dendrogram(obj, ax=None, show_diameters=True)

Plots Dendrogram of obj.

Parameters:
  • obj (Morphology, Section) – morphology or section

  • ax – on what matplotlib axes to plot

  • show_diameters (bool) – whether to show node diameters or not

neurom.view.matplotlib_impl.plot_morph(morph, ax=None, neurite_type=NeuriteType.all, plane='xy', soma_outline=True, diameter_scale=1.0, linewidth=1.2, color=None, alpha=0.8, realistic_diameters=False)

Plots a 2D figure of the morphology, that contains a soma and the neurites.

Parameters:
  • neurite_type (NeuriteType|tuple) – an optional filter on the neurite type

  • ax – on what matplotlib axes to plot

  • morph (Morphology) – morphology to be plotted

  • soma_outline (bool) – should the soma be drawn as an outline

  • plane (str) – Any pair of ‘xyz’

  • diameter_scale (float) – Scale factor multiplied with segment diameters before plotting

  • linewidth (float) – all segments are plotted with this width, but only if diameter_scale=None

  • color (str or None) – Color of plotted values, None corresponds to default choice

  • alpha (float) – Transparency of plotted values

  • realistic_diameters (bool) – scale linewidths with axis data coordinates

neurom.view.matplotlib_impl.plot_morph3d(morph, ax=None, neurite_type=NeuriteType.all, diameter_scale=1.0, linewidth=1.2, color=None, alpha=0.8)

Generates a figure of the morphology, that contains a soma and a list of trees.

Parameters:
  • morph (Morphology) – morphology to be plotted

  • ax – on what matplotlib axes to plot

  • neurite_type (NeuriteType) – an optional filter on the neurite type

  • diameter_scale (float) – Scale factor multiplied with segment diameters before plotting

  • linewidth (float) – all segments are plotted with this width, but only if diameter_scale=None

  • color (str or None) – Color of plotted values, None corresponds to default choice

  • alpha (float) – Transparency of plotted values

neurom.view.matplotlib_impl.plot_soma(soma, ax=None, plane='xy', soma_outline=True, linewidth=1.2, color=None, alpha=0.8)

Generates a 2d figure of the soma.

Parameters:
  • soma (Soma) – plotted soma

  • ax – on what matplotlib axes to plot

  • plane (str) – Any pair of ‘xyz’

  • soma_outline (bool) – should the soma be drawn as an outline

  • linewidth (float) – all segments are plotted with this width, but only if diameter_scale=None

  • color (str or None) – Color of plotted values, None corresponds to default choice

  • alpha (float) – Transparency of plotted values

neurom.view.matplotlib_impl.plot_soma3d(soma, ax=None, color=None, alpha=0.8)

Generates a 3d figure of the soma.

Parameters:
  • soma (Soma) – plotted soma

  • ax – on what matplotlib axes to plot

  • color (str or None) – Color of plotted values, None corresponds to default choice

  • alpha (float) – Transparency of plotted values

neurom.view.matplotlib_impl.plot_tree(tree, ax=None, plane='xy', diameter_scale=1.0, linewidth=1.2, color=None, alpha=0.8, realistic_diameters=False)

Plots a 2d figure of the tree’s segments.

Parameters:
  • tree (Section or Neurite) – plotted tree

  • ax – on what matplotlib axes to plot

  • plane (str) – Any pair of ‘xyz’

  • diameter_scale (float) – Scale factor multiplied with segment diameters before plotting

  • linewidth (float) – all segments are plotted with this width, but only if diameter_scale=None

  • color (str or None) – Color of plotted values, None corresponds to default choice

  • alpha (float) – Transparency of plotted values

  • realistic_diameters (bool) – scale linewidths with axis data coordinates

Note

If the tree contains one single point the plot will be empty since no segments can be constructed.

neurom.view.matplotlib_impl.plot_tree3d(tree, ax=None, diameter_scale=1.0, linewidth=1.2, color=None, alpha=0.8)

Generates a figure of the tree in 3d.

If the tree contains one single point the plot will be empty since no segments can be constructed.

Parameters:
  • tree (Section or Neurite) – plotted tree

  • ax – on what matplotlib axes to plot

  • diameter_scale (float) – Scale factor multiplied with segment diameters before plotting

  • linewidth (float) – all segments are plotted with this width, but only if diameter_scale=None

  • color (str or None) – Color of plotted values, None corresponds to default choice

  • alpha (float) – Transparency of plotted values