+
    iZt                         R t ^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIH	t	H
t
Ht ^ RIHt ]P                  ! ]4      t ! R R4      t ! R R]4      t ! R	 R
]4      t ! R R4      t ! R R4      tR# )a  
:mod:`~matplotlib.gridspec` contains classes that help to layout multiple
`~.axes.Axes` in a grid-like pattern within a figure.

The `GridSpec` specifies the overall grid structure. Individual cells within
the grid are referenced by `SubplotSpec`\s.

Often, users need not access this module directly, and can use higher-level
methods like `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` and
`~.Figure.subfigures`. See the tutorial :ref:`arranging_axes` for a guide.
N)Integral)_api_pylab_helpers_tight_layout)Bboxc                      a  ] tR t^t o RtRR ltR t]! R RR7      t]! R R	R7      t	R
 t
RR ltRR ltR tR tR tR tR t]R 4       tR tRRRRRRRR/R ltRtV tR# )GridSpecBaseza
A base class of GridSpec that specifies the geometry of the grid
that a subplot will be placed.
Nc                   \        V\        4      '       d   V^ 8:  d   \        RV: 24      h\        V\        4      '       d   V^ 8:  d   \        RV: 24      hWuV n        V n        V P                  V4       V P                  V4       R# )a7  
Parameters
----------
nrows, ncols : int
    The number of rows and columns of the grid.
width_ratios : array-like of length *ncols*, optional
    Defines the relative widths of the columns. Each column gets a
    relative width of ``width_ratios[i] / sum(width_ratios)``.
    If not given, all columns will have the same width.
height_ratios : array-like of length *nrows*, optional
    Defines the relative heights of the rows. Each row gets a
    relative height of ``height_ratios[i] / sum(height_ratios)``.
    If not given, all rows will have the same height.
z/Number of rows must be a positive integer, not z2Number of columns must be a positive integer, not N)
isinstancer   
ValueError_nrows_ncolsset_height_ratiosset_width_ratios)selfnrowsncolsheight_ratioswidth_ratioss   &&&&&s/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/gridspec.py__init__GridSpecBase.__init__    s     %**eqjA%KM M%**eqjDUINP P#( T[}-l+    c                \   \        \        V P                  4      4      ^8w  d   RV P                  : 2MRp\        \        V P                  4      4      ^8w  d   RV P                  : 2MRpRP	                  V P
                  P                  V P                  V P                  W,           R7      # )   z, height_ratios= z, width_ratios=z&{clsname}({nrows}, {ncols}{optionals}))clsnamer   r   	optionals)	lenset_row_height_ratios_col_width_ratiosformat	__class____name__r   r   )r   
height_arg	width_args   &  r   __repr__GridSpecBase.__repr__9   s    S!8!89:a? ))@)@(CDEG 	 C 6 678A= 't'='=&@ACE 	7>>NN++++++ ,	 ?  	r   c                    V P                   # N)r   r   s   &r   <lambda>GridSpecBase.<lambda>E       $++r   zThe number of rows in the grid.)docc                    V P                   # r*   )r   r+   s   &r   r,   r-   G   r.   r   z"The number of columns in the grid.c                2    V P                   V P                  3# )zG
Return a tuple containing the number of rows and columns in the grid.
)r   r   r+   s   &r   get_geometryGridSpecBase.get_geometryJ   s     {{DKK''r   c                    R # r*    )r   figures   &&r   get_subplot_paramsGridSpecBase.get_subplot_paramsP   s    r   c                B    Vw  rEWWB,           1WUV,           13,          pV# )a  
Create and return a `.SubplotSpec` instance.

Parameters
----------
loc : (int, int)
    The position of the subplot in the grid as
    ``(row_index, column_index)``.
rowspan, colspan : int, default: 1
    The number of rows and columns the subplot should span in the grid.
r5   )r   locrowspancolspanloc1loc2subplotspecs   &&&&   r   new_subplotspecGridSpecBase.new_subplotspecT   s,     
,d<.??@r   c                    Vf   ^.V P                   ,          pM%\        V4      V P                   8w  d   \        R4      hWn        R# )z
Set the relative widths of the columns.

*width_ratios* must be of length *ncols*. Each column gets a relative
width of ``width_ratios[i] / sum(width_ratios)``.
NzTExpected the given number of width ratios to match the number of columns of the grid)r   r   r   r!   )r   r   s   &&r   r   GridSpecBase.set_width_ratiosd   sF     3,L$++- G H H!-r   c                    V P                   # )zW
Return the width ratios.

This is *None* if no width ratios have been set explicitly.
)r!   r+   s   &r   get_width_ratiosGridSpecBase.get_width_ratiosr   s     %%%r   c                    Vf   ^.V P                   ,          pM%\        V4      V P                   8w  d   \        R4      hWn        R# )z
Set the relative heights of the rows.

*height_ratios* must be of length *nrows*. Each row gets a relative
height of ``height_ratios[i] / sum(height_ratios)``.
NzRExpected the given number of height ratios to match the number of rows of the grid)r   r   r   r    )r   r   s   &&r   r   GridSpecBase.set_height_ratiosz   sF      C$++-M4;;. D E E"/r   c                    V P                   # )zY
Return the height ratios.

This is *None* if no height ratios have been set explicitly.
)r    r+   s   &r   get_height_ratiosGridSpecBase.get_height_ratios   s     &&&r   c                   V P                  4       w  r#V P                  V4      pVP                  pVP                  pVP                  pVP
                  pVP                  p	VP                  p
We,
          pW,
          pWW^,
          ,          ,           ,          pW,          pW,          \        V P                  4      ,          pV P                   Uu. uF  pVV,          NK  	  pp^ .V.V^,
          ,          ,           p\        P                  ! \        P                  ! VV.4      P                  4      pWW^,
          ,          ,           ,          pV	V,          pVV,          \        V P                  4      ,          pV P                   Uu. uF  pVV,          NK  	  pp^ .V.V^,
          ,          ,           p\        P                  ! \        P                  ! VV.4      P                  4      pVV,
          P                  R4      P                   w  ppVV,           P                  R4      P                   w  ppVVVV3# u upi u upi )a  
Return the positions of the grid cells in figure coordinates.

Parameters
----------
fig : `~matplotlib.figure.Figure`
    The figure the grid should be applied to. The subplot parameters
    (margins and spacing between subplots) are taken from *fig*.

Returns
-------
bottoms, tops, lefts, rights : array
    The bottom, top, left, right positions of the grid cells in
    figure coordinates.
)   )r2   r7   leftrightbottomtopwspacehspacesumr    npcumsumcolumn_stackflatr!   reshapeT)r   figr   r   subplot_paramsrO   rP   rQ   rR   rS   rT   	tot_width
tot_heightcell_hsep_hnormrcell_heightssep_heightscell_hscell_wsep_wcell_widths
sep_widthscell_wsfig_topsfig_bottoms	fig_lefts
fig_rightss   &&                           r   get_grid_positionsGridSpecBase.get_grid_positions   s     ((*005""$$&&  &&&&L	\
 vQw'778~D$;$; <<*.*A*AB*AQD*ABceWa01))BOO[,,GHMMN fAg&667~D$:$: ;;)-)?)?@)?Aq4xx)?@SUGuQw/0
))BOOZ,EFKKL!$w 7 7 @ B B+!% 8 8 A C C	:Hi;; C As   H<	Ic                
   V P                  4        Fc  pVP                  4       pVf   K  \        VR4      '       d   VP                  4       P                  4       pVP	                  4       W38X  g   Ka  Vu # 	  \        WV R7      # )zW
Check if the figure already has a gridspec with these dimensions,
or create a new one
get_topmost_subplotspecr6   )get_axesget_gridspechasattrrs   r2   GridSpec)r6   r   r   axgss   &&&  r   _check_gridspec_exists#GridSpecBase._check_gridspec_exists   sr     //#B"B~2899 335BBDB??$6I $ V44r   c                2   V P                  4       w  r#R p\        V\        4      '       d1    Vw  rV\        P
                  ! T! YR^ 4      T! Yc^4      .Y#34      w  rMV! WV,          R4      w  r\        WV	4      #   \         d   p\        R4      ThRp?ii ; i)z,Create and return a `.SubplotSpec` instance.c                 (   T p\        V \        4      '       d0   V P                  V4      w  rEpWT8  d   WE^,
          3# \        R4      hV ^ 8  d	   W,           p ^ T u;8:  d   V8  d    W 3#  Ve   \        RV RV RV 24      h\        RV RV 24      h)r   z=GridSpec slice would result in no space allocated for subplotzindex z is out of bounds for axis z with size z) is out of bounds for GridSpec with size )r
   sliceindices
IndexError)keysizeaxisorig_keystartstop_s   &&&    r   
_normalize,GridSpecBase.__getitem__.<locals>._normalize   s    H#u%%!$T!2Q< (?*  "9 : : 7*C?d?8O #%$vhZ 8--1F+dV&E F F %vhZ 8;;?&&B C Cr   zUnrecognized subplot specN)r2   r
   tupler   rV   ravel_multi_indexSubplotSpec)
r   r   r   r   r   k1k2errnum1num2s
   &&        r   __getitem__GridSpecBase.__getitem__   s    ((*	C( c5!!G --Bq):b+CD JD$ $C=JD4t,,  G !<=3FGs   A: :BBBsharexFshareysqueezeT
subplot_kwc                  V P                   pVf   \        R4      h\        V\        4      '       g   V'       d   RMRp\        V\        4      '       g   V'       d   RMRp\        P
                  ! . ROWR7       Vf   / pVP                  4       p\        P                  ! V P                  V P                  3\        R	7      p\        V P                  4       Fv  p\        V P                  4       FZ  pRRRVR,          RWg^ 3,          RV^ V3,          /p	W,          VR
&   W,          VR&   VP                  ! WV3,          3/ VB WgV3&   K\  	  Kx  	  VR9   d&   VP                   F  p
V
P                  RR7       K  	  VR9   d&   VP                   F  p
V
P!                  RR7       K  	  V'       d2   VP"                  ^8X  d   VP%                  4       # VP'                  4       # V# )zy
Add all subplots specified by this `GridSpec` to its parent figure.

See `.Figure.subplots` for detailed documentation.
NzIGridSpec.subplots() only works for GridSpecs created with a parent figureallnonerowcolT)r   r   )dtyper   r   )skip_non_rectangular_axes)r   r   r   r   FT)    r   )r   r   )r   r   )r6   r   r
   strr   check_in_listcopyrV   emptyr   r   objectrangeadd_subplotrY   _label_outer_xaxis_label_outer_yaxisr   itemr   )r   r   r   r   r   r6   axarrr   r   shared_withry   s   &$$$$      r   subplotsGridSpecBase.subplots   s    > < = = &#&&$U&F&#&&$U&FE"(	9J__&
 $++t{{36B%CT[[)%tUE$K$eFmUE!S&MK'2':
8$'2':
8$"("4"4cN#2&0#23h * & ^#jj%%%E !^#jj%%%E !  $)::?5::<GG Lr   )r!   r   r   r    )NNr*   )r   r   )r$   
__module____qualname____firstlineno____doc__r   r'   propertyr   r   r2   r7   r@   r   rE   r   rJ   rp   staticmethodr{   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s     
,2
 -:<E-=?E( .&0'-<^ 5 5(#-J3 3u 3d 3 3 3r   r   c                   b   a a ] tR tRt oRtR	V 3R llt. R
OtR tRR ltR t	RR lt
RtVtV ;t# )rx   i/  z
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`.
c                   < W@n         WPn        W`n        Wpn        Wn        Wn        W0n        \        SV `!  WV
VR7       R# )a   
Parameters
----------
nrows, ncols : int
    The number of rows and columns of the grid.

figure : `.Figure`, optional
    Only used for constrained layout to create a proper layoutgrid.

left, right, top, bottom : float, optional
    Extent of the subplots as a fraction of figure width or height.
    Left cannot be larger than right, and bottom cannot be larger than
    top. If not given, the values will be inferred from a figure or
    rcParams at draw time. See also `GridSpec.get_subplot_params`.

wspace : float, optional
    The amount of width reserved for space between subplots,
    expressed as a fraction of the average axis width.
    If not given, the values will be inferred from a figure or
    rcParams when necessary. See also `GridSpec.get_subplot_params`.

hspace : float, optional
    The amount of height reserved for space between subplots,
    expressed as a fraction of the average axis height.
    If not given, the values will be inferred from a figure or
    rcParams when necessary. See also `GridSpec.get_subplot_params`.

width_ratios : array-like of length *ncols*, optional
    Defines the relative widths of the columns. Each column gets a
    relative width of ``width_ratios[i] / sum(width_ratios)``.
    If not given, all columns will have the same width.

height_ratios : array-like of length *nrows*, optional
    Defines the relative heights of the rows. Each row gets a
    relative height of ``height_ratios[i] / sum(height_ratios)``.
    If not given, all rows will have the same height.

r   r   N)	rO   rQ   rP   rR   rS   rT   r6   superr   )r   r   r   r6   rO   rQ   rP   rR   rS   rT   r   r   r#   s   &&&&&&&&&&&&r   r   GridSpec.__init__9  sC    T 	
&2'4 	 	6r   c                J   VP                  4        F/  w  r#W P                  9   d   \        WV4       K#  \        V R24      h	  \        P
                  P                  P                  4        F  pVP                  P                  P                   F  pVP                  4       f   K  VP                  4       P                  4       pVP                  4       V 8X  g   KL  VP                  RR7      pVP                  VP                  4       P!                  V4      4       K  	  K  	  R# )a  
Update the subplot parameters of the grid.

Parameters that are not explicitly given are not changed. Setting a
parameter to *None* resets it to :rc:`figure.subplot.*`.

Parameters
----------
left, right, top, bottom : float or None, optional
    Extent of the subplots as a fraction of figure width or height.
wspace, hspace : float, optional
    Spacing between the subplots as a fraction of the average subplot
    width / height.
z is an unknown keywordNF)root)items_AllowedKeyssetattrAttributeErrorr   Gcffigsvaluescanvasr6   axesget_subplotspecrs   rv   
get_figure_set_positionget_position)r   kwargskv
figmanagerry   ssr\   s   &,      r   updateGridSpec.updateq  s     LLNDA%%%#$s*@%ABB	 #
 ),,1188:J ''..33%%'3++-EEGB(D0 mmm7((););)=)J)J3)OP 4 ;r   c                T   VfE   V P                    Uu/ uF"  pV\        P                  RV,           ,          bK$  	  pp\        R/ VB pM \        P                  ! VP
                  4      pVP                  ! R/ V P                    Uu/ uF  q"\        W4      bK  	  upB  V# u upi u upi )a  
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.
figure.subplot.r5   )r   mplrcParamsSubplotParamsr   subplotparsr   getattr)r   r6   r   kwr   s   &&   r   r7   GridSpec.get_subplot_params  s     >,,.,a S\\"3A"566,  .'-"-K))F$6$67KN4;L;LM;La!11;LMN. Ns   (B B%c                j    V P                    Uu. uF  p\        W4      '       g   K  VNK  	  up# u upi )z
Return a list of the names of the subplot parameters explicitly set
in the GridSpec.

This is a subset of the attributes of `.SubplotParams`.
)r   r   )r   r   s   & r   locally_modified_subplot_params(GridSpec.locally_modified_subplot_params  s-      ,,A,a0@,AAAs   00c                    Vf   VP                  4       p\        P                  ! WP                  \        P                  ! VP                  V R7      W#WEVR7      pV'       d   V P
                  ! R/ VB  R# R# )a  
Adjust subplot parameters to give specified padding.

Parameters
----------
figure : `.Figure`
    The figure.
renderer :  `.RendererBase` subclass, optional
    The renderer to be used.
pad : float
    Padding between the figure edge and the edges of subplots, as a
    fraction of the font-size.
h_pad, w_pad : float, optional
    Padding (height/width) between edges of adjacent subplots.
    Defaults to *pad*.
rect : tuple (left, bottom, right, top), default: None
    (left, bottom, right, top) rectangle in normalized figure
    coordinates that the whole subplots area (including labels) will
    fit into. Default (None) is the whole figure.
N)	grid_spec)padh_padw_padrectr5   )_get_rendererr   get_tight_layout_figurer   get_subplotspec_listr   )r   r6   rendererr   r   r   r   r   s   &&&&&&& r   tight_layoutGridSpec.tight_layout  sd    , ++-H66KK..v{{dKUdD KK!&! r   )rQ   r6   rT   rO   rP   rR   rS   )	NNNNNNNNNrO   rQ   rP   rR   rS   rT   r*   )NgHzG?NNN)r$   r   r   r   r   r   r   r   r7   r   r   r   r   __classcell__r#   r   s   @@r   rx   rx   /  s3     46l JLQ8.B" "r   rx   c                   J   a a ] tR tRt oRtRV 3R lltRR ltR tRtVt	V ;t
# )	GridSpecFromSubplotSpeci  zl
GridSpec whose subplot layout parameters are inherited from the
location specified by a given SubplotSpec.
c                   < W@n         WPn        \        V\        4      '       d   W0n        M\        R4      hV P                  P                  4       P                  V n        \        SV `%  WVVR7       R# )a  
Parameters
----------
nrows, ncols : int
    Number of rows and number of columns of the grid.
subplot_spec : SubplotSpec
    Spec from which the layout parameters are inherited.
wspace, hspace : float, optional
    See `GridSpec` for more details. If not specified default values
    (from the figure or rcParams) are used.
height_ratios : array-like of length *nrows*, optional
    See `GridSpecBase` for details.
width_ratios : array-like of length *ncols*, optional
    See `GridSpecBase` for details.
zVsubplot_spec must be type SubplotSpec, usually from GridSpec, or axes.get_subplotspec.r   N)
_wspace_hspacer
   r   _subplot_spec	TypeErrorrv   r6   r   r   )	r   r   r   subplot_specrS   rT   r   r   r#   s	   &&&&&&&&r   r    GridSpecFromSubplotSpec.__init__  so    & lK00!-NO O ((557>>&2'4 	 	6r   c           	        V P                   e   V P                   M0Ve   VP                  P                  M\        P                  R,          pV P
                  e   V P
                  M0Ve   VP                  P                  M\        P                  R,          pV P                  P                  V4      pVP                  w  rVrx\        WWWhW2R7      # )z1Return a dictionary of subplot layout parameters.zfigure.subplot.hspacezfigure.subplot.wspace)rO   rP   rQ   rR   rS   rT   )r   r   rT   r   r   r   rS   r   r   extentsr   )	r   r6   rT   rS   figboxrO   rQ   rP   rR   s	   &&       r   r7   *GridSpecFromSubplotSpec.get_subplot_params  s    "&,,":$,,4:4Fv))00||$;< 	 #',,":$,,4:4Fv))00||$;< 	 ##008#)>> e$$*$*; 	;r   c                6    V P                   P                  4       # )zI
Return the topmost `.SubplotSpec` instance associated with the subplot.
)r   rs   r+   s   &r   rs   /GridSpecFromSubplotSpec.get_topmost_subplotspec  s     !!99;;r   )r   r   r   r6   )NNNNr*   )r$   r   r   r   r   r   r7   rs   r   r   r   r   s   @@r   r   r     s     6@; < <r   r   c                      a  ] tR tRt o RtRR ltR t]R 4       t]	R 4       t
]
P                  R 4       t
R	 tR
 t]	R 4       t]	R 4       tR tR tR tR tR tR tR tR tR tRtV tR# )r   i	  a%  
The location of a subplot in a `GridSpec`.

.. note::

    Likely, you will never instantiate a `SubplotSpec` yourself. Instead,
    you will typically obtain one from a `GridSpec` using item-access.

Parameters
----------
gridspec : `~matplotlib.gridspec.GridSpec`
    The GridSpec, which the subplot is referencing.
num1, num2 : int
    The subplot will occupy the *num1*-th cell of the given
    *gridspec*.  If *num2* is provided, the subplot will span between
    *num1*-th cell and *num2*-th cell **inclusive**.

    The index starts from 0.
Nc                *    Wn         W n        W0n        R # r*   )	_gridspecr   r   )r   gridspecr   r   s   &&&&r   r   SubplotSpec.__init__  s    !		r   c           
         V P                  4        R V P                  P                   RV P                  P                   RV P                  P                   RV P                  P                   R2
# )[:z, ])rv   r;   r   r   r<   r+   s   &r   r'   SubplotSpec.__repr__"  sc    $$&'q<<%%&a(9(9':"<<%%&a(9(9':!= 	>r   c                b   \        V4      ^8X  d`   Vw  p\        V\        4      '       d   V# \        V\        4      '       g   \	        RV: 24      h \        \        \        V4      4      w  r4pM8\        V4      ^8X  d   Vw  r4pM"\        P                  ! RR\        V4      R7      h\        P                  WV4      pVf   \        W4V R7      p\        V\        4      '       d^   \        V4      ^8X  dN   \        ;QJ d    R V 4       F  '       d   K   RM	  R	M! R V 4       4      '       g   \	        R
V 24      hVw  rxME\        V\        4      '       d   V^8  g   WSV,          8  d   \	        RW4,           RV: 24      hT;rxWg^,
          V #   \         d    \	        RT: 24      Rhi ; i)z
Construct a `.SubplotSpec` from a parent `.Figure` and either

- a `.SubplotSpec` -- returned as is;
- one or three numbers -- a MATLAB-style subplot specifier.
z>Single argument to subplot must be a three-digit integer, not Nsubplotz1 or 3)takesgivenrt   c              3   B   "   T F  p\        V\        4      x  K  	  R # 5ir*   )r
   r   ).0ns   & r   	<genexpr>1SubplotSpec._from_subplot_args.<locals>.<genexpr>F  s     <1z!X..s   FTz3Subplot specifier tuple must contain integers, not z(num must be an integer with 1 <= num <= z, not )r   r
   r   r   r   mapintr   r   nargs_errorrx   r{   r   r   )	r6   argsargrowscolsnumrz   ijs	   &&       r   _from_subplot_argsSubplotSpec._from_subplot_args'  s    t9>DC#{++
X.. $$'7,- -7"%c3s8"4C
 Y!^"OD""9HCINN,,V4@:$V4Bc5!!c#h!m3<<333<<<< I#O  DAqc8,,a3d? >tyk J'#  KAA#ay3  7 $$'7,-2677s   F F.c                N    V P                   f   V P                  # V P                   # r*   )_num2r   r+   s   &r   r   SubplotSpec.num2W  s     JJ.tyy>DJJ>r   c                    Wn         R # r*   )r  )r   values   &&r   r   r  [  s    
r   c                    V P                   # r*   )r   r+   s   &r   rv   SubplotSpec.get_gridspec_  s    ~~r   c                t    V P                  4       P                  4       w  rWV P                  V P                  3# )z
Return the subplot geometry as tuple ``(n_rows, n_cols, start, stop)``.

The indices *start* and *stop* define the range of the subplot within
the `GridSpec`. *stop* is inclusive (i.e. for a single cell
``start == stop``).
)rv   r2   r   r   )r   r  r  s   &  r   r2   SubplotSpec.get_geometryb  s2     &&(557
499dii//r   c                    V P                  4       P                  p\        V P                  V,          V P                  V,          ^,           4      # )z6The rows spanned by this subplot, as a `range` object.)rv   r   r   r   r   )r   r   s   & r   r;   SubplotSpec.rowspanm  s<     !!#))TYY%'e);a)?@@r   c                    V P                  4       P                  p\        V P                  V,          V P                  V,          .4      w  r#\        W#^,           4      # )z9The columns spanned by this subplot, as a `range` object.)rv   r   sortedr   r   r   )r   r   c1c2s   &   r   r<   SubplotSpec.colspans  sL     !!#)) U*DII,=>?Ra  r   c                4    V P                   P                  ^ 8H  # r   )r;   r   r+   s   &r   is_first_rowSubplotSpec.is_first_row|      ||!!Q&&r   c                d    V P                   P                  V P                  4       P                  8H  # r*   )r;   r   rv   r   r+   s   &r   is_last_rowSubplotSpec.is_last_row  &    ||  D$5$5$7$=$===r   c                4    V P                   P                  ^ 8H  # r.  )r<   r   r+   s   &r   is_first_colSubplotSpec.is_first_col  r1  r   c                d    V P                   P                  V P                  4       P                  8H  # r*   )r<   r   rv   r   r+   s   &r   is_last_colSubplotSpec.is_last_col  r5  r   c                   V P                  4       pVP                  4       w  r4\        P                  ! V P                  V P
                  .W434      w  rVVP                  V4      w  rxrWu,          P                  4       pW,          P                  4       pW,          P                  4       pW,          P                  4       p\        P                  ! WW4      # )z:
Update the subplot position from ``figure.subplotpars``.
)rv   r2   rV   unravel_indexr   r   rp   minmaxr   from_extents)r   r6   r  r   r   r  r  rm   rl   rn   ro   
fig_bottomfig_topfig_left	fig_rights   &&             r   r   SubplotSpec.get_position  s     $$&,,.%%tyy$))&<unM
''/ 	5y !&**,
.$$&?&&($((*	  yJJr   c                j    V P                  4       p\        VR4      '       d   VP                  4       # V # )zH
Return the topmost `SubplotSpec` instance associated with the subplot.
rs   )rv   rw   rs   )r   r  s   & r   rs   #SubplotSpec.get_topmost_subplotspec  s4     $$&86773355Kr   c           	         V P                   V P                  V P                  3\        VR\	        4       4      \        VR\	        4       4      \        VR\	        4       4      38H  # )ze
Two SubplotSpecs are considered equal if they refer to the same
position(s) in the same `GridSpec`.
r   r   r   )r   r   r   r   r   )r   others   &&r   __eq__SubplotSpec.__eq__  sS     DII6E;9E6684E668466 	7r   c                Z    \        V P                  V P                  V P                  34      # r*   )hashr   r   r   r+   s   &r   __hash__SubplotSpec.__hash__  s     T^^TYY		:;;r   c                    \        WV 3/ VB # )a  
Create a GridSpec within this subplot.

The created `.GridSpecFromSubplotSpec` will have this `SubplotSpec` as
a parent.

Parameters
----------
nrows : int
    Number of rows in grid.

ncols : int
    Number of columns in grid.

Returns
-------
`.GridSpecFromSubplotSpec`

Other Parameters
----------------
**kwargs
    All other parameters are passed to `.GridSpecFromSubplotSpec`.

See Also
--------
matplotlib.pyplot.subplots

Examples
--------
Adding three subplots in the space occupied by a single subplot::

    fig = plt.figure()
    gs0 = fig.add_gridspec(3, 1)
    ax1 = fig.add_subplot(gs0[0])
    ax2 = fig.add_subplot(gs0[1])
    gssub = gs0[2].subgridspec(1, 3)
    for i in range(3):
        fig.add_subplot(gssub[0, i])
)r   )r   r   r   r   s   &&&,r   subgridspecSubplotSpec.subgridspec  s    P 'uTDVDDr   )r   r  r   r   r*   )r$   r   r   r   r   r   r'   r   r  r   r   setterrv   r2   r;   r<   r/  r3  r7  r:  r   rs   rJ  rN  rQ  r   r   r   s   @r   r   r   	  s     &
>
 * *^ ? ? 
[[ 	0 A A
 ! !'>'>K 	7<(E (Er   r   c                   8   a  ] tR tRt o RtRR ltRR ltRtV tR# )r   i  zE
Parameters defining the positioning of a subplots grid in a figure.
Nc                    R F'  p\        W\        P                  RV 2,          4       K)  	  V P                  WW4WV4       R# )a  
Defaults are given by :rc:`figure.subplot.[name]`.

Parameters
----------
left : float
    The position of the left edge of the subplots,
    as a fraction of the figure width.
right : float
    The position of the right edge of the subplots,
    as a fraction of the figure width.
bottom : float
    The position of the bottom edge of the subplots,
    as a fraction of the figure height.
top : float
    The position of the top edge of the subplots,
    as a fraction of the figure height.
wspace : float
    The width of the padding between subplots,
    as a fraction of the average Axes width.
hspace : float
    The height of the padding between subplots,
    as a fraction of the average Axes height.
r   Nr   )r   r   r   r   )r   rO   rQ   rP   rR   rS   rT   r   s   &&&&&&& r   r   SubplotParams.__init__  s:    4 JCDs||ocU,CDE JD%f=r   c                J   Ve   TMV P                   Ve   TMV P                  8  d   \        R4      hVe   TMV P                  Ve   TMV P                  8  d   \        R4      hVe   Wn         Ve   W0n        Ve   W n        Ve   W@n        Ve   WPn        Ve	   W`n        R# R# )zI
Update the dimensions of the passed parameters. *None* means unchanged.
Nzleft cannot be >= rightzbottom cannot be >= top)rO   rP   r   rQ   rR   rS   rT   )r   rO   rQ   rP   rR   rS   rT   s   &&&&&&&r   r   SubplotParams.update  s    
 %T499".EDJJ@677)Vt{{?C:677IJ K?H K K r   )rQ   rT   rO   rP   rR   rS   )NNNNNN)	r$   r   r   r   r   r   r   r   r   r   s   @r   r   r     s     ><! !r   r   )r   r   loggingnumbersr   numpyrV   
matplotlibr   r   r   r   matplotlib.transformsr   	getLoggerr$   _logr   rx   r   r   r   r5   r   r   <module>r`     sv   
      : : &"R Rj["| ["|9<l 9<xOE OEd9! 9!r   