class_docstr: Plot3D provides a common baseclass for mplot3d based
  plots.
class_docstr_tok: ["Plot3D","provides","a","common","baseclass","for","mplot3d","based","plots","."]
code: def _draw_colorbar(self, element=None, dim=None, redraw=True):
      if element is None:
          element = self.hmap.last
      artist = self.handles.get("artist", None)
  
      fig = self.handles["fig"]
      ax = self.handles["axis"]
      # Get colorbar label
      if isinstance(dim, dim_expr):
          dim = dim.dimension
      if dim is None:
          if hasattr(self, "color_index"):
              dim = element.get_dimension(self.color_index)
          else:
              dim = element.get_dimension(2)
      elif not isinstance(dim, Dimension):
          dim = element.get_dimension(dim)
      label = dim.pprint_label
      cbar = fig.colorbar(artist, shrink=0.7, ax=ax)
      self.handles["cbar"] = cbar
      self.handles["cax"] = cbar.ax
      self._adjust_cbar(cbar, label, dim)
  
imports: import numpy
  import param
  from matplotlib import cm
  from mpl_toolkits.mplot3d.art3d import Line3DCollection
  from packaging.version import Version
  from ...core import Dimension
  from ...core.options import abbreviated_exception
  from ...util.transform import dim
  from ..util import map_colors
  from .chart import PointPlot
  from .element import ColorbarPlot
  from .path import PathPlot
  from .util import mpl_version
label_desc: Use image node_id 2 for calling the Plot3D obj's underlying member method code with example usage: obj._draw_colorbar(element, dim, redraw) without return types