class_docstr: A class that creates a grid of Axes. In matplotlib, the axes
  location (and size) is specified in the normalized figure
  coordinates. This may not be ideal for images that needs to be
  displayed with a given aspect ratio.  For example, displaying
  images of a same size with some fixed padding between them cannot
  be easily done in matplotlib. ImageGrid is used in such case.
code: def _update_locators(self):
      h = []
      v = []
  
      h_ax_pos = []
      h_cb_pos = []
      if (
          self._colorbar_mode == "single"
          and self._colorbar_location in ("left", "bottom")
      ):
          if self._colorbar_location == "left":
              # sz = Size.Fraction(Size.AxesX(self.axes_llc), self._nrows)
              sz = Size.Fraction(self._nrows, Size.AxesX(self.axes_llc))
              h.append(Size.from_any(self._colorbar_size, sz))
              h.append(Size.from_any(self._colorbar_pad, sz))
              locator = self._divider.new_locator(nx=0, ny=0, ny1=-1)
          elif self._colorbar_location == "bottom":
              # sz = Size.Fraction(Size.AxesY(self.axes_llc), self._ncols)
              sz = Size.Fraction(self._ncols, Size.AxesY(self.axes_llc))
              v.append(Size.from_any(self._colorbar_size, sz))
              v.append(Size.from_any(self._colorbar_pad, sz))
              locator = self._divider.new_locator(nx=0, nx1=-1, ny=0)
          for i in range(self.ngrids):
              self.cbar_axes[i].set_visible(False)
          self.cbar_axes[0].set_axes_locator(locator)
          self.cbar_axes[0].set_visible(True)
  
      for col, ax in enumerate(self.axes_row[0]):
          if h:
              h.append(
                  self._horiz_pad_size
              )  # Size.Fixed(self._axes_pad))
  
          if ax:
              sz = Size.AxesX(
                  ax, aspect="axes", ref_ax=self.axes_all[0]
              )
          else:
              sz = Size.AxesX(
                  self.axes_all[0],
                  aspect="axes",
                  ref_ax=self.axes_all[0],
              )
  
          if (
              self._colorbar_mode == "each"
              or (self._colorbar_mode == "edge" and col == 0)
          ) and self._colorbar_location == "left":
              h_cb_pos.append(len(h))
              h.append(Size.from_any(self._colorbar_size, sz))
              h.append(Size.from_any(self._colorbar_pad, sz))
  
          h_ax_pos.append(len(h))
  
          h.append(sz)
  
          if (
              self._colorbar_mode == "each"
              or (
                  self._colorbar_mode == "edge"
                  and col == self._ncols - 1
              )
          ) and self._colorbar_location == "right":
              h.append(Size.from_any(self._colorbar_pad, sz))
              h_cb_pos.append(len(h))
              h.append(Size.from_any(self._colorbar_size, sz))
  
      v_ax_pos = []
      v_cb_pos = []
      for row, ax in enumerate(self.axes_column[0][::-1]):
          if v:
              v.append(
                  self._vert_pad_size
              )  # Size.Fixed(self._axes_pad))
  
          if ax:
              sz = Size.AxesY(
                  ax, aspect="axes", ref_ax=self.axes_all[0]
              )
          else:
              sz = Size.AxesY(
                  self.axes_all[0],
                  aspect="axes",
                  ref_ax=self.axes_all[0],
              )
  
          if (
              self._colorbar_mode == "each"
              or (self._colorbar_mode == "edge" and row == 0)
          ) and self._colorbar_location == "bottom":
              v_cb_pos.append(len(v))
              v.append(Size.from_any(self._colorbar_size, sz))
              v.append(Size.from_any(self._colorbar_pad, sz))
  
          v_ax_pos.append(len(v))
          v.append(sz)
  
          if (
              self._colorbar_mode == "each"
              or (
                  self._colorbar_mode == "edge"
                  and row == self._nrows - 1
              )
          ) and self._colorbar_location == "top":
              v.append(Size.from_any(self._colorbar_pad, sz))
              v_cb_pos.append(len(v))
              v.append(Size.from_any(self._colorbar_size, sz))
  
      for i in range(self.ngrids):
          col, row = self._get_col_row(i)
          # locator = self._divider.new_locator(nx=4*col,
          #                                    ny=2*(self._nrows - row - 1))
          locator = self._divider.new_locator(
              nx=h_ax_pos[col], ny=v_ax_pos[self._nrows - 1 - row]
          )
          self.axes_all[i].set_axes_locator(locator)
  
          if self._colorbar_mode == "each":
              if self._colorbar_location in ("right", "left"):
                  locator = self._divider.new_locator(
                      nx=h_cb_pos[col],
                      ny=v_ax_pos[self._nrows - 1 - row],
                  )
  
              elif self._colorbar_location in ("top", "bottom"):
                  locator = self._divider.new_locator(
                      nx=h_ax_pos[col],
                      ny=v_cb_pos[self._nrows - 1 - row],
                  )
  
              self.cbar_axes[i].set_axes_locator(locator)
          elif self._colorbar_mode == "edge":
              if (self._colorbar_location == "left" and col == 0) or (
                  self._colorbar_location == "right"
                  and col == self._ncols - 1
              ):
                  locator = self._divider.new_locator(
                      nx=h_cb_pos[0], ny=v_ax_pos[self._nrows - 1 - row]
                  )
                  self.cbar_axes[row].set_axes_locator(locator)
              elif (
                  self._colorbar_location == "bottom"
                  and row == self._nrows - 1
              ) or (self._colorbar_location == "top" and row == 0):
                  locator = self._divider.new_locator(
                      nx=h_ax_pos[col], ny=v_cb_pos[0]
                  )
                  self.cbar_axes[col].set_axes_locator(locator)
  
      if self._colorbar_mode == "single":
          if self._colorbar_location == "right":
              # sz = Size.Fraction(Size.AxesX(self.axes_llc), self._nrows)
              sz = Size.Fraction(self._nrows, Size.AxesX(self.axes_llc))
              h.append(Size.from_any(self._colorbar_pad, sz))
              h.append(Size.from_any(self._colorbar_size, sz))
              locator = self._divider.new_locator(nx=-2, ny=0, ny1=-1)
          elif self._colorbar_location == "top":
              # sz = Size.Fraction(Size.AxesY(self.axes_llc), self._ncols)
              sz = Size.Fraction(self._ncols, Size.AxesY(self.axes_llc))
              v.append(Size.from_any(self._colorbar_pad, sz))
              v.append(Size.from_any(self._colorbar_size, sz))
              locator = self._divider.new_locator(nx=0, nx1=-1, ny=-2)
          if self._colorbar_location in ("right", "top"):
              for i in range(self.ngrids):
                  self.cbar_axes[i].set_visible(False)
              self.cbar_axes[0].set_axes_locator(locator)
              self.cbar_axes[0].set_visible(True)
      elif self._colorbar_mode == "each":
          for i in range(self.ngrids):
              self.cbar_axes[i].set_visible(True)
      elif self._colorbar_mode == "edge":
          if self._colorbar_location in ("right", "left"):
              count = self._nrows
          else:
              count = self._ncols
          for i in range(count):
              self.cbar_axes[i].set_visible(True)
          for j in range(i + 1, self.ngrids):
              self.cbar_axes[j].set_visible(False)
      else:
          for i in range(self.ngrids):
              self.cbar_axes[i].set_visible(False)
              self.cbar_axes[i].set_position(
                  [1.0, 1.0, 0.001, 0.001], which="active"
              )
  
      self._divider.set_horizontal(h)
      self._divider.set_vertical(v)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import matplotlib.axes
  import matplotlib.cbook
  import matplotlib.ticker
  from matplotlib.gridspec import SubplotSpec
  from .axes_divider import Size, SubplotDivider, LocatableAxes, Divider
  from .colorbar import Colorbar
label_desc: Use image node_id 2 for calling the ImageGrid obj's underlying member method code with example usage: obj._update_locators() without return types