ó
    {ñ:i¬T  ã                   ó²   • S r SSKrSSKrSSKrSSKrSSKrSSK	J
r  SSKJr  \R                  " \5      r " S S5      r\R$                  " 5       rS rSS jrg)	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                   óÌ   • \ rS rSrSr    SS jrS rS rS rS	 r	SS
 jr
S rS rS rSS jrS rS rS rS rSS jrSS jrSS jrSS jrSS jrSS jrSS jrS rSrg)Ú
LayoutGridé   z?
Analogous to a gridspec, and contained in another LayoutGrid.
N©r   r   c                 ó  • [         R                  nX l        X0l        U[	        5       -   U l        [        U[        5      (       a   UR
                   SU R
                   3U l        X`l        XPl	        [        R                  " U
5      U l        U
c  [        R                  " U5      U l        [        R                  " U	5      U l        U	c  [        R                  " U5      U l        U R
                  S-   n[        U[        5      (       d  [         R                  " 5       U l        O$UR"                  " U /UQ76   UR                   U l        [        R$                  " Xe4[&        S9U l        [        R$                  " Xe4[&        S9U l        0 U l        0 U l        S H&  n[        R0                  " U5      U R.                  U'   M(     U R                   n[3        U5       Vs/ s H  oû" U SU S35      PM     snU l        [3        U5       Vs/ s H  oû" U SU S35      PM     snU l        S Ho  n[3        U5       Vs/ s H  nU" U SU S	U S35      PM     snU R,                  U'   [3        U5       H%  nUR9                  U R,                  U   U   S
5        M'     Mq     S HL  n[        R$                  " U[&        S9U R,                  U'   [        R0                  " U5      U R.                  U'   MN     [3        U5       Vs/ s H  oû" U SU S35      PM     snU l        [3        U5       Vs/ s H  oû" U SU S35      PM     snU l        S Ho  n[3        U5       Vs/ s H  nU" U SU S	U S35      PM     snU R,                  U'   [3        U5       H%  nUR9                  U R,                  U   U   S
5        M'     Mq     U R?                  5         U RA                  U5        Xpl!        X€l"        g s  snf s  snf s  snf s  snf s  snf s  snf )NÚ.Ú_)Údtype)ÚleftÚrightÚleftcbÚrightcbzlefts[Ú]zrights[zmargins[z][Ústrong)ÚbottomÚtopÚbottomcbÚtopcbzbottoms[ztops[)#Ú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   r6   r7   r#   r!   r   ÚsnÚtodoÚsolÚis                   ÚY/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/matplotlib/_layoutgrid.pyÚ__init__ÚLayoutGrid.__init__$   st  € ô —=‘=ˆØ$ŒØ(ÔØœ6›8‘OˆŒ	Ü�fœj×)Ñ)Ø!Ÿ;™;˜- q¨¯©¨Ð4ˆDŒIØŒ
ØŒ
ÜŸ]š]¨=Ó9ˆÔØÑ Ü!#§¢¨£ˆDÔÜŸMšM¨,Ó7ˆÔØÑÜ "§¢¨£ˆDÔà�Y‰Y˜‰_ˆÜ˜&¤*×-Ñ-ô Ÿ+š+›-ˆD�Kà×Ò˜TÐ/ JÓ/Ø Ÿ-™-ˆDŒKä—x’x  ´fÑ=ˆŒÜŸš % ´vÑ>ˆŒàˆŒØˆÔã:ˆDô &(§X¢X¨e£_ˆD×Ñ˜TÓ"ñ ;ð
 �k‰kˆä;@À¼<ÓHº<°a�h "  V¨A¨3¨aÐ0Ö1¹<ÑHˆŒ
Ü=BÀ5¼\ÓJº\¸�x 2 $ g¨a¨S°Ð 2Ö3¹\ÑJˆŒÛ:ˆDä+0°¬<ó"9Ú+7 añ #+¨b¨T°¸$¸¸rÀ!ÀÀAÐ+FÖ"GÙ+7ñ"9ˆD�L‰L˜Ñä˜5–\�Ø×#Ñ# D§L¡L°Ñ$6°qÑ$9¸8ÖDó "ñ ;ó ;ˆDÜ!#§¢¨5¼Ñ!@ˆD�L‰L˜ÑÜ%'§X¢X¨e£_ˆD×Ñ˜TÓ"ñ ;ô @EÀU¼|ÓLº|¸!˜ B 4 x°¨s°!Ð!4Ö5¹|ÑLˆŒÜ9>¸u¼ÓFº°A�X   E¨!¨¨AÐ.Ö/¹ÑFˆŒ	Û:ˆDä+0°¬<ó"9Ú+7 añ #+¨b¨T°¸$¸¸rÀ!ÀÀAÐ+FÖ"GÙ+7ñ"9ˆD�L‰L˜Ñä˜5–\�Ø×#Ñ# D§L¡L°Ñ$6°qÑ$9¸8ÖDó "ñ ;ð 	×ÑÔØ×Ñ˜VÔ$àŒ
Ø�
ùò5 IùÚJùò"9ùò MùÚFùò"9s$   ÇO#ÈO(È3O-Ë5O2Ì!O7ÍO<c                 óð  • SU R                   S SU R                   SU R                   S3n[        U R                  5       GH0  n[        U R                  5       GH  nX SU SU R                  U   R                  5       S S	U R                  U   R                  5       S S
U R                  U   R                  5       S SU R                  U   R                  5       S SU R                  S   U   R                  5       S SU R                  S   U   R                  5       S SU R                  S   U   R                  5       S SU R                  S   U   R                  5       S S3-  nGM     GM3     U$ )NzLayoutBox: Ú25sÚ Úxz,
z, z: Lz1.3fz, Bz, Rz, Tz, MLr   z, MRr   z, MBr   z, MTr   z, 
)
r   r   r   r.   r/   Úvaluer2   r0   r3   r+   )r8   Ústrr=   Újs       r>   Ú__repr__ÚLayoutGrid.__repr__i   s}  € Ø˜DŸI™I c˜?¨!¨D¯J©J¨<°q¸¿¹¸ÀCÐHˆÜ�t—z‘z×"ˆAÜ˜4Ÿ:™:×&�Ø˜˜B˜q˜cð "ØŸ:™: a™=×.Ñ.Ó0°Ð6ð 7ØŸ<™<¨™?×0Ñ0Ó2°4Ð8ð 9ØŸ;™; q™>×/Ñ/Ó1°$Ð7ð 8ØŸ9™9 Q™<×-Ñ-Ó/°Ð5ð 6Ø ŸL™L¨Ñ0°Ñ3×9Ñ9Ó;¸DÐAð BØ ŸL™L¨Ñ1°!Ñ4×:Ñ:Ó<¸TÐBð CØ ŸL™L¨Ñ2°1Ñ5×;Ñ;Ó=¸dÐCð DØ ŸL™L¨Ñ/°Ñ2×8Ñ8Ó:¸4Ð@ÀðFñ F“ô 'ñ #ð ˆ
ó    c                 ó:   • S H  nU R                  US5        M     g)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.
)r   r   r   r   r   r   r   r   g        N)Úedit_margins)r8   r;   s     r>   r4   ÚLayoutGrid.reset_marginsx   s   € ó?ˆDà×Ñ˜d CÖ(ò?rJ   c                 óf   • U R                  5         U R                  U5        U R                  5         g ©N)Úhard_constraintsÚparent_constraintsÚgrid_constraints)r8   r9   s     r>   r5   ÚLayoutGrid.add_constraints‚   s*   € à×ÑÔà×Ñ Ô'ð 	×ÑÕrJ   c                 ó8  • [        U R                  5       H´  nU R                  U   U R                  U   :¬  U R                  U   U R                  S   U   -
  U R                  S   U   -
  U R                  U   U R                  S   U   -
  U R                  S   U   -
  :¬  /nU H!  nU R
                  R                  US-  5        M#     M¶     [        U R                  5       H´  nU R                  U   U R                  U   :¬  U R                  U   U R                  S   U   -
  U R                  S   U   -
  U R                  U   U R                  S   U   -
  U R                  S	   U   -
  :¬  /nU H!  nU R
                  R                  US-  5        M#     M¶     g
)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   r0   r/   r+   r%   ÚaddConstraintr   r3   r2   )r8   r=   ÚhcÚcs       r>   rP   ÚLayoutGrid.hard_constraints‹   sˆ  € ô
 �t—z‘zÖ"ˆAØ—+‘+˜a‘. D§J¡J¨q¡MÑ1Ø—;‘;˜q‘> D§L¡L°Ñ$9¸!Ñ$<Ñ<Ø—L‘L Ñ+¨AÑ.ñ/à—J‘J˜q‘M D§L¡L°Ñ$8¸Ñ$;Ñ;Ø—L‘L Ñ*¨1Ñ-ñ.ñ.ðˆBó �Ø—‘×)Ñ)¨!¨j©.Ö9ó ñ #ô �t—z‘zÖ"ˆAØ—)‘)˜A‘, $§,¡,¨q¡/Ñ1Ø—9‘9˜Q‘< $§,¡,¨uÑ"5°aÑ"8Ñ8Ø—L‘L Ñ)¨!Ñ,ñ-à—L‘L ‘O d§l¡l°8Ñ&<¸QÑ&?Ñ?Ø—L‘L Ñ,¨QÑ/ñ0ñ0ðˆBó �Ø—‘×)Ñ)¨!¨j©.Ö9ó ò #rJ   c                 óš   • XR                   [        R                  " [        R                  " U5      [        R                  " U5      5      '   g rO   )r*   r   Úix_r    )r8   Úchildr=   rG   s       r>   r&   ÚLayoutGrid.add_child¤   s+   € àDI�‰”b—f’fœRŸ]š]¨1Ó-¬r¯}ª}¸QÓ/?Ó@ÒArJ   c                 ó^  • [        U[        5      (       d`  U R                  S   US   :H  U R                  S   US   US   -   :H  U R                  S   US   US   -   :H  U R
                  S   US   :H  /nGO‘U R                  u  p4[        R                  " U5      n[        R                  " U5      nUR                  US      nUR                  US      nUR                  US      nUR
                  US      nU R                  (       a¸  XQR                  S   US      -  nXQR                  S   US      -  nXaR                  S   US      -  nXaR                  S	   US      -  nXqR                  S
   US      -  nXqR                  S   US      -  nX�R                  S   US      -  nX�R                  S   US      -  nU R                  S   U:H  U R                  S   U:H  U R                  S   U:H  U R
                  S   U:H  /nU H!  n	U R                  R                  U	S-  5        M#     g )Nr   éÿÿÿÿé   é   é   r   r   r   r   r   r   r   r   rU   )r   r   r/   r0   r3   r2   r   r   r    r   r+   r%   rV   )
r8   r9   rW   ÚrowsÚcolsr   r   r   r   rX   s
             r>   rQ   ÚLayoutGrid.parent_constraints¨   s1  € ô
 ˜&¤*×-Ñ-à—*‘*˜Q‘- 6¨!¡9Ñ,Ø—+‘+˜b‘/ V¨A¡Y°¸±Ñ%:Ñ:à—)‘)˜A‘, &¨¡)¨f°Q©iÑ"7Ñ7Ø—,‘,˜rÑ" f¨Q¡iÑ/ð	1ŠBð Ÿ™‰JˆDÜ—=’= Ó&ˆDÜ—=’= Ó&ˆDà—<‘<  Q¡Ñ(ˆDØ—M‘M $ r¡(Ñ+ˆEØ—+‘+˜d 1™gÑ&ˆCØ—^‘^ D¨¡HÑ-ˆFØ× × ð Ÿ™ vÑ.¨t°A©wÑ7Ñ7�ØŸ™ xÑ0°°a±Ñ9Ñ9�ØŸ™¨Ñ0°°b±Ñ:Ñ:�ØŸ™¨	Ñ2°4¸±8Ñ<Ñ<�Ø—~‘~ eÑ,¨T°!©WÑ5Ñ5�Ø—~‘~ gÑ.¨t°A©wÑ7Ñ7�ØŸ.™.¨Ñ2°4¸±8Ñ<Ñ<�ØŸ.™.¨Ñ4°T¸"±XÑ>Ñ>�Ø—*‘*˜Q‘- 4Ñ'Ø—+‘+˜b‘/ UÑ*à—)‘)˜A‘, #Ñ%Ø—,‘,˜rÑ" fÑ,ð	.ˆBó
 ˆAØ�K‰K×%Ñ% a¨*¡nÖ5ò rJ   c                 óä  • U R                   S   U R                  S   S   -
  U R                  S   S   -
  nXR                  S   -
  U R                  S   S   -
  U R                  S   S   -
  nXR                  S   -  n[	        SU R
                  5       Há  nU R                   U   U R                  S   U   -
  U R                  S   U   -
  nXR                  U   -
  U R                  S   U   -
  U R                  S   U   -
  nXU R                  U   -  :H  nU R                  R                  US-  5        U R                   US-
     U R                  U   :H  nU R                  R                  US-  5        Mã     U R                  S   U R                  S   S   -
  U R                  S	   S   -
  nXPR                  S   -
  U R                  S
   S   -
  U R                  S   S   -
  nXPR                  S   -  n[	        SU R                  5       Há  nU R                  U   U R                  S   U   -
  U R                  S	   U   -
  nXPR                  U   -
  U R                  S
   U   -
  U R                  S   U   -
  nXVU R                  U   -  :H  nU R                  R                  US-  5        U R                  US-
     U R                  U   :H  nU R                  R                  US-  5        Mã     g )Nr   r   r   r   r   ra   r   r   r   r   r   )r0   r+   r/   r#   r.   r   r%   rV   r3   r2   r!   r   )r8   ÚwÚw0r=   rX   ÚhÚh0s          r>   rR   ÚLayoutGrid.grid_constraintsÐ   sÕ  € ð
 �[‰[˜‰^˜dŸl™l¨7Ñ3°AÑ6Ñ6Ø�\‰\˜)Ñ$ QÑ'ñ(ˆà—‘˜A‘Ñ §¡¨fÑ!5°aÑ!8Ñ8Ø�\‰\˜(Ñ# AÑ&ñ'ˆà×"Ñ" 1Ñ%Ñ%ˆä�q˜$Ÿ*™*Ö%ˆAØ—‘˜Q‘ $§,¡,¨wÑ"7¸Ñ":Ñ:Ø—‘˜iÑ(¨Ñ+ñ,ˆAà—Z‘Z ‘]Ñ" T§\¡\°&Ñ%9¸!Ñ%<Ñ<Ø—‘˜hÑ'¨Ñ*ñ+ˆAà˜4×,Ñ,¨QÑ/Ñ/Ñ/ˆAØ�K‰K×%Ñ% a¨(¡lÔ3à—‘˜Q ™UÑ# t§z¡z°!¡}Ñ4ˆAØ�K‰K×%Ñ% a¨(¡lÖ3ñ &ð �I‰I�a‰L˜4Ÿ<™<¨Ñ.¨qÑ1Ñ1°D·L±LÀÑ4IÈ!Ñ4LÑLˆØ—‘˜a‘Ñ  4§<¡<°Ñ#9¸!Ñ#<Ñ<Ø�\‰\˜*Ñ% aÑ(ñ)ˆà×#Ñ# AÑ&Ñ&ˆä�q˜$Ÿ*™*Ö%ˆAØ—‘˜1‘ §¡¨UÑ 3°AÑ 6Ñ6Ø—‘˜gÑ& qÑ)ñ*ˆAà—\‘\ !‘_Ñ$ t§|¡|°HÑ'=¸aÑ'@Ñ@Ø—‘˜jÑ)¨!Ñ,ñ-ˆAà˜4×-Ñ-¨aÑ0Ñ0Ñ0ˆAØ�K‰K×%Ñ% a¨(¡lÔ3à—‘˜a !™eÑ$¨¯	©	°!©Ñ4ˆAØ�K‰K×%Ñ% a¨(¡lÖ3ò &rJ   c                 ó~   • U R                   R                  U R                  U   U   U5        X R                  U   U'   g)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,   ©r8   r;   ÚsizeÚcells       r>   Úedit_marginÚLayoutGrid.edit_marginú   s9   € ð  	�‰× Ñ  §¡¨dÑ!3°DÑ!9¸4Ô@Ø'+×Ñ˜Ñ˜tÒ$rJ   c                 óT   • X R                   U   U   :”  a  U R                  XU5        gg)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,   rq   rn   s       r>   Úedit_margin_minÚLayoutGrid.edit_margin_min  s/   € ð$ ×"Ñ" 4Ñ(¨Ñ.Ó.Ø×Ñ˜T¨Õ.ð /rJ   c                 óx   • [        [        U R                  U   5      5       H  nU R                  XU5        M     g)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,   rq   ©r8   r;   ro   r=   s       r>   rL   ÚLayoutGrid.edit_margins"  s3   € ô ”s˜4×+Ñ+¨DÑ1Ó2Ö3ˆAØ×Ñ˜T¨Ö+ò 4rJ   c                 óx   • [        [        U R                  U   5      5       H  nU R                  XU5        M     g)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.   rw   r,   rt   rx   s       r>   Úedit_all_margins_minÚLayoutGrid.edit_all_margins_min2  s3   € ô  ”s˜4×+Ñ+¨DÑ1Ó2Ö3ˆAØ× Ñ  ¨QÖ/ò 4rJ   c                 ó¼  • U R                  SUS   UR                  R                  5        U R                  SUS   UR                  R                  5        U R                  SUS   UR                  R                  S-
  5        U R                  SUS   UR                  R                  S-
  5        U R                  SUS   UR                  R                  5        U R                  SUS   UR                  R                  5        U R                  SUS   UR                  R                  S-
  5        U R                  S	US	   UR                  R                  S-
  5        g
)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   ra   r   r   r   r   r   N)rt   ÚcolspanÚstartÚstopÚrowspan)r8   ÚmarginÚsss      r>   Úedit_outer_margin_minsÚ!LayoutGrid.edit_outer_margin_minsE  s  € ð 	×Ñ˜V V¨F¡^°R·Z±Z×5EÑ5EÔFØ×Ñ˜X v¨hÑ'7¸¿¹×9IÑ9IÔJØ×Ñ˜W f¨W¡o°r·z±z·±ÈÑ7JÔKØ×Ñ˜Y¨¨yÑ(9¸2¿:¹:¿?¹?ÈQÑ;NÔOà×Ñ˜U F¨5¡M°2·:±:×3CÑ3CÔDØ×Ñ˜W f¨W¡o°r·z±z×7GÑ7GÔHØ×Ñ˜X v¨hÑ'7¸¿¹¿¹È1Ñ9LÔMØ×Ñ˜Z¨°
Ñ);ØŸZ™ZŸ_™_¨qÑ0õ	2rJ   c                 ó&   • U R                   U   U   $ )z"Return the margin at this position)r,   )r8   r;   Úcols      r>   Úget_marginsÚLayoutGrid.get_margins^  s   € à×Ñ Ñ% cÑ*Ð*rJ   c                 ó€  • [         R                  " U5      n[         R                  " U5      n[        R                  " U R                  US      R                  5       U R                  US      R                  5       U R                  US      R                  5       U R                  US      R                  5       5      nU$ )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    r   Úfrom_extentsr/   rE   r2   r0   r3   ©r8   rc   rd   Úbboxs       r>   Úget_outer_bboxÚLayoutGrid.get_outer_bboxb  s›   € ô
 �}Š}˜TÓ"ˆÜ�}Š}˜TÓ"ˆä× Ò Ø�J‰J�t˜A‘wÑ×%Ñ%Ó'Ø�L‰L˜˜b™Ñ"×(Ñ(Ó*Ø�K‰K˜˜R™Ñ!×'Ñ'Ó)Ø�I‰I�d˜1‘gÑ×$Ñ$Ó&ó	(ˆð
 ˆrJ   c           	      óÀ  • [         R                  " U5      n[         R                  " U5      n[        R                  " U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  S   US      R                  5       -   U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  S   US      R                  5       -   U R                  US      R                  5       U R                  S   US      R                  5       -
  U R                  S   US      R                  5       -
  U R                  US      R                  5       U R                  S	   US      R                  5       -
  U R                  S
   US      R                  5       -
  5      nU$ )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‹   r/   rE   r+   r2   r0   r3   rŒ   s       r>   Úget_inner_bboxÚLayoutGrid.get_inner_bboxq  s¹  € ô
 �}Š}˜TÓ"ˆÜ�}Š}˜TÓ"ˆä× Ò Ø�Z‰Z˜˜Q™Ñ ×&Ñ&Ó(Ø—‘˜VÑ$ T¨!¡WÑ-×3Ñ3Ó5ñ6à—‘˜XÑ& t¨A¡wÑ/×5Ñ5Ó7ñ8ð �\‰\˜$˜r™(Ñ#×)Ñ)Ó+Ø—‘˜XÑ& t¨B¡xÑ0×6Ñ6Ó8ñ9à—‘˜ZÑ(¨¨b©Ñ2×8Ñ8Ó:ñ;ð �[‰[˜˜b™Ñ"×(Ñ(Ó*Ø—‘˜WÑ% d¨2¡hÑ/×5Ñ5Ó7ñ8à—‘˜YÑ'¨¨R©Ñ1×7Ñ7Ó9ñ:ð �Y‰Y�t˜A‘wÑ×%Ñ%Ó'Ø—‘˜UÑ# D¨¡GÑ,×2Ñ2Ó4ñ5à—‘˜WÑ% d¨1¡gÑ.×4Ñ4Ó6ñ7ó
ˆð ˆrJ   c           	      ó   • [         R                  " U5      n[         R                  " U5      n[        R                  " U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  US      R                  5       U R                  S   US      R                  5       -
  U R                  US      R                  5       U R                  S   US      R                  5       -
  5      nU$ )zR
Return the bounding box that includes the
decorations but, *not* the colorbar...
r   r   r_   r   r   r   r‘   rŒ   s       r>   Úget_bbox_for_cbÚLayoutGrid.get_bbox_for_cb‰  s'  € ô
 �}Š}˜TÓ"ˆÜ�}Š}˜TÓ"ˆä× Ò Ø�Z‰Z˜˜Q™Ñ ×&Ñ&Ó(Ø—‘˜XÑ& t¨A¡wÑ/×5Ñ5Ó7ñ8à�\‰\˜$˜r™(Ñ#×)Ñ)Ó+Ø—‘˜ZÑ(¨¨b©Ñ2×8Ñ8Ó:ñ;à�[‰[˜˜b™Ñ"×(Ñ(Ó*Ø—‘˜YÑ'¨¨R©Ñ1×7Ñ7Ó9ñ:à�Y‰Y�t˜A‘wÑ×%Ñ%Ó'Ø—‘˜WÑ% d¨1¡gÑ.×4Ñ4Ó6ñ7ó	
ˆð ˆrJ   c                 óX  • [         R                  " U5      n[         R                  " U5      n[        R                  " U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  US      R                  5       U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  S   US      R                  5       -   U R                  US      R                  5       5      nU$ )ú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‹   r/   rE   r+   r2   r3   rŒ   s       r>   Úget_left_margin_bboxÚLayoutGrid.get_left_margin_bbox�  s  € ô
 �}Š}˜TÓ"ˆÜ�}Š}˜TÓ"ˆä× Ò Ø�Z‰Z˜˜Q™Ñ ×&Ñ&Ó(Ø—‘˜XÑ& t¨A¡wÑ/×5Ñ5Ó7ñ8à�\‰\˜$˜r™(Ñ#×)Ñ)Ó+Ø�Z‰Z˜˜Q™Ñ ×&Ñ&Ó(Ø—‘˜XÑ& t¨A¡wÑ/×5Ñ5Ó7ñ8à—‘˜VÑ$ T¨!¡WÑ-×3Ñ3Ó5ñ6ð �Y‰Y�t˜A‘wÑ×%Ñ%Ó'ó*ˆð ˆrJ   c           	      óX  • [         R                  " U5      n[         R                  " U5      n[        R                  " U R                  US      R                  5       U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  US      R                  5       U R                  US      R                  5       U R                  S   US      R                  5       -   U R                  S   US      R                  5       -   5      nU$ )r˜   r   r_   r   r   )	r   r    r   r‹   r/   rE   r2   r+   r0   rŒ   s       r>   Úget_bottom_margin_bboxÚ!LayoutGrid.get_bottom_margin_bbox¯  s  € ô
 �}Š}˜TÓ"ˆÜ�}Š}˜TÓ"ˆä× Ò Ø�Z‰Z˜˜Q™Ñ ×&Ñ&Ó(Ø�\‰\˜$˜r™(Ñ#×)Ñ)Ó+Ø�\‰\˜*Ñ% d¨2¡hÑ/×5Ñ5Ó7ñ8à�[‰[˜˜b™Ñ"×(Ñ(Ó*Ø�\‰\˜$˜r™(Ñ#×)Ñ)Ó+Ø—‘˜XÑ& t¨B¡xÑ0×6Ñ6Ó8ñ9à�\‰\˜*Ñ% d¨2¡hÑ/×5Ñ5Ó7ñ8óˆð ˆrJ   c                 óX  • [         R                  " U5      n[         R                  " U5      n[        R                  " U R                  US      R                  5       U R                  S   US      R                  5       -
  U R                  S   US      R                  5       -
  U R                  US      R                  5       U R                  US      R                  5       U R                  S   US      R                  5       -
  U R                  US      R                  5       5      nU$ )r˜   r_   r   r   r   )	r   r    r   r‹   r0   rE   r+   r2   r3   rŒ   s       r>   Úget_right_margin_bboxÚ LayoutGrid.get_right_margin_bboxÂ  s  € ô
 �}Š}˜TÓ"ˆÜ�}Š}˜TÓ"ˆä× Ò Ø�[‰[˜˜b™Ñ"×(Ñ(Ó*Ø—‘˜WÑ% d¨2¡hÑ/×5Ñ5Ó7ñ8à—‘˜YÑ'¨¨R©Ñ1×7Ñ7Ó9ñ:ð �\‰\˜$˜r™(Ñ#×)Ñ)Ó+Ø�[‰[˜˜b™Ñ"×(Ñ(Ó*Ø—‘˜YÑ'¨¨R©Ñ1×7Ñ7Ó9ñ:à�Y‰Y�t˜A‘wÑ×%Ñ%Ó'ó*ˆð ˆrJ   c           	      óX  • [         R                  " U5      n[         R                  " U5      n[        R                  " U R                  US      R                  5       U R                  US      R                  5       U R                  S   US      R                  5       -
  U R                  US      R                  5       U R                  US      R                  5       U R                  S   US      R                  5       -
  U R                  S   US      R                  5       -
  5      nU$ )r˜   r   r   r_   r   )	r   r    r   r‹   r/   rE   r3   r+   r0   rŒ   s       r>   Úget_top_margin_bboxÚLayoutGrid.get_top_margin_bboxÔ  s  € ô
 �}Š}˜TÓ"ˆÜ�}Š}˜TÓ"ˆä× Ò Ø�Z‰Z˜˜Q™Ñ ×&Ñ&Ó(Ø�Y‰Y�t˜A‘wÑ×%Ñ%Ó'Ø—‘˜WÑ% d¨1¡gÑ.×4Ñ4Ó6ñ7à�[‰[˜˜b™Ñ"×(Ñ(Ó*Ø�Y‰Y�t˜A‘wÑ×%Ñ%Ó'Ø—‘˜WÑ% d¨1¡gÑ.×4Ñ4Ó6ñ7à—‘˜UÑ# D¨¡GÑ,×2Ñ2Ó4ñ5ó7ˆð ˆrJ   c                 ó8   • U R                   R                  5         g)zB
Update the variables for the solver attached to this layoutgrid.
N)r%   ÚupdateVariables)r8   s    r>   Úupdate_variablesÚLayoutGrid.update_variablesæ  s   € ð 	�‰×#Ñ#Õ%rJ   )r)   r2   r*   r6   r!   r/   r,   r+   r   r   r   r   r   r0   r%   r3   r7   r#   )
Nr   FÚ ra   ra   NNNN)r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r?   rH   r4   r5   rP   r&   rQ   rR   rq   rt   rL   r{   r„   rˆ   rŽ   r’   r•   r™   rœ   rŸ   r¢   r¦   Ú__static_attributes__© rJ   r>   r   r      sˆ   † ñð 06Ø=>Ø6:Ø#ôCòJò)ò ò:ô2Jò&6òP%4òT,ô&/ò*,ò 0ò&2ò2+ôôô0ô(ô$ô&ô$õ$&rJ   r   c                  ó&   • S[        [        5      -  $ )z5Generate a short sequential id for layoutbox objects.z%06d)ÚnextÚ_layoutboxobjnumr¯   rJ   r>   r   r   ï  s   € à”DÔ)Ó*Ñ*Ð*rJ   c                 ó  • Uc#  U R                  5       R                  U 5      nX0   n[        R                  S   R	                  5       S   nXB   n[        UR                  5       GHu  n[        UR                  5       GHW  nUR                  XgS9nU R                  [        R                  " UR                  UR                  UR                  SSSSU R                  SS	9	5        UR!                  XgS9n	U R                  [        R                  " U	R                  U	R                  U	R                  S
USU R                  SS95        UR#                  XgS9n	U R                  [        R                  " U	R                  U	R                  U	R                  SSS/ SQU R                  SS9	5        UR%                  XgS9n	U R                  [        R                  " U	R                  U	R                  U	R                  SSS/ SQU R                  SS9	5        UR'                  XgS9n	U R                  [        R                  " U	R                  U	R                  U	R                  SSS/ SQU R                  SS9	5        UR)                  XgS9n	U R                  [        R                  " U	R                  U	R                  U	R                  SSS/ SQU R                  SS9	5        GMZ     GMx     UR*                  R,                   H  n
U
c  M  [/        X
US-   S9  M     g)z(Simple plotting to show where boxes are.Nzaxes.prop_cycleÚcolor)rc   rd   ra   z0.7çš™™™™™É?éýÿÿÿ)Ú	linewidthÚ	edgecolorÚ	facecolorÚalphaÚ	transformÚzorderr`   Únoneéþÿÿÿ)r·   r¸   r¹   r»   r¼   r   )ç      à?çffffffæ?r¿   )r·   r¸   rº   r¹   r»   r¼   )rÀ   r¿   r¿   )r¿   r¿   rÀ   )rÀ   rµ   rÀ   )Úlevel)Ú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=   rG   ÚbbÚbbiÚchs              r>   rÏ   rÏ   ô  s˜  € à	�zØ×,Ñ,Ó.×6Ñ6°sÓ;ˆØÑˆÜ�\‰\Ð+Ñ,×3Ñ3Ó5°gÑ>€FØ
‰-€CÜ�2—8‘8�_ˆÜ�r—x‘x—ˆAØ×"Ñ"¨Ð"Ð2ˆBØ�N‰NÜ×"Ò" 2§5¡5¨"¯(©(°B·I±IÈØ-2¸eØ),¸¿¹Ø*,ñ.ô/ð
 ×#Ñ#¨Ð#Ð3ˆCØ�N‰NÜ×"Ò" 3§6¡6¨3¯9©9°c·j±jÈAØ-0¸FØ-0¯_©_ÀRñIôJð
 ×)Ñ)¨qÐ)Ð9ˆCØ�N‰NÜ×"Ò" 3§6¡6¨3¯9©9°c·j±jÈAØ-3¸3Ú-<Ø-0¯_©_ÀRñIôJð
 ×*Ñ*°Ð*Ð:ˆCØ�N‰NÜ×"Ò" 3§6¡6¨3¯9©9°c·j±jÈAØ-3¸3Ú-<Ø-0¯_©_ÀRñIôJð
 ×+Ñ+°Ð+Ð;ˆCØ�N‰NÜ×"Ò" 3§6¡6¨3¯9©9°c·j±jÈAØ-3¸3Ú-<Ø-0¯_©_ÀRñIôJð
 ×(Ñ(¨aÐ(Ð8ˆCØ�N‰NÜ×"Ò" 3§6¡6¨3¯9©9°c·j±jÈAØ-3¸3Ú-<Ø-0¯_©_ÀRñI÷JôA !ñ ðL �k‰k×ÔˆØ‹>Ü˜#¨¨q©Ô1ò rJ   )Nr   )r­   Ú	itertoolsÚ
kiwisolverr   ÚloggingÚnumpyr   Ú
matplotlibrÄ   Úmatplotlib.patchesÚpatchesrÈ   Úmatplotlib.transformsr   Ú	getLoggerr©   Ú_logr   Úcountr²   r   rÏ   r¯   rJ   r>   Ú<module>râ      sW   ðñó$ Û Û Û ã Ý %Ý &à×Ò˜Ó"€÷K&ñ K&ðZ —?’?Ó$Ð ò+õ
/2rJ   