class_docstr: A grid layout to place subplots within a figure.
  
  The location of the grid cells is determined in a similar way to
  `.SubplotParams` using *left*, *right*, *top*, *bottom*, *wspace*
  and *hspace*.
  
  Indexing a GridSpec instance returns a `.SubplotSpec`.
class_docstr_tok: ["A","grid","layout","to","place","subplots","within","a","figure",".","The","location","of","the","grid","cells","is","determined","in","a","similar","way","to","`",".SubplotParams","`","using","*","left","*",",","*","right","*",",","*","top","*",",","*","bottom","*",",","*","wspace","*","and","*","hspace","*",".","Indexing","a","GridSpec","instance","returns","a","`",".SubplotSpec","`","."]
docstr: Return the `.SubplotParams` for the GridSpec.
  
  In order of precedence the values are taken from
  
  - non-*None* attributes of the GridSpec
  - the provided *figure*
  - :rc:`figure.subplot.*`
  
  Note that the ``figure`` attribute of the GridSpec is always ignored.
code: def get_subplot_params(self, figure=None):
      """
      Return the `.SubplotParams` for the GridSpec.
  
      In order of precedence the values are taken from
  
      - non-*None* attributes of the GridSpec
      - the provided *figure*
      - :rc:`figure.subplot.*`
  
      Note that the ``figure`` attribute of the GridSpec is always ignored.
      """
      if figure is None:
          kw = {
              k: mpl.rcParams["figure.subplot." + k]
              for k in self._AllowedKeys
          }
          subplotpars = SubplotParams(**kw)
      else:
          subplotpars = copy.copy(figure.subplotpars)
  
      subplotpars.update(
          **{k: getattr(self, k) for k in self._AllowedKeys}
      )
  
      return subplotpars
  
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 3 for calling the GridSpec obj's underlying member method code with example usage: obj.get_subplot_params(figure) and returns: subplotpars