class_docstr: GridSpec whose subplot layout parameters are inherited from the
  location specified by a given SubplotSpec.
class_docstr_tok: ["GridSpec","whose","subplot","layout","parameters","are","inherited","from","the","location","specified","by","a","given","SubplotSpec","."]
docstr: Return a dictionary of subplot layout parameters.
          
docstr_tok: ["Return","a","dictionary","of","subplot","layout","parameters","."]
code: def get_subplot_params(self, figure=None, fig=None):
      """Return a dictionary of subplot layout parameters."""
      if fig is not None:
          warnings.warn(
              "the 'fig' kwarg is deprecated " "use 'figure' instead",
              mplDeprecation,
          )
      if figure is None:
          figure = fig
  
      hspace = (
          self._hspace
          if self._hspace is not None
          else figure.subplotpars.hspace
          if figure is not None
          else rcParams["figure.subplot.hspace"]
      )
      wspace = (
          self._wspace
          if self._wspace is not None
          else figure.subplotpars.wspace
          if figure is not None
          else rcParams["figure.subplot.wspace"]
      )
  
      figbox = self._subplot_spec.get_position(figure)
      left, bottom, right, top = figbox.extents
  
      return mpl.figure.SubplotParams(
          left=left,
          right=right,
          bottom=bottom,
          top=top,
          wspace=wspace,
          hspace=hspace,
      )
  
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 2 for calling the GridSpecFromSubplotSpec obj's underlying member method code with example usage: obj.get_subplot_params(figure, fig) and returns: mpl