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: The number of rows and number of columns of the grid need to
  be set. An instance of SubplotSpec is also needed to be set
  from which the layout parameters will be inherited. The wspace
  and hspace of the layout can be optionally specified or the
  default values (from the figure or rcParams) will be used.
docstr_tok: ["The","number","of","rows","and","number","of","columns","of","the","grid","need","to","be","set",".","An","instance","of","SubplotSpec","is","also","needed","to","be","set","from","which","the","layout","parameters","will","be","inherited",".","The","wspace","and","hspace","of","the","layout","can","be","optionally","specified","or","the","default","values","(","from","the","figure","or","rcParams",")","will","be","used","."]
code: def __init__(
      self,
      nrows,
      ncols,
      subplot_spec,
      wspace=None,
      hspace=None,
      height_ratios=None,
      width_ratios=None,
  ):
      """
      The number of rows and number of columns of the grid need to
      be set. An instance of SubplotSpec is also needed to be set
      from which the layout parameters will be inherited. The wspace
      and hspace of the layout can be optionally specified or the
      default values (from the figure or rcParams) will be used.
      """
      self._wspace = wspace
      self._hspace = hspace
      self._subplot_spec = subplot_spec
      GridSpecBase.__init__(
          self,
          nrows,
          ncols,
          width_ratios=width_ratios,
          height_ratios=height_ratios,
      )
      # do the layoutboxes
      subspeclb = subplot_spec._layoutbox
      if subspeclb is None:
          self._layoutbox = None
      else:
          # OK, this is needed to divide the figure.
          self._layoutbox = subspeclb.layout_from_subplotspec(
              subplot_spec,
              name=subspeclb.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 GridSpecFromSubplotSpec object from inherited base classes: GridSpecBase with example: obj = GridSpecFromSubplotSpec(nrows, ncols, subplot_spec, wspace, hspace, height_ratios, width_ratios)