docs: def draw(obj, mode='2d', **kwargs):
      '''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')
  
      '''
  
      if mode not in MODES:
          raise InvalidDrawModeError('Invalid drawing mode %s' % mode)
  
      if mode in ('2d', 'dendrogram'):
          fig, ax = common.get_figure()
      else:
          fig, ax = common.get_figure(params={'projection': '3d'})
  
      if isinstance(obj, Neuron):
          tag = 'neuron'
      elif isinstance(obj, (Tree, Neurite)):
          tag = 'tree'
      elif isinstance(obj, Soma):
          tag = 'soma'
      else:
          raise NotDrawableError('draw not implemented for %s' % obj.__class__)
  
      viewer = '%s_%s' % (tag, mode)
      try:
          plotter = _VIEWERS[viewer]
      except KeyError:
          raise NotDrawableError('No drawer for class %s, mode=%s' % (obj.__class__, mode))
  
      output_path = kwargs.pop('output_path', None)
      plotter(ax, obj, **kwargs)
  
      if mode != 'dendrogram':
          common.plot_style(fig=fig, ax=ax, **kwargs)
  
      if output_path:
          common.save_plot(fig=fig, output_path=output_path, **kwargs)
  
      return fig, ax