+
     ]iT  c                   s    R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t ^ RIHt ]P                  ! ]4      t ! R R4      t]P$                  ! 4       tR tRR ltR# )a  
A layoutgrid is a nrows by ncols set of boxes, meant to be used by
`._constrained_layout`, each box is analogous to a subplotspec element of
a gridspec.

Each box is defined by left[ncols], right[ncols], bottom[nrows] and top[nrows],
and by two editable margins for each side.  The main margin gets its value
set by the size of ticklabels, titles, etc on each Axes that is in the figure.
The outer margin is the padding around the Axes, and space for any
colorbars.

The "inner" widths and heights of these boxes are then constrained to be the
same (relative the values of `width_ratios[ncols]` and `height_ratios[nrows]`).

The layoutgrid is then constrained to be contained within a parent layoutgrid,
its column(s) and row(s) specified when it is created.
N)Bboxc                   s   a  ] tR t^t o RtRR ltR tR tR tR t	RR lt
R	 tR
 tR tRR ltR tR tR tR tRR ltRR ltRR ltRR ltRR ltRR ltRR ltR tRtV tR# )
LayoutGridz?
Analogous to a gridspec, and contained in another LayoutGrid.
Nc                sD   \         P                  pW n        W0n        V\	        4       ,           V n        \        V\        4      '       d!   VP
                   R V P
                   2V n        W`n        WPn	        \        P                  ! V
4      V n        V
f   \        P                  ! V4      V n        \        P                  ! V	4      V n        V	f   \        P                  ! V4      V n        V P
                  R,           p\        V\        4      '       g   \         P                  ! 4       V n        M%VP"                  ! V .VO5!   VP                   V n        \        P$                  ! We3\&        R7      V n        \        P$                  ! We3\&        R7      V n        / V n        / V n        R F&  p\        P0                  ! V4      V P.                  V&   K(  	  V P                   p\3        V4       Uu. uF  q! V RV R24      NK  	  upV n        \3        V4       Uu. uF  q! V RV R24      NK  	  upV n        R Fv  p\3        V4       Uu. uF  pV! V RV RV R24      NK  	  upV P,                  V&   \3        V4       F-  pVP9                  V P,                  V,          V,          R	4       K/  	  Kx  	  R FO  p\        P$                  ! V\&        R7      V P,                  V&   \        P0                  ! V4      V P.                  V&   KQ  	  \3        V4       Uu. uF  q! V R
V R24      NK  	  upV n        \3        V4       Uu. uF  q! V RV R24      NK  	  upV n        R Fv  p\3        V4       Uu. uF  pV! V RV RV R24      NK  	  upV P,                  V&   \3        V4       F-  pVP9                  V P,                  V,          V,          R	4       K/  	  Kx  	  V P?                  4        V PA                  V4       Wpn!        Wn"        R# u upi u upi u upi u upi u upi u upi )Z.NZ_)Zdtypezlefts[Z]zrights[zmargins[z][strongzbottoms[ztops[)leftrightleftcbrightcb)bottomtopbottomcbtopcb)#kiwiVariable
parent_posparent_innerseq_idname
isinstancer   nrowsncolsnp
atleast_1dheight_ratiosZoneswidth_ratiosZSolversolver	add_childZemptyZobjectartistschildrenmarginsmargin_valsZzerosrangeleftsrightsZaddEditVariablebottomstopsreset_marginsadd_constraintsh_padw_pad)selfparentr   r   r   r   r   r%   r&   r   r   r   ZsntodoZsolis   &&&&&&&&&&&     =/usr/lib64/python3.14/site-packages/matplotlib/_layoutgrid.py__init__ZLayoutGrid.__init__$   st    ==$(68O	fj))!;;-q4DI

]]=9 !#DMM,7 "DYY_&*-- ++-DKT/J/ --DKxxf=%v>:D &(XXe_DT" ;
 kk;@<H<ah"VA3a01<H
=B5\J\x2$gaS 23\J:D+0<"9+7a #+bT$r!A+F"G+7"9DLL5\##DLL$6q$98D " ; ;D!#5!@DLL%'XXe_DT" ; @EU|L|!B4xs!!45|L9>uFAXE!A./F	:D+0<"9+7a #+bT$r!A+F"G+7"9DLL5\##DLL$6q$98D " ; 	V$

5 IJ"9 MF"9s$   )PP	PP;P+Pc                sX   R V P                   R RV P                   RV P                   R2p\        V P                  4       EFd  p\        V P                  4       EFF  pW RV RV P                  V,          P                  4       R RV P                  V,          P                  4       R R	V P                  V,          P                  4       R R
V P                  V,          P                  4       R RV P                  R,          V,          P                  4       R RV P                  R,          V,          P                  4       R RV P                  R,          V,          P                  4       R RV P                  R,          V,          P                  4       R R2,          pEKI  	  EKg  	  V# )zLayoutBox: Z25sZ Zxz,
z, z: Lz1.3fz, Bz, Rz, Tz, MLr   z, MRr   z, MBr   z, MTr   z, 
)
r   r   r   r   r   valuer!   r    r"   r   )r'   Zstrr*   j   &   r+   __repr__ZLayoutGrid.__repr__i   s}   DIIc?!DJJ<qCHtzz"A4::&Bqc "::a=..06 7<<?00248 9;;q>//1$7 899Q<--/5 6 LL0399;DA B LL1!4::<TB C LL215;;=dC D LL/288:4@F F ' # 
    c                s<    R F  pV P                  VR4       K  	  R# )z
Reset all the margins to zero.  Must do this after changing
figure size, for instance, because the relative size of the
axes labels etc changes.
g        N)r   r   r   r   r   r   r	   r
   )edit_margins)r'   r)   s   & r+   r#   ZLayoutGrid.reset_marginsx   s    ?DdC(?r1   c                sh    V P                  4        V P                  V4       V P                  4        R # N)hard_constraintsparent_constraintsgrid_constraints)r'   r(   s   &&r+   r$   ZLayoutGrid.add_constraints   s*    ' 	r1   c                sJ   \        V P                  4       F  pV P                  V,          V P                  V,          8  V P                  V,          V P                  R,          V,          ,
          V P                  R,          V,          ,
          V P                  V,          V P                  R,          V,          ,
          V P                  R,          V,          ,
          8  .pV F%  pV P
                  P                  VR,          4       K'  	  K  	  \        V P                  4       F  pV P                  V,          V P                  V,          8  V P                  V,          V P                  R,          V,          ,
          V P                  R,          V,          ,
          V P                  V,          V P                  R,          V,          ,
          V P                  R	,          V,          ,
          8  .pV F%  pV P
                  P                  VR,          4       K'  	  K  	  R
# )zW
These are the redundant constraints, plus ones that make the
rest of the code easier.
r   r   r   r   requiredr   r
   r   r	   N)
r   r   r    r   r   r   addConstraintr   r"   r!   )r'   r*   hccr/   r+   r4   ZLayoutGrid.hard_constraints   s   
 tzz"A++a.DJJqM1;;q>DLL$9!$<<LL+A./JJqMDLL$8$;;LL*1-..B ))!j.9  # tzz"A))A,$,,q/199Q<$,,u"5a"88LL)!,-LLOdll8&<Q&??LL,Q/00B ))!j.9  #r1   c                s    WP                   \        P                  ! \        P                  ! V4      \        P                  ! V4      4      &   R # r3   )r   r   Zix_r   )r'   Zchildr*   r.      &&&&r+   r   ZLayoutGrid.add_child   s+    DIbffR]]1-r}}Q/?@Ar1   c                s.   \        V\        4      '       g   V P                  ^ ,          V^ ,          8H  V P                  R,          V^ ,          V^,          ,           8H  V P                  ^ ,          V^,          V^,          ,           8H  V P
                  R,          V^,          8H  .pEMCV P                  w  r4\        P                  ! V4      p\        P                  ! V4      pVP                  V^ ,          ,          pVP                  VR,          ,          pVP                  V^ ,          ,          pVP
                  VR,          ,          pV P                  '       Ed9   WQP                  R,          V^ ,          ,          ,          pWQP                  R,          V^ ,          ,          ,          pWaP                  R,          VR,          ,          ,          pWaP                  R,          VR,          ,          ,          pWqP                  R,          V^ ,          ,          ,          pWqP                  R,          V^ ,          ,          ,          pWP                  R,          VR,          ,          ,          pWP                  R,          VR,          ,          ,          pV P                  ^ ,          V8H  V P                  R,          V8H  V P                  ^ ,          V8H  V P
                  R,          V8H  .pV F%  p	V P                  P                  V	R	,          4       K'  	  R
# )    r   r   r   r   r   r
   r   r	   r7   N)r   r   r   r    r"   r!   r   r   r   r   r   r   r8   )
r'   r(   r9   rowscolsr   r   r   r   r:   s
   &&        r+   r5   ZLayoutGrid.parent_constraints   s4   
 &*--**Q-6!9,++b/VAY%::))A,&)fQi"77,,r"fQi/	1B JD==&D==&D<<Q(DMM$r(+E++d1g&C^^DH-F    v.tAw77x0a990b::	248<<~~e,T!W55~~g.tAw77..248<<..4T"X>>**Q-4'++b/U*))A,#%,,r"f,	.B
 AKK%%a*n5 r1   c                s^   V P                   ^ ,          V P                  R,          ^ ,          ,
          V P                  R,          ^ ,          ,
          pWP                  ^ ,          ,
          V P                  R,          ^ ,          ,
          V P                  R,          ^ ,          ,
          pWP                  ^ ,          ,          p\	        ^V P
                  4       EF:  pV P                   V,          V P                  R,          V,          ,
          V P                  R,          V,          ,
          pWP                  V,          ,
          V P                  R,          V,          ,
          V P                  R,          V,          ,
          pWV P                  V,          ,          8H  pV P                  P                  VR,          4       V P                   V^,
          ,          V P                  V,          8H  pV P                  P                  VR,          4       EK=  	  V P                  ^ ,          V P                  R,          ^ ,          ,
          V P                  R,          ^ ,          ,
          pWPP                  ^ ,          ,
          V P                  R,          ^ ,          ,
          V P                  R	,          ^ ,          ,
          pWPP                  ^ ,          ,          p\	        ^V P                  4       EF:  pV P                  V,          V P                  R,          V,          ,
          V P                  R,          V,          ,
          pWPP                  V,          ,
          V P                  R,          V,          ,
          V P                  R	,          V,          ,
          pWVV P                  V,          ,          8H  pV P                  P                  VR,          4       V P                  V^,
          ,          V P                  V,          8H  pV P                  P                  VR,          4       EK=  	  R
# )r<   r   r   r   r   r   r   r
   r   r	   N)r    r   r   r   r   r   r   r8   r"   r!   r   r   )r'   ZwZw0r*   r:   ZhZh0s   &      r+   r6   ZLayoutGrid.grid_constraints   s   
 [[^dll73A66\\)$Q'(Af!5a!88\\(#A&'""1%%q$**%AQ$,,w"7"::i(+,AZZ]"T\\&%9!%<<h'*+A4,,Q///AKK%%a(l3QU#tzz!}4AKK%%a(l3 & IIaL4<<.q11DLL4I!4LLa 4<<#9!#<<\\*%a()##A&&q$**%A1U 3A 66g&q)*A\\!_$t||H'=a'@@j)!,-A4--a000AKK%%a(l3a!e$		!4AKK%%a(l3 &r1   c                s    V P                   P                  V P                  V,          V,          V4       W P                  V,          V&   R# )aG  
Change the size of the margin for one cell.

Parameters
----------
todo : string (one of 'left', 'right', 'bottom', 'top')
    margin to alter.

size : float
    Size of the margin.  If it is larger than the existing minimum it
    updates the margin size. Fraction of figure size.

cell : int
    Cell column or row to edit.
N)r   ZsuggestValuer   r   r'   r)   sizeZcellr;   r+   edit_marginZLayoutGrid.edit_margin   s9      	  d!3D!94@'+t$r1   c                sj    W P                   V,          V,          8  d   V P                  WV4       R# R# )a\  
Change the minimum size of the margin for one cell.

Parameters
----------
todo : string (one of 'left', 'right', 'bottom', 'top')
    margin to alter.

size : float
    Minimum size of the margin .  If it is larger than the
    existing minimum it updates the margin size. Fraction of
    figure size.

cell : int
    Cell column or row to edit.
N)r   rB   r@   r;   r+   edit_margin_minZLayoutGrid.edit_margin_min  s/    $ ""4(..T. /r1   c                    \        \        V P                  V,          4      4       F  pV P                  WV4       K  	  R# )z
Change the size of all the margin of all the cells in the layout grid.

Parameters
----------
todo : string (one of 'left', 'right', 'bottom', 'top')
    margin to alter.

size : float
    Size to set the margins.  Fraction of figure size.
N)r   lenr   rB   r'   r)   rA   r*      &&& r+   r2   ZLayoutGrid.edit_margins"  s3     s4++D123AT+ 4r1   c                rD   )a@  
Change the minimum size of all the margin of all
the cells in the layout grid.

Parameters
----------
todo : {'left', 'right', 'bottom', 'top'}
    The margin to alter.

size : float
    Minimum size of the margin.  If it is larger than the
    existing minimum it updates the margin size. Fraction of
    figure size.
N)r   rE   r   rC   rF   rG   r+   edit_all_margins_minZLayoutGrid.edit_all_margins_min2  s3      s4++D123A  Q/ 4r1   c                s   V P                  RVR,          VP                  P                  4       V P                  RVR,          VP                  P                  4       V P                  RVR,          VP                  P                  ^,
          4       V P                  RVR,          VP                  P                  ^,
          4       V P                  RVR,          VP                  P                  4       V P                  RVR,          VP                  P                  4       V P                  RVR,          VP                  P                  ^,
          4       V P                  RVR,          VP                  P                  ^,
          4       R	# )
z
Edit all four margin minimums in one statement.

Parameters
----------
margin : dict
    size of margins in a dict with keys 'left', 'right', 'bottom',
    'top'

ss : SubplotSpec
    defines the subplotspec these margins should be applied to
r   r   r   r   r   r
   r   r	   N)rC   ZcolspanZstartZstopZrowspan)r'   ZmarginZss   &&&r+   edit_outer_margin_minsZ!LayoutGrid.edit_outer_margin_minsE  s    	VVF^RZZ5E5EFXvh'79I9IJWfWorzz7JKYy(92::??Q;NOUF5M2::3C3CDWfWorzz7G7GHXvh'719LMZ
);ZZ__q0	2r1   c                s6    V P                   V,          V,          # )z"Return the margin at this position)r   )r'   r)   colrI   r+   get_marginsZLayoutGrid.get_margins^  s    %c**r1   c                s   \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V P                  V^ ,          ,          P                  4       V P                  VR,          ,          P                  4       V P                  VR,          ,          P                  4       V P                  V^ ,          ,          P                  4       4      pV# )zi
Return the outer bounding box of the subplot specs
given by rows and cols.  rows and cols can be spans.
r=   )	r   r   r    from_extentsr   r-   r!   r    r"   r'   r>   r?   ZbboxrG   r+   get_outer_bboxZLayoutGrid.get_outer_bboxb  s    
 }}T"}}T"  JJtAw%%'LLb"((*KKR!'')IId1g$$&	(
 r1   c           	     s    \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,           V P                  R,          V^ ,          ,          P                  4       ,           V P                  VR	,          ,          P                  4       V P                  R,          VR	,          ,          P                  4       ,           V P                  R,          VR	,          ,          P                  4       ,           V P                  VR	,          ,          P                  4       V P                  R,          VR	,          ,          P                  4       ,
          V P                  R,          VR	,          ,          P                  4       ,
          V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,
          V P                  R,          V^ ,          ,          P                  4       ,
          4      pV# )
zi
Return the inner bounding box of the subplot specs
given by rows and cols.  rows and cols can be spans.
r   r   r   r	   r   r   r   r
   r=   
r   r   r    rM   r   r-   r   r!   r    r"   rN   rG   r+   get_inner_bboxZLayoutGrid.get_inner_bboxq  s   
 }}T"}}T"  ZZQ &&(V$T!W-3356X&tAw/5578 \\$r(#))+X&tBx06689Z(b288:; [[b"((*W%d2h/5578Y'R1779: YYtAw%%'U#DG,2245W%d1g.4467
 r1   c           	     s`   \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,           V P                  VR,          ,          P                  4       V P                  R,          VR,          ,          P                  4       ,           V P                  VR,          ,          P                  4       V P                  R,          VR,          ,          P                  4       ,
          V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,
          4      pV# )zR
Return the bounding box that includes the
decorations but, *not* the colorbar...
r   r	   r   r
   r=   rP   rN   rG   r+   get_bbox_for_cbZLayoutGrid.get_bbox_for_cb  s'   
 }}T"}}T"  ZZQ &&(X&tAw/5578\\$r(#))+Z(b288:;[[b"((*Y'R1779:YYtAw%%'W%d1g.4467	
 r1   c                s   \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,           V P                  VR,          ,          P                  4       V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,           V P                  R,          V^ ,          ,          P                  4       ,           V P                  V^ ,          ,          P                  4       4      pV# )o
Return the left margin bounding box of the subplot specs
given by rows and cols.  rows and cols can be spans.
r   r   r=   )	r   r   r    rM   r   r-   r   r!   r"   rN   rG   r+   get_left_margin_bboxZLayoutGrid.get_left_margin_bbox  s   
 }}T"}}T"  ZZQ &&(X&tAw/5578\\$r(#))+ZZQ &&(X&tAw/5578V$T!W-3356 YYtAw%%'* r1   c           	     s   \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V P                  V^ ,          ,          P                  4       V P                  VR,          ,          P                  4       V P                  R,          VR,          ,          P                  4       ,           V P                  VR,          ,          P                  4       V P                  VR,          ,          P                  4       V P                  R,          VR,          ,          P                  4       ,           V P                  R,          VR,          ,          P                  4       ,           4      pV# )rS   r	   r   r=   )	r   r   r    rM   r   r-   r!   r   r    rN   rG   r+   get_bottom_margin_bboxZ!LayoutGrid.get_bottom_margin_bbox  s   
 }}T"}}T"  ZZQ &&(\\$r(#))+\\*%d2h/5578[[b"((*\\$r(#))+X&tBx06689\\*%d2h/5578 r1   c                s   \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V P                  VR,          ,          P                  4       V P                  R,          VR,          ,          P                  4       ,
          V P                  R,          VR,          ,          P                  4       ,
          V P                  VR,          ,          P                  4       V P                  VR,          ,          P                  4       V P                  R,          VR,          ,          P                  4       ,
          V P                  V^ ,          ,          P                  4       4      pV# )rS   r   r   r=   )	r   r   r    rM   r    r-   r   r!   r"   rN   rG   r+   get_right_margin_bboxZ LayoutGrid.get_right_margin_bbox  s   
 }}T"}}T"  [[b"((*W%d2h/5578Y'R1779: \\$r(#))+[[b"((*Y'R1779:YYtAw%%'* r1   c           	     s   \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V P                  V^ ,          ,          P                  4       V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,
          V P                  VR,          ,          P                  4       V P                  V^ ,          ,          P                  4       V P                  R,          V^ ,          ,          P                  4       ,
          V P                  R,          V^ ,          ,          P                  4       ,
          4      pV# )rS   r
   r   r=   )	r   r   r    rM   r   r-   r"   r   r    rN   rG   r+   get_top_margin_bboxZLayoutGrid.get_top_margin_bbox  s   
 }}T"}}T"  ZZQ &&(YYtAw%%'W%d1g.4467[[b"((*YYtAw%%'W%d1g.4467U#DG,22457 r1   c                s:    V P                   P                  4        R# )zB
Update the variables for the solver attached to this layoutgrid.
N)r   ZupdateVariables)r'   s   &r+   update_variablesZLayoutGrid.update_variables  s     	##%r1   )r   r!   r   r%   r   r   r   r   r   r   r   r   r   r    r   r"   r&   r   r<   r<   )
NrY   FZ    rZ   NNNN)r<   )__name__Z
__module__Z__qualname__Z__firstlineno____doc__r,   r0   r#   r$   r4   r   r5   r6   rB   rC   r2   rH   rJ   rL   rO   rQ   rR   rT   rU   rV   rW   rX   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r+   r   r      s     CJ) :2J&6P%4T,&/*, 0&22+0($&$$& &r1   r   c                 s.    R\        \        4      ,          # )z5Generate a short sequential id for layoutbox objects.z%06d)Znext_layoutboxobjnum r1   r+   r   r     s    D)***r1   c                s   Vf(   V P                  4       P                  V 4      pW0,          p\        P                  R,          P	                  4       R,          pWB,          p\        VP                  4       EF  p\        VP                  4       EF{  pVP                  WgR7      pV P                  \        P                  ! VP                  VP                  VP                  ^RRRV P                  RR7	      4       VP!                  WgR7      p	V P                  \        P                  ! V	P                  V	P                  V	P                  ^VRV P                  RR	7      4       VP#                  WgR7      p	V P                  \        P                  ! V	P                  V	P                  V	P                  ^ RR. ROV P                  RR
7	      4       VP%                  WgR7      p	V P                  \        P                  ! V	P                  V	P                  V	P                  ^ RR. ROV P                  RR
7	      4       VP'                  WgR7      p	V P                  \        P                  ! V	P                  V	P                  V	P                  ^ RR. ROV P                  RR
7	      4       VP)                  WgR7      p	V P                  \        P                  ! V	P                  V	P                  V	P                  ^ RR. ROV P                  RR
7	      4       EK~  	  EK  	  VP*                  P,                   F  p
V
f   K	  \/        W
V^,           R7       K  	  R# )z(Simple plotting to show where boxes are.Nzaxes.prop_cycleZcolor)r>   r?   z0.7皙?)	linewidth	edgecolor	facecoloralpha	transformzorderZnone)r`   ra   rb   rd   re   )r`   ra   rc   rb   rd   re   )levelii)      ?ffffff?rg   )rh   rg   rg   )rg   rg   rh   )rh   r_   rh   )Zget_layout_engineZexecutemplZrcParamsZby_keyr   r   r   rO   Z
add_artistmpatchesZ	RectangleZp0ZwidthZheightZtransFigurerQ   rT   rV   rU   rW   r   Zflatplot_children)ZfigZlgrf   Z_layoutgridsZcolorsrK   r*   r.   ZbbZbbiZchs   &&&        r+   rk   rk     s   	z,,.66s;\\+,335g>F
-C288_rxxA"""2BNN""255"((BII-2e),*,./
 ###3CNN""366399cjjA-0F-0__RIJ
 ))q)9CNN""366399cjjA-33-<-0__RIJ
 ***:CNN""366399cjjA-33-<-0__RIJ
 +++;CNN""366399cjjA-33-<-0__RIJ
 ((a(8CNN""366399cjjA-33-<-0__RIJA ! L kk>#q1 r1   )Nr<   )r\   Z	itertoolsZ
kiwisolverr   ZloggingZnumpyr   Z
matplotlibri   Zmatplotlib.patchesZpatchesrj   Zmatplotlib.transformsr    Z	getLoggerr[   Z_logr   Zcountr]   r   rk   r^   r1   r+   <module>rl      sW   $      % &"K& K&Z ??$ +
/2r1   