+
     ]iZt  c                   s    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                   s   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                s   \        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   &&&&&:/usr/lib64/python3.14/site-packages/matplotlib/gridspec.py__init__ZGridSpecBase.__init__    s     %**eqjA%KM M%**eqjDUINP P#( T[}-l+    c                s\   \        \        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 z, width_ratios=z&{clsname}({nrows}, {ncols}{optionals}))Zclsnamer   r   Z	optionals)	lenZset_row_height_ratios_col_width_ratiosZformat	__class____name__r   r	   )r   Z
height_argZ	width_arg   &  r   __repr__Z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      &r   <lambda>GridSpecBase.<lambda>E       $++r   zThe number of rows in the grid.)Zdocc                r   r   )r	   r   r   r   r    r!   G   r"   r   z"The number of columns in the grid.c                s2    V P                   V P                  3# )zG
Return a tuple containing the number of rows and columns in the grid.
)r   r	   r   r   r   get_geometryZGridSpecBase.get_geometryJ   s     {{DKK''r   c                s    R # r    )r   figure   &&r   get_subplot_paramsZGridSpecBase.get_subplot_paramsP   s    r   c                sB    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.
r$   )r   ZlocrowspancolspanZloc1Zloc2Zsubplotspecs   &&&&   r   new_subplotspecZ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   r&   r   r   ZGridSpecBase.set_width_ratiosd   sF     3,L$++- G H H!-r   c                r   )zW
Return the width ratios.

This is *None* if no width ratios have been set explicitly.
)r   r   r   r   get_width_ratiosZGridSpecBase.get_width_ratiosr   s     %%%r   c                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   r&   r   r
   ZGridSpecBase.set_height_ratiosz   sF      C$++-M4;;. D E E"/r   c                r   )zY
Return the height ratios.

This is *None* if no height ratios have been set explicitly.
)r   r   r   r   get_height_ratiosZGridSpecBase.get_height_ratios   s     &&&r   c                s   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.
)ii   )r#   r'   leftrightbottomtopwspacehspaceZsumr   npZcumsumZcolumn_stackflatr   ZreshapeZT)r   figr   r   Zsubplot_paramsr.   r/   r0   r1   r2   r3   Z	tot_widthZ
tot_heightZcell_hZsep_hZnormZrZcell_heightsZsep_heightsZcell_hsZcell_wZsep_wZcell_widthsZ
sep_widthsZcell_wsfig_topsfig_bottoms	fig_lefts
fig_rightss   &&                           r   get_grid_positionsZ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                s
   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r%   )Zget_axesget_gridspechasattrr<   r#   GridSpec)r%   r   r   axgss   &&&  r   _check_gridspec_existsZ#GridSpecBase._check_gridspec_exists   sr     //#B"B~2899 335BBDB??$6I $ V44r   c                s2   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                 s(   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   ZsliceZindicesZ
IndexError)keysizeZaxisZorig_keystartstopZ_s   &&&    r   
_normalizeZ,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)r#   r   tupler   r4   Zravel_multi_indexSubplotSpec)
r   rD   r   r   rH   Zk1Zk2Zerrnum1num2s
   &&        r   __getitem__Z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               s   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)rN   rO   )ZdtyperN   rO   )Zskip_non_rectangular_axes)rR   rT   rU   rS   FT)    rV   )rU   rR   )rT   rR   )r%   r   r   strr   Zcheck_in_listcopyr4   Zemptyr   r	   objectrangeZadd_subplotr5   Z_label_outer_xaxisZ_label_outer_yaxisrE   ZitemrP   )r   rN   rO   rP   rQ   r%   ZaxarrrT   rU   Zshared_withrA   s   &$$$$      r   subplotsZ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   r#   r'   r*   r   r,   r
   r-   r;   staticmethodrC   rM   r[   __static_attributes____classdictcell____classdict__   @r   r   r      s     
,2
 -:<E-=?E( .&0'-<^ 5 5(#-J3 3u 3d 3 3 3r   r   c                   sb   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# )r@   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                s   < 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)	r.   r0   r/   r1   r2   r3   r%   superr   )r   r   r   r%   r.   r0   r/   r1   r2   r3   r   r   r   s   &&&&&&&&&&&&r   r   ZGridSpec.__init__9  sC    T 	
&2'4 	 	6r   c                sJ   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)Zroot)Zitems_AllowedKeyssetattrZAttributeErrorr   ZGcfZfigsZvaluesZcanvasr%   axesZget_subplotspecr<   r>   Z
get_figureZ_set_positionget_position)r   kwargskZvZ
figmanagerrA   Zssr6   s   &,      r   updateZ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                sT   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.r$   )ri   mplrcParamsSubplotParamsrX   subplotparsro   getattr)r   r%   rn   Zkwrt   s   &&   r   r'   Z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                sj    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`.
)ri   ru   )r   rn      & r   locally_modified_subplot_paramsZ(GridSpec.locally_modified_subplot_params  s-      ,,A,a0@,AAAs   00c                s    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)Z	grid_spec)padh_padw_padrectr$   )Z_get_rendererr   Zget_tight_layout_figurerk   Zget_subplotspec_listro   )r   r%   Zrendererrx   ry   rz   r{   rm      &&&&&&& r   tight_layoutZGridSpec.tight_layout  sd    , ++-H66KK..v{{dKUdD KK!&! r   )r0   r%   r3   r.   r/   r1   r2   )	NNNNNNNNNr.   r0   r/   r1   r2   r3   r   )NgHzG?NNN)r   r\   r]   r^   r_   r   ri   ro   r'   rw   r}   rb   rc   __classcell__r   re      @@r   r@   r@   /  s3     46l JLQ8.B" "r   r@   c                   sJ   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                s   < 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.rg   N)
_wspace_hspacer   rJ   _subplot_specZ	TypeErrorr>   r%   rh   r   )	r   r   r   Zsubplot_specr2   r3   r   r   r   s	   &&&&&&&&r   r   Z GridSpecFromSubplotSpec.__init__  so    & lK00!-NO O ((557>>&2'4 	 	6r   c           	     s   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)r.   r/   r0   r1   r2   r3   )r   rt   r3   rq   rr   r   r2   r   rl   Zextentsrs   )	r   r%   r3   r2   Zfigboxr.   r0   r/   r1   	   &&       r   r'   Z*GridSpecFromSubplotSpec.get_subplot_params  s    "&,,":$,,4:4Fv))00||$;< 	 #',,":$,,4:4Fv))00||$;< 	 ##008#)>> e$$*$*; 	;r   c                s6    V P                   P                  4       # )zI
Return the topmost `.SubplotSpec` instance associated with the subplot.
)r   r<   r   r   r   r<   Z/GridSpecFromSubplotSpec.get_topmost_subplotspec  s     !!99;;r   )r   r   r   r%   )NNNNr   )r   r\   r]   r^   r_   r   r'   r<   rb   rc   r   r   r   r   r   r     s     6@; < <r   r   c                   s   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# )rJ   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                s*    Wn         W n        W0n        R # r   )	_gridspecrK   rL   )r   gridspecrK   rL   s   &&&&r   r   ZSubplotSpec.__init__  s    !		r   c           
     s    V P                  4        R V P                  P                   RV P                  P                   RV P                  P                   RV P                  P                   R2
# )Z[Z:z, Z])r>   r(   rF   rG   r)   r   r   r   r   ZSubplotSpec.__repr__"  sc    $$&'q<<%%&a(9(9':"<<%%&a(9(9':!= 	>r   c                sb   \        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 NZsubplotz1 or 3)ZtakesZgivenr=   c              3   sB   "   T F  p\        V\        4      x  K  	  R # 5ir   )r   r    )Z.0Znrv   r   Z	<genexpr>Z1SubplotSpec._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   rJ   r    r   ZmapZintrW   r   Znargs_errorr@   rC   rI   rR   )	r%   ZargsZargrowscolsZnumrB   ZiZjr   r   _from_subplot_argsZ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                sN    V P                   f   V P                  # V P                   # r   )_num2rK   r   r   r   rL   SubplotSpec.num2W  s     JJ.tyy>DJJ>r   c                s    Wn         R # r   )r   )r   Zvaluer&   r   rL   r   [  s    
r   c                r   r   )r   r   r   r   r>   ZSubplotSpec.get_gridspec_  s    ~~r   c                st    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``).
)r>   r#   rK   rL   )r   r   r   r   r   r#   ZSubplotSpec.get_geometryb  s2     &&(557
499dii//r   c                s    V P                  4       P                  p\        V P                  V,          V P                  V,          ^,           4      # )z6The rows spanned by this subplot, as a `range` object.)r>   r   rZ   rK   rL   )r   r   rv   r   r(   ZSubplotSpec.rowspanm  s<     !!#))TYY%'e);a)?@@r   c                s    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.)r>   r   ZsortedrK   rL   rZ   )r   r   Zc1Zc2s   &   r   r)   ZSubplotSpec.colspans  sL     !!#)) U*DII,=>?Ra  r   c                4    V P                   P                  ^ 8H  # rV   )r(   rF   r   r   r   is_first_rowZSubplotSpec.is_first_row|      ||!!Q&&r   c                d    V P                   P                  V P                  4       P                  8H  # r   )r(   rG   r>   r   r   r   r   is_last_rowZSubplotSpec.is_last_row  &    ||  D$5$5$7$=$===r   c                r   r   )r)   rF   r   r   r   is_first_colZSubplotSpec.is_first_col  r   r   c                r   r   )r)   rG   r>   r   r   r   r   is_last_colZSubplotSpec.is_last_col  r   r   c                s   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``.
)r>   r#   r4   Zunravel_indexrK   rL   r;   ZminZmaxr   Zfrom_extents)r   r%   r   r   r   r   r   r8   r7   r9   r:   Z
fig_bottomZfig_topZfig_leftZ	fig_rights   &&             r   rl   ZSubplotSpec.get_position  s     $$&,,.%%tyy$))&<unM
''/ 	5y !&**,
.$$&?&&($((*	  yJJr   c                sj    V P                  4       p\        VR4      '       d   VP                  4       # V # )zH
Return the topmost `SubplotSpec` instance associated with the subplot.
r<   )r>   r?   r<   )r   r   rv   r   r<   Z#SubplotSpec.get_topmost_subplotspec  s4     $$&86773355Kr   c           	     s    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   rK   rL   )r   rK   rL   ru   rY   )r   Zotherr&   r   __eq__ZSubplotSpec.__eq__  sS     DII6E;9E6684E668466 	7r   c                sZ    \        V P                  V P                  V P                  34      # r   )Zhashr   rK   rL   r   r   r   __hash__ZSubplotSpec.__hash__  s     T^^TYY		:;;r   c                s    \        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   rm   s   &&&,r   subgridspecZSubplotSpec.subgridspec  s    P 'uTDVDDr   )r   r   rK   rL   r   )r   r\   r]   r^   r_   r   r   ra   r   r`   rL   Zsetterr>   r#   r(   r)   r   r   r   r   rl   r<   r   r   r   rb   rc   rd   rf   r   rJ   rJ   	  s     &
>
 * *^ ? ? 
[[ 	0 A A
 ! !'>'>K 	7<(E (Er   rJ   c                   s8   a  ] tR tRt o RtRR ltRR ltRtV tR# )rs   i  zE
Parameters defining the positioning of a subplots grid in a figure.
Nc                s    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.
rp   Nr~   )rj   rq   rr   ro   )r   r.   r0   r/   r1   r2   r3   rD   r|   r   r   ZSubplotParams.__init__  s:    4 JCDs||ocU,CDE JD%f=r   c                sJ   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)r.   r/   r   r0   r1   r2   r3   )r   r.   r0   r/   r1   r2   r3   s   &&&&&&&r   ro   ZSubplotParams.update  s    
 %T499".EDJJ@677)Vt{{?C:677IJ K?H K K r   )r0   r3   r.   r/   r1   r2   )NNNNNN)	r   r\   r]   r^   r_   r   ro   rb   rc   rd   rf   r   rs   rs     s     ><! !r   rs   )r_   rX   ZloggingZnumbersr    Znumpyr4   Z
matplotlibrq   r   r   r   Zmatplotlib.transformsr   Z	getLoggerr   Z_logr   r@   r   rJ   rs   r$   r   r   <module>r      sv   
      : : &"R Rj["| ["|9<l 9<xOE OEd9! 9!r   