+
    iT                         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                      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                D   \         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 ).N_)dtypezlefts[]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_ratiosoneswidth_ratiosSolversolver	add_childemptyobjectartistschildrenmarginsmargin_valszerosrangeleftsrightsaddEditVariablebottomstopsreset_marginsadd_constraintsh_padw_pad)selfparentr   r   r   r   r   r3   r4   r    r   r   sntodosolis   &&&&&&&&&&&     v/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/_layoutgrid.py__init__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                X   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: 25s xz,
z, z: Lz1.3fz, Bz, Rz, Tz, MLr   z, MRr   z, MBr   z, MTr   z, 
)
r   r   r   r+   r,   valuer/   r-   r0   r(   )r5   strr:   js   &   r;   __repr__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                <    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)r5   r8   s   & r;   r1   LayoutGrid.reset_marginsx   s    ?DdC(?rG   c                h    V P                  4        V P                  V4       V P                  4        R # N)hard_constraintsparent_constraintsgrid_constraints)r5   r6   s   &&r;   r2   LayoutGrid.add_constraints   s*    ' 	rG   c                J   \        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   r0   r/   )r5   r:   hccs   &   r;   rM   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  #rG   c                    WP                   \        P                  ! \        P                  ! V4      \        P                  ! V4      4      &   R # rL   )r'   r   ix_r   )r5   childr:   rD   s   &&&&r;   r#   LayoutGrid.add_child   s+    DIbffR]]1-r}}Q/?@ArG   c                .   \        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   rR   N)r   r   r,   r-   r0   r/   r   r   r   r   r(   r"   rS   )
r5   r6   rT   rowscolsr   r   r   r   rU   s
   &&        r;   rN   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 rG   c                ^   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"   rS   r0   r/   r   r   )r5   ww0r:   rU   hh0s   &      r;   rO   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 &rG   c                    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"   suggestValuer(   r)   r5   r8   sizecells   &&&&r;   edit_marginLayoutGrid.edit_margin   s9      	  d!3D!94@'+t$rG   c                j    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)   rl   ri   s   &&&&r;   edit_margin_minLayoutGrid.edit_margin_min  s/    $ ""4(..T. /rG   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)   rl   r5   r8   rj   r:   s   &&& r;   rI   LayoutGrid.edit_margins"  s3     s4++D123AT+ 4rG   c                    \        \        V P                  V,          4      4       F  pV P                  WV4       K  	  R# )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+   rr   r)   ro   rs   s   &&& r;   edit_all_margins_minLayoutGrid.edit_all_margins_min2  s3      s4++D123A  Q/ 4rG   c                   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)ro   colspanstartstoprowspan)r5   marginsss   &&&r;   edit_outer_margin_mins!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	2rG   c                6    V P                   V,          V,          # )z"Return the margin at this position)r)   )r5   r8   cols   &&&r;   get_marginsLayoutGrid.get_margins^  s    %c**rG   c                   \         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,   rB   r/   r-   r0   r5   r^   r_   bboxs   &&& r;   get_outer_bboxLayoutGrid.get_outer_bboxb  s    
 }}T"}}T"  JJtAw%%'LLb"((*KKR!'')IId1g$$&	(
 rG   c           	         \         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   r   r,   rB   r(   r/   r-   r0   r   s   &&& r;   get_inner_bbox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
 rG   c           	     `   \         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]   r   r   s   &&& r;   get_bbox_for_cb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	
 rG   c                   \         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   r   r,   rB   r(   r/   r0   r   s   &&& r;   get_left_margin_bbox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%%'* rG   c           	        \         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# )r   r   r   r]   )	r   r   r   r   r,   rB   r/   r(   r-   r   s   &&& r;   get_bottom_margin_bbox!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 rG   c                   \         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# )r   r   r   r]   )	r   r   r   r   r-   rB   r(   r/   r0   r   s   &&& r;   get_right_margin_bbox 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%%'* rG   c           	        \         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# )r   r   r   r]   )	r   r   r   r   r,   rB   r0   r(   r-   r   s   &&& r;   get_top_margin_bbox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 rG   c                :    V P                   P                  4        R# )zB
Update the variables for the solver attached to this layoutgrid.
N)r"   updateVariables)r5   s   &r;   update_variablesLayoutGrid.update_variables  s     	##%rG   )r&   r/   r'   r3   r   r,   r)   r(   r   r   r   r   r   r-   r"   r0   r4   r    r\   r\   )
Nr   F    r   NNNN)r\   )__name__
__module____qualname____firstlineno____doc__r<   rE   r1   r2   rM   r#   rN   rO   rl   ro   rI   rv   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r;   r   r      s     CJ) :2J&6P%4T,&/*, 0&22+0($&$$& &rG   r   c                 .    R\        \        4      ,          # )z5Generate a short sequential id for layoutbox objects.z%06d)next_layoutboxobjnum rG   r;   r   r     s    D)***rG   c                   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_cyclecolor)r^   r_   z0.7皙?)	linewidth	edgecolor	facecoloralpha	transformzordernone)r   r   r   r   r   )r   r   r   r   r   r   )level)      ?ffffff?r   )r   r   r   )r   r   r   )r   r   r   )get_layout_engineexecutemplrcParamsby_keyr+   r   r   r   
add_artistmpatches	Rectanglep0widthheighttransFigurer   r   r   r   r   r'   flatplot_children)figlgr   _layoutgridscolorsr   r:   rD   bbbbichs   &&&        r;   r   r     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 rG   )Nr\   )r   	itertools
kiwisolverr   loggingnumpyr   
matplotlibr   matplotlib.patchespatchesr   matplotlib.transformsr   	getLoggerr   _logr   countr   r   r   r   rG   r;   <module>r      sW   $      % &"K& K&Z ??$ +
/2rG   