class_docstr: A base class of GridSpec that specifies the geometry of the grid
  that a subplot will be placed.
class_docstr_tok: ["A","base","class","of","GridSpec","that","specifies","the","geometry","of","the","grid","that","a","subplot","will","be","placed","."]
docstr: Return the positions of the grid cells in figure coordinates.
  
  Parameters
  ----------
  fig : `~matplotlib.figure.Figure`
      The figure the grid should be applied to. The subplot parameters
      (margins and spacing between subplots) are taken from *fig*.
  
  Returns
  -------
  bottoms, tops, lefts, rights : array
      The bottom, top, left, right positions of the grid cells in
      figure coordinates.
code: def get_grid_positions(self, fig):
      """
      Return the positions of the grid cells in figure coordinates.
  
      Parameters
      ----------
      fig : `~matplotlib.figure.Figure`
          The figure the grid should be applied to. The subplot parameters
          (margins and spacing between subplots) are taken from *fig*.
  
      Returns
      -------
      bottoms, tops, lefts, rights : array
          The bottom, top, left, right positions of the grid cells in
          figure coordinates.
      """
      nrows, ncols = self.get_geometry()
      subplot_params = self.get_subplot_params(fig)
      left = subplot_params.left
      right = subplot_params.right
      bottom = subplot_params.bottom
      top = subplot_params.top
      wspace = subplot_params.wspace
      hspace = subplot_params.hspace
      tot_width = right - left
      tot_height = top - bottom
  
      # calculate accumulated heights of columns
      cell_h = tot_height / (nrows + hspace * (nrows - 1))
      sep_h = hspace * cell_h
      norm = cell_h * nrows / sum(self._row_height_ratios)
      cell_heights = [r * norm for r in self._row_height_ratios]
      sep_heights = [0] + ([sep_h] * (nrows - 1))
      cell_hs = np.cumsum(
          np.column_stack([sep_heights, cell_heights]).flat
      )
  
      # calculate accumulated widths of rows
      cell_w = tot_width / (ncols + wspace * (ncols - 1))
      sep_w = wspace * cell_w
      norm = cell_w * ncols / sum(self._col_width_ratios)
      cell_widths = [r * norm for r in self._col_width_ratios]
      sep_widths = [0] + ([sep_w] * (ncols - 1))
      cell_ws = np.cumsum(
          np.column_stack([sep_widths, cell_widths]).flat
      )
  
      fig_tops, fig_bottoms = (top - cell_hs).reshape((-1, 2)).T
      fig_lefts, fig_rights = (left + cell_ws).reshape((-1, 2)).T
      return fig_bottoms, fig_tops, fig_lefts, fig_rights
  
imports: import copy
  import logging
  from numbers import Integral
  import numpy
  import matplotlib
  from matplotlib import _api, _pylab_helpers, _tight_layout
  from matplotlib.transforms import Bbox
label_desc: Use image node_id 10 for calling the GridSpecBase obj's underlying member method code with example usage: obj.get_grid_positions(fig) and returns: fig_bottoms,  fig_tops,  fig_lefts,  fig_rights