class_docstr: An MPL axis-like object that displays a 2D view of 3D volumes.
  
  Parameters
  ----------
  %(ax)s
  direction : {'x', 'y', 'z'}
      The directions of the view.
  
  coord : :obj:`float`
      The coordinate along the direction of the cut.
  %(radiological)s
class_docstr_tok: ["An","MPL","axis-like","object","that","displays","a","2D","view","of","3D","volumes",".","Parameters","--","--","--","--","--","%","(","ax",")","s","direction",":","{","'","x","'",",","'","y","'",",","'","z","'","}","The","directions","of","the","view",".","coord",":",":","obj",":","`","float","`","The","coordinate","along","the","direction","of","the","cut",".","%","(","radiological",")","s"]
docstr: Draw 2D.
docstr_tok: ["Draw","2D","."]
code: def draw_2d(
      self, data_2d, data_bounds, bounding_box, type="imshow", **kwargs
  ):
      """Draw 2D."""
      kwargs["origin"] = "upper"
  
      if self.direction == "y":
          (xmin, xmax), (_, _), (zmin, zmax) = data_bounds
          (xmin_, xmax_), (_, _), (zmin_, zmax_) = bounding_box
      elif self.direction in "xlr":
          (_, _), (xmin, xmax), (zmin, zmax) = data_bounds
          (_, _), (xmin_, xmax_), (zmin_, zmax_) = bounding_box
      elif self.direction == "z":
          (xmin, xmax), (zmin, zmax), (_, _) = data_bounds
          (xmin_, xmax_), (zmin_, zmax_), (_, _) = bounding_box
      else:
          raise ValueError(
              f"Invalid value for direction {self.direction}"
          )
      ax = self.ax
      # Here we need to do a copy to avoid having the image changing as
      # we change the data
      im = getattr(ax, type)(
          data_2d.copy(), extent=(xmin, xmax, zmin, zmax), **kwargs
      )
  
      self.add_object_bounds((xmin_, xmax_, zmin_, zmax_))
      self.shape = data_2d.T.shape
  
      # The bounds of the object do not take into account a possible
      # inversion of the axis. As such, we check that the axis is properly
      # inverted when direction is left
      if self.direction == "l" and not (
          ax.get_xlim()[0] > ax.get_xlim()[1]
      ):
          ax.invert_xaxis()
      return im
  
imports: import numbers
  import matplotlib.pyplot
  import numpy
  from matplotlib.colors import Normalize
  from matplotlib.font_manager import FontProperties
  from matplotlib.lines import Line2D
  from matplotlib.patches import FancyArrow
  from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
  from nilearn._utils.docs import fill_doc
  from nilearn.image import coord_transform
  from nilearn.plotting.glass_brain import plot_brain_schematics
label_desc: Use image node_id 4 for calling the BaseAxes obj's underlying member method code with example usage: obj.draw_2d(data_2d, data_bounds, bounding_box, type) and returns: im