class_docstr: A class that specifies the geometry of the grid that a subplot
  will be placed. The location of grid is determined by similar way
  as the SubplotParams.
class_docstr_tok: ["A","class","that","specifies","the","geometry","of","the","grid","that","a","subplot","will","be","placed",".","The","location","of","grid","is","determined","by","similar","way","as","the","SubplotParams","."]
docstr: The number of rows and number of columns of the grid need to be set.
  Optionally, the subplot layout parameters (e.g., left, right, etc.)
  can be tuned.
  
  Parameters
  ----------
  nrows : int
      Number of rows in grid.
  
  ncols : int
      Number or columns in grid.
  
  Notes
  -----
  See `~.figure.SubplotParams` for descriptions of the layout parameters.
docstr_tok: ["The","number","of","rows","and","number","of","columns","of","the","grid","need","to","be","set",".","Optionally",",","the","subplot","layout","parameters","(","e.g.",",","left",",","right",",","etc",".",")","can","be","tuned",".","Parameters","--","--","--","--","--","nrows",":","int","Number","of","rows","in","grid",".","ncols",":","int","Number","or","columns","in","grid",".","Notes","--","--","-","See","`","~.figure.SubplotParams","`","for","descriptions","of","the","layout","parameters","."]
code: def __init__(
      self,
      nrows,
      ncols,
      figure=None,
      left=None,
      bottom=None,
      right=None,
      top=None,
      wspace=None,
      hspace=None,
      width_ratios=None,
      height_ratios=None,
  ):
      """
      The number of rows and number of columns of the grid need to be set.
      Optionally, the subplot layout parameters (e.g., left, right, etc.)
      can be tuned.
  
      Parameters
      ----------
      nrows : int
          Number of rows in grid.
  
      ncols : int
          Number or columns in grid.
  
      Notes
      -----
      See `~.figure.SubplotParams` for descriptions of the layout parameters.
      """
      self.left = left
      self.bottom = bottom
      self.right = right
      self.top = top
      self.wspace = wspace
      self.hspace = hspace
      self.figure = figure
  
      GridSpecBase.__init__(
          self,
          nrows,
          ncols,
          width_ratios=width_ratios,
          height_ratios=height_ratios,
      )
  
      if (
          self.figure is None
      ) or not self.figure.get_constrained_layout():
          self._layoutbox = None
      else:
          self.figure.init_layoutbox()
          self._layoutbox = layoutbox.LayoutBox(
              parent=self.figure._layoutbox,
              name="gridspec" + layoutbox.seq_id(),
              artist=self,
          )
  
imports: from __future__ import absolute_import, division, print_function
  import six
  import copy
  import logging
  import warnings
  import numpy
  import matplotlib
  from matplotlib import _pylab_helpers, tight_layout, rcParams
  from matplotlib.transforms import Bbox
  import matplotlib._layoutbox
  from matplotlib.cbook import mplDeprecation
label_desc: Use image node_id 1 to create a new GridSpec object from inherited base classes: GridSpecBase with example: obj = GridSpec(nrows, ncols, figure, left, bottom, right, top, wspace, hspace, width_ratios, height_ratios)