class_docstr: Implements the ``constrained_layout`` geometry management.  See
  :ref:`constrainedlayout_guide` for details.
class_docstr_tok: ["Implements","the","``","constrained_layout","``","geometry","management",".","See",":","ref",":","`","constrainedlayout_guide","`","for","details","."]
docstr: Initialize ``constrained_layout`` settings.
  
  Parameters
  ----------
  h_pad, w_pad : float
      Padding around the Axes elements in inches.
      Default to :rc:`figure.constrained_layout.h_pad` and
      :rc:`figure.constrained_layout.w_pad`.
  hspace, wspace : float
      Fraction of the figure to dedicate to space between the
      axes.  These are evenly spread between the gaps between the Axes.
      A value of 0.2 for a three-column layout would have a space
      of 0.1 of the figure width between each column.
      If h/wspace < h/w_pad, then the pads are used instead.
      Default to :rc:`figure.constrained_layout.hspace` and
      :rc:`figure.constrained_layout.wspace`.
  rect : tuple of 4 floats
      Rectangle in figure coordinates to perform constrained layout in
      (left, bottom, width, height), each from 0-1.
  compress : bool
      Whether to shift Axes so that white space in between them is
      removed. This is useful for simple grids of fixed-aspect Axes (e.g.
      a grid of images).  See :ref:`compressed_layout`.
docstr_tok: ["Initialize","``","constrained_layout","``","settings",".","Parameters","--","--","--","--","--","h_pad",",","w_pad",":","float","Padding","around","the","Axes","elements","in","inches",".","Default","to",":","rc",":","`","figure.constrained_layout.h_pad","`","and",":","rc",":","`","figure.constrained_layout.w_pad","`",".","hspace",",","wspace",":","float","Fraction","of","the","figure","to","dedicate","to","space","between","the","axes",".","These","are","evenly","spread","between","the","gaps","between","the","Axes",".","A","value","of","0.2","for","a","three-column","layout","would","have","a","space","of","0.1","of","the","figure","width","between","each","column",".","If","h\/wspace","<","h\/w_pad",",","then","the","pads","are","used","instead",".","Default","to",":","rc",":","`","figure.constrained_layout.hspace","`","and",":","rc",":","`","figure.constrained_layout.wspace","`",".","rect",":","tuple","of","4","floats","Rectangle","in","figure","coordinates","to","perform","constrained","layout","in","(","left",",","bottom",",","width",",","height",")",",","each","from","0-1.","compress",":","bool","Whether","to","shift","Axes","so","that","white","space","in","between","them","is","removed",".","This","is","useful","for","simple","grids","of","fixed-aspect","Axes","(","e.g",".","a","grid","of","images",")",".","See",":","ref",":","`","compressed_layout","`","."]
code: def __init__(
      self,
      *,
      h_pad=None,
      w_pad=None,
      hspace=None,
      wspace=None,
      rect=(0, 0, 1, 1),
      compress=False,
      **kwargs,
  ):
      """
      Initialize ``constrained_layout`` settings.
  
      Parameters
      ----------
      h_pad, w_pad : float
          Padding around the Axes elements in inches.
          Default to :rc:`figure.constrained_layout.h_pad` and
          :rc:`figure.constrained_layout.w_pad`.
      hspace, wspace : float
          Fraction of the figure to dedicate to space between the
          axes.  These are evenly spread between the gaps between the Axes.
          A value of 0.2 for a three-column layout would have a space
          of 0.1 of the figure width between each column.
          If h/wspace < h/w_pad, then the pads are used instead.
          Default to :rc:`figure.constrained_layout.hspace` and
          :rc:`figure.constrained_layout.wspace`.
      rect : tuple of 4 floats
          Rectangle in figure coordinates to perform constrained layout in
          (left, bottom, width, height), each from 0-1.
      compress : bool
          Whether to shift Axes so that white space in between them is
          removed. This is useful for simple grids of fixed-aspect Axes (e.g.
          a grid of images).  See :ref:`compressed_layout`.
      """
      super().__init__(**kwargs)
      # set the defaults:
      self.set(
          w_pad=mpl.rcParams["figure.constrained_layout.w_pad"],
          h_pad=mpl.rcParams["figure.constrained_layout.h_pad"],
          wspace=mpl.rcParams["figure.constrained_layout.wspace"],
          hspace=mpl.rcParams["figure.constrained_layout.hspace"],
          rect=(0, 0, 1, 1),
      )
      # set anything that was passed in (None will be ignored):
      self.set(
          w_pad=w_pad,
          h_pad=h_pad,
          wspace=wspace,
          hspace=hspace,
          rect=rect,
      )
      self._compress = compress
  
imports: from contextlib import nullcontext
  import matplotlib
  from matplotlib._constrained_layout import do_constrained_layout
  from matplotlib._tight_layout import get_subplotspec_list, get_tight_layout_figure
label_desc: Use image node_id 1 to create a new ConstrainedLayoutEngine object from inherited base classes: LayoutEngine with example: obj = ConstrainedLayoutEngine()