Ë
    ¨eh¬T  ã                   ó°   — d Z ddlZddlZddlZddlZddlZddl	m
Z ddlmZ  ej                  e«      Z G d„ d«      Z ej$                  «       Zd„ Zdd„Zy)	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                   ó°   — e Zd ZdZ	 	 	 	 dd„Zd„ Zd„ Zd„ Zd„ Zdd	„Z	d
„ Z
d„ Zd„ Zdd„Zd„ Zd„ Zd„ Zd„ Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd„ Zy)Ú
LayoutGridzG
    Analogous to a gridspec, and contained in another LayoutGrid.
    N©r   r   c                 óÄ  — t         j                  }|| _        || _        |t	        «       z   | _        t        |t        «      r |j
                  › d| j
                  › �| _        || _        || _	        t        j                  |
«      | _        |
€t        j                  |«      | _        t        j                  |	«      | _        |	€t        j                  |«      | _        | j
                  dz   }t        |t        «      st        j                  «       | _        n$ |j"                  | g|¢­Ž  |j                   | _        t        j$                  ||ft&        ¬«      | _        t        j$                  ||ft&        ¬«      | _        i | _        i | _        dD ]$  }t        j0                  |«      | j.                  |<   Œ& | j                   }t3        |«      D �cg c]  } ||› d|› d�«      ‘Œ c}| _        t3        |«      D �cg c]  } ||› d|› d�«      ‘Œ c}| _        dD ]i  }t3        |«      D �cg c]  } ||› d|› d	|› d�«      ‘Œ c}| j,                  |<   t3        |«      D ]$  }|j9                  | j,                  |   |   d
«       Œ& Œk dD ]L  }t        j$                  |t&        ¬«      | j,                  |<   t        j0                  |«      | j.                  |<   ŒN t3        |«      D �cg c]  } ||› d|› d�«      ‘Œ c}| _        t3        |«      D �cg c]  } ||› d|› d�«      ‘Œ c}| _        dD ]i  }t3        |«      D �cg c]  } ||› d|› d	|› d�«      ‘Œ c}| j,                  |<   t3        |«      D ]$  }|j9                  | j,                  |   |   d
«       Œ& Œk | j?                  «        | jA                  |«       || _!        || _"        y c c}w c c}w c c}w c c}w c c}w c c}w )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   r5   r6   r"   r    r   ÚsnÚtodoÚsolÚis                   úT/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/matplotlib/_layoutgrid.pyÚ__init__zLayoutGrid.__init__$   sŒ  € ô —=‘=ˆØ$ˆŒØ(ˆÔØœ6›8‘OˆŒ	Ü�fœjÔ)Ø!Ÿ;™;˜- q¨¯©¨Ð4ˆDŒIØˆŒ
ØˆŒ
ÜŸ]™]¨=Ó9ˆÔØÐ Ü!#§¡¨£ˆDÔÜŸM™M¨,Ó7ˆÔØÐÜ "§¡¨£ˆDÔà�Y‰Y˜‰_ˆÜ˜&¤*Ô-ô Ÿ+™+›-ˆD�KàˆF×Ñ˜TÐ/ JÓ/Ø Ÿ-™-ˆDŒKä—x‘x ¨ ´fÔ=ˆŒÜŸ™ %¨ ´vÔ>ˆŒàˆŒØˆÔà:ò 	5ˆDô &(§X¡X¨e£_ˆD×Ñ˜TÒ"ð	5ð
 �k‰kˆä;@À»<ÖH°a‘h "  V¨A¨3¨aÐ0Õ1ÒHˆŒ
Ü=BÀ5»\ÖJ¸‘x 2 $ g¨a¨S°Ð 2Õ3ÒJˆŒØ:ò 	EˆDä+0°«<ö"9Ø&'ñ #+¨b¨T°¸$¸¸rÀ!ÀÀAÐ+FÕ"Gò "9ˆD�L‰L˜Ñä˜5“\ò E�Ø×#Ñ# D§L¡L°Ñ$6°qÑ$9¸8ÕDñEð	Eð ;ò 	5ˆDÜ!#§¡¨5¼Ô!@ˆD�L‰L˜ÑÜ%'§X¡X¨e£_ˆD×Ñ˜TÒ"ð	5ô @EÀU»|ÖL¸!™ B 4 x°¨s°!Ð!4Õ5ÒLˆŒÜ9>¸u»ÖF°A‘X   E¨!¨¨AÐ.Õ/ÒFˆŒ	Ø:ò 	EˆDä+0°«<ö"9Ø&'ñ #+¨b¨T°¸$¸¸rÀ!ÀÀAÐ+FÕ"Gò "9ˆD�L‰L˜Ñä˜5“\ò E�Ø×#Ñ# D§L¡L°Ñ$6°qÑ$9¸8ÕDñEð	Eð 	×ÑÔØ×Ñ˜VÔ$àˆŒ
Øˆ�
ùò5 IùÚJùò"9ùò MùÚFùò"9s$   ÇOÇ6O	È%OËOÌ	OÌ8Oc                 óê  — d| j                   d›d| j                  › d| j                  › d�}t        | j                  «      D �].  }t        | j                  «      D �]  }||› d|› d| j                  |   j                  «       d›d	| j                  |   j                  «       d›d
| j                  |   j                  «       d›d| j                  |   j                  «       d›d| j                  d   |   j                  «       d›d| j                  d   |   j                  «       d›d| j                  d   |   j                  «       d›d| j                  d   |   j                  «       d›d�z  }�Œ �Œ1 |S )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.   Úvaluer1   r/   r2   r*   )r7   Ústrr<   Újs       r=   Ú__repr__zLayoutGrid.__repr__i   s�  € Ø˜DŸI™I c˜?¨!¨D¯J©J¨<°q¸¿¹¸ÀCÐHˆÜ�t—z‘zÓ"ó 
	FˆAÜ˜4Ÿ:™:Ó&ó 	F�Ø˜!˜˜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’ò	Fð
	Fð ˆ
ó    c                 ó6   — dD ]  }| j                  |d«       Œ y)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)r7   r:   s     r=   r3   zLayoutGrid.reset_marginsx   s#   € ð?ò 	)ˆDà×Ñ˜d CÕ(ñ	)rG   c                 óf   — | j                  «        | j                  |«       | j                  «        y ©N)Úhard_constraintsÚparent_constraintsÚgrid_constraints)r7   r8   s     r=   r4   zLayoutGrid.add_constraints‚   s*   € à×ÑÔà×Ñ Ô'ð 	×ÑÕrG   c                 ó(  — t        | j                  «      D ]±  }| j                  |   | j                  |   k\  | j                  |   | j                  d   |   z
  | j                  d   |   z
  | j                  |   | j                  d   |   z
  | j                  d   |   z
  k\  g}|D ]   }| j
                  j                  |dz  «       Œ" Œ³ t        | j                  «      D ]±  }| j                  |   | j                  |   k\  | j                  |   | j                  d   |   z
  | j                  d   |   z
  | j                  |   | j                  d   |   z
  | j                  d	   |   z
  k\  g}|D ]   }| j
                  j                  |dz  «       Œ" Œ³ y
)zo
        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   r2   r1   )r7   r<   ÚhcÚcs       r=   rL   z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ñ:ñ	:rG   c                 ó–   — || j                   t        j                  t        j                  |«      t        j                  |«      «      <   y rK   )r)   r   Úix_r   )r7   Úchildr<   rE   s       r=   r%   zLayoutGrid.add_child¤   s-   € àDIˆ�‰”b—f‘fœRŸ]™]¨1Ó-¬r¯}©}¸QÓ/?Ó@ÒArG   c                 óT  — t        |t        «      s`| j                  d   |d   k(  | j                  d   |d   |d   z   k(  | j                  d   |d   |d   z   k(  | j
                  d   |d   k(  g}�n“| j                  \  }}t        j                  |«      }t        j                  |«      }|j                  |d      }|j                  |d      }|j                  |d      }|j
                  |d      }| j                  rÀ||j                  d   |d      z  }||j                  d   |d      z  }||j                  d   |d      z  }||j                  d	   |d      z  }||j                  d
   |d      z  }||j                  d   |d      z  }||j                  d   |d      z  }||j                  d   |d      z  }| j                  d   |k(  | j                  d   |k(  | j                  d   |k(  | j
                  d   |k(  g}|D ]   }	| j                  j                  |	dz  «       Œ" y )Nr   éÿÿÿÿé   é   é   r   r   r   r   r   r   r   r   rP   )r   r   r.   r/   r2   r1   r   r   r   r   r*   r$   rQ   )
r7   r8   rR   ÚrowsÚcolsr   r   r   r   rS   s
             r=   rM   zLayoutGrid.parent_constraints¨   sE  € ô
 ˜&¤*Ô-à—*‘*˜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Ñ<Ñ<�Ø�v—~‘~ eÑ,¨T°!©WÑ5Ñ5�Ø�v—~‘~ gÑ.¨t°A©wÑ7Ñ7�Ø˜&Ÿ.™.¨Ñ2°4¸±8Ñ<Ñ<�Ø˜&Ÿ.™.¨Ñ4°T¸"±XÑ>Ñ>�Ø—*‘*˜Q‘- 4Ñ'Ø—+‘+˜b‘/ UÑ*à—)‘)˜A‘, #Ñ%Ø—,‘,˜rÑ" fÑ,ð	.ˆBð
 ò 	6ˆAØ�K‰K×%Ñ% a¨*¡nÕ5ñ	6rG   c                 óì  — | j                   d   | j                  d   d   z
  | j                  d   d   z
  }|| j                  d   z
  | j                  d   d   z
  | j                  d   d   z
  }|| j                  d   z  }t	        d| j
                  «      D ]â  }| j                   |   | j                  d   |   z
  | j                  d   |   z
  }|| j                  |   z
  | j                  d   |   z
  | j                  d   |   z
  }||| j                  |   z  k(  }| j                  j                  |dz  «       | j                   |dz
     | j                  |   k(  }| j                  j                  |dz  «       Œä | j                  d   | j                  d   d   z
  | j                  d	   d   z
  }|| j                  d   z
  | j                  d
   d   z
  | j                  d   d   z
  }|| j                  d   z  }t	        d| j                  «      D ]â  }| j                  |   | j                  d   |   z
  | j                  d	   |   z
  }|| j                  |   z
  | j                  d
   |   z
  | j                  d   |   z
  }||| j                  |   z  k(  }| j                  j                  |dz  «       | j                  |dz
     | j                  |   k(  }| j                  j                  |dz  «       Œä y )Nr   r   r   r   r   rZ   r   r   r   r   r   )r/   r*   r.   r"   r-   r   r$   rQ   r2   r1   r    r   )r7   ÚwÚw0r<   rS   ÚhÚh0s          r=   rN   zLayoutGrid.grid_constraintsÐ   sï  € ð
 �[‰[˜‰^˜dŸl™l¨7Ñ3°AÑ6Ñ6Ø�\‰\˜)Ñ$ QÑ'ñ(ˆà�—‘˜A‘Ñ §¡¨fÑ!5°aÑ!8Ñ8Ø�\‰\˜(Ñ# AÑ&ñ'ˆà�×"Ñ" 1Ñ%Ñ%ˆä�q˜$Ÿ*™*Ó%ò 		4ˆAØ—‘˜Q‘ $§,¡,¨wÑ"7¸Ñ":Ñ:Ø—‘˜iÑ(¨Ñ+ñ,ˆAà�T—Z‘Z ‘]Ñ" T§\¡\°&Ñ%9¸!Ñ%<Ñ<Ø—‘˜hÑ'¨Ñ*ñ+ˆAà�b˜4×,Ñ,¨QÑ/Ñ/Ñ/ˆAØ�K‰K×%Ñ% a¨(¡lÔ3à—‘˜Q ™UÑ# t§z¡z°!¡}Ñ4ˆAØ�K‰K×%Ñ% a¨(¡lÕ3ð		4ð �I‰I�a‰L˜4Ÿ<™<¨Ñ.¨qÑ1Ñ1°D·L±LÀÑ4IÈ!Ñ4LÑLˆØ�—‘˜a‘Ñ  4§<¡<°Ñ#9¸!Ñ#<Ñ<Ø�\‰\˜*Ñ% aÑ(ñ)ˆà�×#Ñ# AÑ&Ñ&ˆä�q˜$Ÿ*™*Ó%ò 		4ˆAØ—‘˜1‘ §¡¨UÑ 3°AÑ 6Ñ6Ø—‘˜gÑ& qÑ)ñ*ˆAà�T—\‘\ !‘_Ñ$ t§|¡|°HÑ'=¸aÑ'@Ñ@Ø—‘˜jÑ)¨!Ñ,ñ-ˆAà�b˜4×-Ñ-¨aÑ0Ñ0Ñ0ˆAØ�K‰K×%Ñ% a¨(¡lÔ3à—‘˜a !™eÑ$¨¯	©	°!©Ñ4ˆAØ�K‰K×%Ñ% a¨(¡lÕ3ñ		4rG   c                 ó€   — | j                   j                  | j                  |   |   |«       || j                  |   |<   y)aŸ  
        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+   ©r7   r:   ÚsizeÚcells       r=   Úedit_marginzLayoutGrid.edit_marginú   s;   € ð  	�‰× Ñ  §¡¨dÑ!3°DÑ!9¸4Ô@Ø'+ˆ×Ñ˜Ñ˜tÒ$rG   c                 óV   — || j                   |   |   kD  r| j                  |||«       yy)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+   rh   re   s       r=   Úedit_margin_minzLayoutGrid.edit_margin_min  s3   € ð$ �$×"Ñ" 4Ñ(¨Ñ.Ò.Ø×Ñ˜T 4¨Õ.ð /rG   c                 óv   — t        t        | j                  |   «      «      D ]  }| j                  |||«       Œ y)a1  
        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+   rh   ©r7   r:   rf   r<   s       r=   rI   zLayoutGrid.edit_margins"  s:   € ô ”s˜4×+Ñ+¨DÑ1Ó2Ó3ò 	,ˆAØ×Ñ˜T 4¨Õ+ñ	,rG   c                 óv   — t        t        | j                  |   «      «      D ]  }| j                  |||«       Œ y)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-   rl   r+   rj   rm   s       r=   Úedit_all_margins_minzLayoutGrid.edit_all_margins_min2  s:   € ô  ”s˜4×+Ñ+¨DÑ1Ó2Ó3ò 	0ˆAØ× Ñ   t¨QÕ/ñ	0rG   c                 ó¼  — | j                  d|d   |j                  j                  «       | j                  d|d   |j                  j                  «       | j                  d|d   |j                  j                  dz
  «       | j                  d|d   |j                  j                  dz
  «       | j                  d|d   |j                  j                  «       | j                  d|d   |j                  j                  «       | j                  d|d   |j                  j                  dz
  «       | j                  d	|d	   |j                  j                  dz
  «       y
)a<  
        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   rZ   r   r   r   r   r   N)rj   ÚcolspanÚstartÚstopÚrowspan)r7   ÚmarginÚsss      r=   Úedit_outer_margin_minsz!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õ	2rG   c                 ó&   — | j                   |   |   S )z"Return the margin at this position)r+   )r7   r:   Úcols      r=   Úget_marginszLayoutGrid.get_margins^  s   € à×Ñ Ñ% cÑ*Ð*rG   c                 óz  — t        j                  |«      }t        j                  |«      }t        j                  | j                  |d      j                  «       | j                  |d      j                  «       | j                  |d      j                  «       | j                  |d      j                  «       «      }|S )z�
        Return the outer bounding box of the subplot specs
        given by rows and cols.  rows and cols can be spans.
        r   rX   )	r   r   r   Úfrom_extentsr.   rC   r1   r/   r2   ©r7   r\   r]   Úbboxs       r=   Úget_outer_bboxzLayoutGrid.get_outer_bboxb  s›   € ô
 �}‰}˜TÓ"ˆÜ�}‰}˜TÓ"ˆä× Ñ Ø�J‰J�t˜A‘wÑ×%Ñ%Ó'Ø�L‰L˜˜b™Ñ"×(Ñ(Ó*Ø�K‰K˜˜R™Ñ!×'Ñ'Ó)Ø�I‰I�d˜1‘gÑ×$Ñ$Ó&ó	(ˆð
 ˆrG   c           	      óº  — t        j                  |«      }t        j                  |«      }t        j                  | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  d   |d      j                  «       z   | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  d   |d      j                  «       z   | j                  |d      j                  «       | j                  d   |d      j                  «       z
  | j                  d   |d      j                  «       z
  | j                  |d      j                  «       | j                  d	   |d      j                  «       z
  | j                  d
   |d      j                  «       z
  «      }|S )z�
        Return the inner bounding box of the subplot specs
        given by rows and cols.  rows and cols can be spans.
        r   r   r   rX   r   r   r   r   r   r   ©
r   r   r   r|   r.   rC   r*   r1   r/   r2   r}   s       r=   Úget_inner_bboxz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ó
ˆð ˆrG   c           	      óš  — t        j                  |«      }t        j                  |«      }t        j                  | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  |d      j                  «       | j                  d   |d      j                  «       z
  | j                  |d      j                  «       | j                  d   |d      j                  «       z
  «      }|S )zj
        Return the bounding box that includes the
        decorations but, *not* the colorbar...
        r   r   rX   r   r   r   r�   r}   s       r=   Úget_bbox_for_cbz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ó	
ˆð ˆrG   c                 óR  — t        j                  |«      }t        j                  |«      }t        j                  | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  |d      j                  «       | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  d   |d      j                  «       z   | j                  |d      j                  «       «      }|S )ú‡
        Return the left margin bounding box of the subplot specs
        given by rows and cols.  rows and cols can be spans.
        r   r   rX   r   )	r   r   r   r|   r.   rC   r*   r1   r2   r}   s       r=   Úget_left_margin_bboxz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Ñ×%Ñ%Ó'ó*ˆð ˆrG   c           	      óR  — t        j                  |«      }t        j                  |«      }t        j                  | j                  |d      j                  «       | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  |d      j                  «       | j                  |d      j                  «       | j                  d   |d      j                  «       z   | j                  d   |d      j                  «       z   «      }|S )r†   r   rX   r   r   )	r   r   r   r|   r.   rC   r1   r*   r/   r}   s       r=   Úget_bottom_margin_bboxz!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óˆð ˆrG   c                 óR  — t        j                  |«      }t        j                  |«      }t        j                  | j                  |d      j                  «       | j                  d   |d      j                  «       z
  | j                  d   |d      j                  «       z
  | j                  |d      j                  «       | j                  |d      j                  «       | j                  d   |d      j                  «       z
  | j                  |d      j                  «       «      }|S )r†   rX   r   r   r   )	r   r   r   r|   r/   rC   r*   r1   r2   r}   s       r=   Úget_right_margin_bboxz 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Ñ×%Ñ%Ó'ó*ˆð ˆrG   c           	      óR  — t        j                  |«      }t        j                  |«      }t        j                  | j                  |d      j                  «       | j                  |d      j                  «       | j                  d   |d      j                  «       z
  | j                  |d      j                  «       | j                  |d      j                  «       | j                  d   |d      j                  «       z
  | j                  d   |d      j                  «       z
  «      }|S )r†   r   r   rX   r   )	r   r   r   r|   r.   rC   r2   r*   r/   r}   s       r=   Úget_top_margin_bboxz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ˆð ˆrG   c                 ó8   — | j                   j                  «        y)zR
        Update the variables for the solver attached to this layoutgrid.
        N)r$   ÚupdateVariables)r7   s    r=   Úupdate_variableszLayoutGrid.update_variablesæ  s   € ð 	�‰×#Ñ#Õ%rG   )
Nr   FÚ rZ   rZ   NNNN)r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r>   rF   r3   r4   rL   r%   rM   rN   rh   rj   rI   ro   rw   rz   r   r‚   r„   r‡   r‰   r‹   r�   r�   © rG   r=   r   r      sˆ   „ ñð 06Ø=>Ø6:Ø#óCòJò)ò ò:ó2Jò&6òP%4òT,ó&/ò*,ò 0ò&2ò2+óóó0ó(ó$ó&ó$ó$&rG   r   c                  ó&   — dt        t        «      z  S )z5Generate a short sequential id for layoutbox objects.z%06d)ÚnextÚ_layoutboxobjnumr–   rG   r=   r   r   ï  s   € à”DÔ)Ó*Ñ*Ð*rG   c                 ó^  — |€$| j                  «       j                  | «      }||    }t        j                  d   j	                  «       d   }||   }t        |j                  «      D �]–  }t        |j                  «      D �]z  }|j                  ||¬«      }| j                  t        j                  |j                  |j                  |j                  dddd| j                  d¬	«	      «       |j!                  ||¬«      }	| j                  t        j                  |	j                  |	j                  |	j                  d
|d| j                  d¬«      «       |j#                  ||¬«      }	| j                  t        j                  |	j                  |	j                  |	j                  dddg d¢| j                  d¬«	      «       |j%                  ||¬«      }	| j                  t        j                  |	j                  |	j                  |	j                  dddg d¢| j                  d¬«	      «       |j'                  ||¬«      }	| j                  t        j                  |	j                  |	j                  |	j                  dddg d¢| j                  d¬«	      «       |j)                  ||¬«      }	| j                  t        j                  |	j                  |	j                  |	j                  dddg d¢| j                  d¬«	      «       �Œ} �Œ™ |j*                  j,                  D ]  }
|
€Œt/        | |
|dz   ¬«       Œ y)z(Simple plotting to show where boxes are.Nzaxes.prop_cycleÚcolor)r\   r]   rZ   z0.7çš™™™™™É?éýÿÿÿ)Ú	linewidthÚ	edgecolorÚ	facecolorÚalphaÚ	transformÚzorderrY   Ú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Úcolorsry   r<   rE   ÚbbÚbbiÚchs              r=   r¶   r¶   ô  s½  € à	€zØ×,Ñ,Ó.×6Ñ6°sÓ;ˆØ˜#ÑˆÜ�\‰\Ð+Ñ,×3Ñ3Ó5°gÑ>€FØ
�‰-€CÜ�2—8‘8‹_ó %JˆÜ�r—x‘x“ó $	Jˆ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°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°aÐ(Ó8ˆCØ�N‰NÜ×"Ñ" 3§6¡6¨3¯9©9°c·j±jÈAØ-3¸3Ú-<Ø-0¯_©_ÀRôIöJòA$	Jð%JðL �k‰k×Ñò 2ˆØ‰>Ü˜#˜r¨¨q©Ö1ñ2rG   )Nr   )r•   Ú	itertoolsÚ
kiwisolverr   ÚloggingÚnumpyr   Ú
matplotlibr«   Úmatplotlib.patchesÚpatchesr¯   Úmatplotlib.transformsr   Ú	getLoggerr’   Ú_logr   Úcountr™   r   r¶   r–   rG   r=   ú<module>rÉ      s[   ðñó$ Û Û Û ã Ý %Ý &à€w×Ñ˜Ó"€÷K&ñ K&ðZ #�9—?‘?Ó$Ð ò+ô
/2rG   