neurom.viewer.draw

neurom.viewer.draw(obj, mode='2d', **kwargs)[source]

Draw a morphology object

Parameters:
  • obj – morphology object to be drawn (neuron, tree, soma).
  • mode (Optional[str]) – drawing mode (‘2d’, ‘3d’, ‘dendrogram’). Defaults to ‘2d’.
  • **kwargs – keyword arguments for underlying neurom.view.view functions.
Raises:
  • InvalidDrawModeError if mode is not valid
  • NotDrawableError if obj is not drawable
  • NotDrawableError if obj type and mode combination is not drawable

Examples

>>> nrn = ... # load a neuron
>>> fig, _ = viewer.draw(nrn)             # 2d plot
>>> fig.show()
>>> fig3d, _ = viewer.draw(nrn, mode='3d') # 3d plot
>>> fig3d.show()
>>> fig, _ = viewer.draw(nrn.neurites[0]) # 2d plot of neurite tree
>>> dend, _ = viewer.draw(nrn, mode='dendrogram')