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: Parameters
  ----------
  nrows, ncols : int
      The number of rows and columns of the grid.
  width_ratios : array-like of length *ncols*, optional
      Defines the relative widths of the columns. Each column gets a
      relative width of ``width_ratios[i] / sum(width_ratios)``.
      If not given, all columns will have the same width.
  height_ratios : array-like of length *nrows*, optional
      Defines the relative heights of the rows. Each row gets a
      relative height of ``height_ratios[i] / sum(height_ratios)``.
      If not given, all rows will have the same height.
code: def __init__(
      self, nrows, ncols, height_ratios=None, width_ratios=None
  ):
      """
      Parameters
      ----------
      nrows, ncols : int
          The number of rows and columns of the grid.
      width_ratios : array-like of length *ncols*, optional
          Defines the relative widths of the columns. Each column gets a
          relative width of ``width_ratios[i] / sum(width_ratios)``.
          If not given, all columns will have the same width.
      height_ratios : array-like of length *nrows*, optional
          Defines the relative heights of the rows. Each row gets a
          relative height of ``height_ratios[i] / sum(height_ratios)``.
          If not given, all rows will have the same height.
      """
      if not isinstance(nrows, Integral) or nrows <= 0:
          raise ValueError(
              f"Number of rows must be a positive integer, not {nrows!r}"
          )
      if not isinstance(ncols, Integral) or ncols <= 0:
          raise ValueError(
              f"Number of columns must be a positive integer, not {ncols!r}"
          )
      self._nrows, self._ncols = nrows, ncols
      self.set_height_ratios(height_ratios)
      self.set_width_ratios(width_ratios)
  
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 1 to create a new GridSpecBase object  with example: obj = GridSpecBase(nrows, ncols, height_ratios, width_ratios)