o
    ä¸Gf{X  ã                
   @   s  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
 d dlmZ d dlmZmZ d‡dd„Zdˆdd	„Zed
gƒdd„ ƒZedgƒdd„ ƒZedgƒdd„ ƒZedgƒdd„ ƒZedgdddd„ ƒZedgdddd„ ƒZdd„ Zd d!„ Zed"gƒd#d$„ ƒZed%gƒd&d'„ ƒZed(gƒd)d*„ ƒZed+gƒd,d-„ ƒZed.gƒd/d0„ ƒZed1gƒd2d3„ ƒZed4gd5dd6d7„ ƒZ ed8gƒd9d:„ ƒZ!ed;gƒd<d=„ ƒZ"ed>gƒd?d@„ ƒZ#edAgƒdBdC„ ƒZ$dDdE„ Z%dFdG„ Z&dHdI„ Z'dJdK„ Z(dLdM„ Z)dNdO„ Z*edPgdQdRdSdTdU„ ƒZ+dVdW„ Z,dXdY„ Z-edZgdRd[d\d]„ ƒZ.ed^gdRd[d_d`„ ƒZ/dadb„ Z0edcgdQdRdddeidfdgdh„ ƒZ1edigdQdRdde 2djd gdkdlgg¡idfdmdn„ ƒZ3dodp„ Z4dqdr„ Z5dsdt„ Z6dudv„ Z7dwdx„ Z8dydz„ Z9d{d|„ Z:ej; <d}d~di dQfd€didQfg¡dd‚„ ƒZ=dƒd„„ Z>d…d†„ Z?dS )‰é    N)Úimage_comparison)ÚgridspecÚtickeré   Fc                 C   sd   |   ddg¡ | jdd |s&| jd|d | jd|d | jd|d d S |  g ¡ |  g ¡ d S )	Né   é   é   ©Znbinsúx-label©Úfontsizeúy-labelÚTitle)ÚplotZlocator_paramsÚ
set_xlabelÚ
set_ylabelÚ	set_titleÚset_xticklabelsÚset_yticklabels)Úaxr   Únodec© r   úGlib/python3.10/site-packages/matplotlib/tests/test_constrainedlayout.pyÚexample_plot   s   
r   c              	   C   s¼   d\}}t jtdd| |ƒtdd| |ƒf \}}d|d  |d  |d  t  |d  |d  ¡ }| j|||d d…d d…f d	d
ddd}| jd|d | jd|d | jd|d |S )N)ç333333ã?r   éýÿÿÿr   r   ç       @é   r   éÿÿÿÿZRdBu_rg      ð¿ç      ð?T)ZcmapZvminZvmaxZ
rasterizedr
   r   r   r   )ÚnpZmgridÚsliceZexpÚ
pcolormeshr   r   r   )r   r   ZdxZdyÚyÚxÚzÚpcmr   r   r   Úexample_pcolor   s   
ÿ4 ÿr'   zconstrained_layout1.pngc                  C   s$   t jdd} |  ¡ }t|dd dS )z,Test constrained_layout for a single subplotÚconstrained©Úlayouté   r   N)ÚpltÚfigureÚadd_subplotr   ©Úfigr   r   r   r   Útest_constrained_layout1%   s   r1   zconstrained_layout2.pngc                  C   s0   t jdddd\} }|jD ]}t|dd qdS )z(Test constrained_layout for 2x2 subplotsr   r(   r)   r+   r   N)r,   ÚsubplotsÚflatr   ©r0   Úaxsr   r   r   r   Útest_constrained_layout2-   s   
ÿr6   zconstrained_layout3.pngc                  C   sZ   t jdddd\} }t|jƒD ]\}}t|dd}|dkr d}nd}| j|||d	 qd
S )z3Test constrained_layout for colorbars with subplotsr   r(   r)   r+   r   r   g{®Gáz´?ç{®Gáz”?)r   ÚpadN)r,   r2   Ú	enumerater3   r'   Úcolorbar)r0   r5   Únnr   r&   r8   r   r   r   Útest_constrained_layout35   s   úr<   zconstrained_layout4.pngc                  C   sB   t jdddd\} }|jD ]}t|dd}q| j||ddd d	S )
z;Test constrained_layout for a single colorbar with subplotsr   r(   r)   r+   r   ç{®Gáz„?r   ©r   r8   ÚshrinkN©r,   r2   r3   r'   r:   ©r0   r5   r   r&   r   r   r   Útest_constrained_layout4C   s   
rB   zconstrained_layout5.pnggü©ñÒMb`?)Ztolc                  C   sF   t jdddd\} }|jD ]}t|dd}q| j||dddd	d
 dS )zZ
    Test constrained_layout for a single colorbar with subplots,
    colorbar bottom
    r   r(   r)   r+   r   Fr=   r   Úbottom)r   Zuse_gridspecr8   r?   ÚlocationNr@   rA   r   r   r   Útest_constrained_layout5M   s   

þrE   zconstrained_layout6.pngc               	   C   sÎ   dt jd< t jdd} | jdd| d}|d  dd¡}|d  dd¡}g }|D ]}|  |¡}||g7 }t|d	d
 q'| d¡ g }|D ]}|  |¡}||g7 }t|d	d
}qC| j	||dddt
jddd dS )z,Test constrained_layout for nested gridspecsFúpcolormesh.snapr(   r)   r   r   ©r-   r   r   r   zx-label
MultiLiner=   g®Gáz®ï?rC   r   r	   )r   r8   r?   rD   ZticksN)r,   ÚrcParamsr-   Úadd_gridspecÚsubgridspecr.   r   r   r'   r:   r   ZMaxNLocator)r0   ÚgsÚgslÚgsrZaxslr   Zaxsrr&   r   r   r   Útest_constrained_layout6\   s(   







þrN   c                  C   s¢   t jdd} |  dd¡}|d  dd¡}|d  dd¡}g }g }tdƒD ]}||  || ¡g7 }||  || ¡g7 }q$|  ¡  |d  ¡ j|d  ¡ j	ksOJ ‚d S )NT©Úconstrained_layoutr   r   r   r   )
r,   r-   rI   rJ   Úranger.   Údraw_without_renderingÚget_positionÚy0Úy1)r0   ZGSZGSAZGSBZaxaZaxbÚir   r   r   Útest_identical_subgridspecw   s   $rW   c                  C   sŒ   t jtdd5 tjdd} t dd¡}t dd|d ¡}t dd|d ¡}|D ]}|  |¡ q(|  	¡  W d  ƒ dS 1 s?w   Y  dS )	z2Test for proper warning if fig not set in GridSpeczhThere are no gridspecs with layoutgrids. Possibly did not call parent GridSpec with the "figure" keyword©Úmatchr(   r)   r   r   r   N)
ÚpytestÚwarnsÚUserWarningr,   r-   r   ÚGridSpecÚGridSpecFromSubplotSpecr.   rR   )r0   rK   rL   rM   r   r   r   Útest_constrained_layout7‹   s   ÿ
"õr_   zconstrained_layout8.pngc                  C   sæ   t jddd} tjdd| d}g }dD ]>}|dkrd	g}ndd
g}|D ]-}|  |||f ¡}||g7 }t|dd |dkrB| d¡ |d	k rK| d¡ | d¡ q#q|  |ddd…f ¡}||g7 }t|dd}| j	||ddd dS )z/Test for gridspecs that are not completely full)é
   r   r(   ©Úfigsizer*   r   r   rG   ©r   r   r   r   é   é	   r   Ú r   Nr=   r   r>   )
r,   r-   r   r]   r.   r'   r   r   r   r:   )r0   rK   r5   ÚjZilistrV   r   r&   r   r   r   Útest_constrained_layout8›   s*   


ø	
rh   zconstrained_layout9.pngc                  C   sr   t jdddddd\} }|jD ]}t|dd}| d¡ | d¡ q| d¡ | j||d	d
d | jddd dS )z4Test for handling suptitle and for sharex and shareyr   r(   F©r*   ÚsharexÚshareyr+   r   rf   r   r=   r   r>   zTest Suptitleé   N)	r,   r2   r3   r'   r   r   Ú
set_aspectr:   ÚsuptitlerA   r   r   r   Útest_constrained_layout9·   s   

ÿ


ro   zconstrained_layout10.pngc                  C   sF   t jdddd\} }|jD ]}|jt d¡dd q|jddd	 d
S )z%Test for handling legend outside axisr   r(   r)   r   zThis is a label)Úlabelzcenter left)gš™™™™™é?ç      à?)ÚlocZbbox_to_anchorN)r,   r2   r3   r   r    ZarangeZlegendr4   r   r   r   Útest_constrained_layout10Æ   s   
rs   zconstrained_layout11.pngc                  C   sº   t jddd} tjdd| d}t dd|d ¡}t dd|d ¡}|  |d ¡}t|dd	 g }|D ]}|  |¡}||g7 }t|dd	}q2| j||d
dd |  |d ¡}t|dd	 dS )z"Test for multiple nested gridspecsr(   )é   r   ©r*   rb   r   r   rG   r   re   r   r   ç     €Q@©r   r?   ÚaspectN©	r,   r-   r   r]   r^   r.   r   r'   r:   ©r0   Úgs0rL   Zgsl0r   r5   rK   r&   r   r   r   Útest_constrained_layout11Ï   s   

r|   zconstrained_layout11rat.pngc                  C   sÈ   t jddd} tjdd| ddgd}t dd|d ¡}tjdd|d ddgd	}|  |d ¡}t|d
d g }|D ]}|  |¡}||g7 }t|d
d}q9| j||ddd |  |d ¡}t|d
d dS )z4Test for multiple nested gridspecs with width_ratiosr(   )r`   r   ru   r   r   é   )r-   Zwidth_ratiosr   )Úheight_ratiosre   r   r   rv   rw   Nry   rz   r   r   r   Útest_constrained_layout11ratã   s   

r   zconstrained_layout12.pngc                  C   sÖ   t jddd} tjdd| d}|  |dd…d	f ¡}|  |dd…d	f ¡}t|d
d t|d
d |  |dd…df ¡}t|dd |  |dd…df ¡}t|dd |  |dd…df ¡}t|dd | d¡ dS )z/Test that very unbalanced labeling still works.r(   )r}   é   ru   r}   r   rG   Nr   r   é   r   r   T)r   rd   r
   )r,   r-   r   r]   r.   r   r   )r0   r{   Úax1Úax2r   r   r   r   Útest_constrained_layout12÷   s   r„   zconstrained_layout13.pngr7   c                  C   s’   t jdddd\} }|jD ]}t|dd}| j||dddd	 qt t¡ |  ¡ j	d
dd W d  ƒ n1 s9w   Y  |  ¡ j	ddd dS )úTest that padding works.r   r(   r)   r   r   r   ç      4@r7   ©r   r?   rx   r8   r   )ZwpadZhpadNgUUUUUUÕ?©Úw_padÚh_pad)
r,   r2   r3   r'   r:   rZ   ZraisesÚ	TypeErrorÚget_layout_engineÚsetrA   r   r   r   Útest_constrained_layout13  s   
ÿrŽ   zconstrained_layout14.pngc                  C   sZ   t jdddd\} }|jD ]}t|dd}| j||dddd	 q|  ¡ jd
d
ddd dS )r…   r   r(   r)   r   r   r   r†   r7   r‡   gUUUUUU¥?çš™™™™™É?©r‰   rŠ   ZhspaceZwspaceN)r,   r2   r3   r'   r:   rŒ   r   rA   r   r   r   Útest_constrained_layout14  s   

þr‘   zconstrained_layout15.pngc                  C   s6   dt jd< t dd¡\} }|jD ]}t|dd qdS )zTest that rcparams work.Tzfigure.constrained_layout.user   r   r   N)ÚmplrH   r,   r2   r3   r   r4   r   r   r   Útest_constrained_layout15%  s
   

ÿr“   zconstrained_layout16.pngc                  C   s.   t jdd\} }t|dd |  g d¢¡}dS )zTest ax.set_position.r(   r)   r   r   )r   r   çš™™™™™Ù?r”   N)r,   r2   r   Úadd_axes©r0   r   rƒ   r   r   r   Útest_constrained_layout16.  s   r—   zconstrained_layout17.pngc                  C   s”   t jdd} tjdd| d}|  |d ¡}|  |ddd…f ¡}|  |dd…dd	…f ¡}|  |dd…d
f ¡}t|ƒ t|ƒ t|ƒ t|ƒ dS )zTest uneven gridspecsr(   r)   r   rG   ©r   r   r   r   Nr   r   )r,   r-   r   r]   r.   r   )r0   rK   r‚   rƒ   Úax3Zax4r   r   r   Útest_constrained_layout176  s   rš   c                  C   sT   t jdd\} }| ¡ }t|ƒ t|dd |  ¡  t| ¡ j| ¡ jkƒs(J ‚dS )z
Test twinxr(   r)   r+   r   N)r,   r2   Ztwinxr   rR   ÚallrS   Úextentsr–   r   r   r   Útest_constrained_layout18G  s    r   c                  C   sh   t jdd\} }| ¡ }t|ƒ t|dd | d¡ | d¡ |  ¡  t| ¡ j| ¡ jkƒs2J ‚dS )z
Test twinyr(   r)   r+   r   rf   N)	r,   r2   Ztwinyr   r   rR   r›   rS   rœ   r–   r   r   r   Útest_constrained_layout19Q  s   

 rž   c                  C   sh   t  ddd¡} t  | | dd…df ¡}t ¡ }| g d¢¡}| | | |dd…dd…f ¡}| |¡ dS )z)Smoke test cl does not mess up added axeséûÿÿÿr   rd   N)r   r   r   r   r   )r    ZlinspaceZhypotr,   r-   r•   r"   r:   )ZgxZimgr0   r   Zmeshr   r   r   Útest_constrained_layout20]  s   r    c                  C   sf   t jdd\} }|  d¡ |  ¡  t | ¡ j¡}|  d¡ |  ¡  t | ¡ j¡}tj 	||¡ dS )z>#11035: repeated calls to suptitle should not alter the layoutr(   r)   Z	Suptitle0Z	Suptitle1N)
r,   r2   rn   rR   r    ÚcopyrS   rœ   ÚtestingÚassert_allclose©r0   r   Zextents0Úextents1r   r   r   Útest_constrained_layout21h  s   

r¦   c                  C   s`   t jdd\} }|  ¡  t | ¡ j¡}| jddd |  ¡  t | ¡ j¡}tj 	||¡ dS )zC#11035: suptitle should not be include in CL if manually positionedr(   r)   ÚSuptitlerq   ©r#   N)
r,   r2   rR   r    r¡   rS   rœ   rn   r¢   r£   r¤   r   r   r   Útest_constrained_layout22w  s   r©   c                  C   sN   t dƒD ] } tjdddd}| dd¡}|d  dd¡}| d| › ¡ qd	S )
zu
    Comment in #11035: suptitle used to cause an exception when
    reusing a figure w/ CL with ``clear=True``.
    r   r(   TZ123)r*   ÚclearZnumr   r   r§   N)rQ   r,   r-   rI   rJ   rn   )rV   r0   rK   Úsubr   r   r   Útest_constrained_layout23…  s   ür¬   ztest_colorbar_location.pngTZmpl20)Úremove_textÚstylec                  C   sö   dt jd< t jdddd\} }|jD ]}t|ƒ}| d¡ | d¡ q| j||dd…d	f d
d | j||ddd…f ddd | j||ddd…f dddd | j||ddd…f ddd | j||d ddd | j||d	d…df ddd dS )zY
    Test that colorbar handling is as expected for various complicated
    cases...
    FrF   rd   r   r(   r)   rf   Nr   r”   )r   r?   r   r   rq   rC   )r   r?   rD   r   gš™™™™™©?)r   r?   rD   r8   éþÿÿÿr   Útopr˜   ÚleftÚright)r,   rH   r2   r3   r'   r   r   r:   rA   r   r   r   Útest_colorbar_location’  s   


 "r³   c                  C   sX   t jdddd\} }|d  d¡ |  ¡  t |d  ¡ j¡}tjj	|g d¢dd	 d S )
Nr   r(   r)   rc   Fr˜   )g›çˆ|—R§?g\å	„bá?g&Ñ:ªšÞ?g³Ñ9?Åqï?çñhãˆµøä>)Úrtol)
r,   r2   Zset_visiblerR   r    r¡   rS   rœ   r¢   r£   )r0   r5   r¥   r   r   r   Útest_hidden_axes©  s   

ÿr¶   c               	   C   sr  dD ]´} t jdddd\}}g }t|jƒD ]@\}}|jdd t|ƒ}|j||| ddd	}||g7 }|jjdd |d
krU|jj 	g ¡ |jj
 	g ¡ | g ¡ | g ¡ q| ¡ jddddd | ¡  | dv rtj |d j ¡ j|d j ¡ j¡ tj |d
 j ¡ j|d j ¡ j¡ qtj |d j ¡ j|d
 j ¡ j¡ tj |d j ¡ j|d j ¡ j¡ qd S )N)r²   r±   r°   rC   r   r(   r)   Úin)Ú	directionr   g{®Gáz¤?)r   rD   r?   r8   r   gÇqÇq¬?gš™™™™™¹?r   )r±   r²   r   r   )r,   r2   r9   r3   Útick_paramsr'   r:   r   ZxaxisZ	set_ticksÚyaxisr   r   rŒ   r   rR   r    r¢   r£   rS   Úx0rT   )rD   r0   r5   Zcbsr;   r   ÚpcÚcbr   r   r   Útest_colorbar_align¶  sF   ÿ


€ÿÿÿÿÿår¾   ztest_colorbars_no_overlapV.png)r®   c                  C   s|   t jddd} | jddddd}|D ]$}|j t ¡ ¡ |jdd	d
 | ddgddgg¡}| j	||dd q|  
d¡ d S )N)r   rd   r(   ra   r   r   T©rj   rk   Úbothr·   ©Zaxisr¸   r   rd   Zvertical©r   ZorientationÚfoo)r,   r-   r2   rº   Úset_major_formatterr   ÚNullFormatterr¹   Úimshowr:   rn   ©r0   r5   r   Zimr   r   r   Útest_colorbars_no_overlapVÖ  s   rÈ   ztest_colorbars_no_overlapH.pngc                  C   s|   t jddd} |  d¡ | jddddd}|D ]$}|j t ¡ ¡ |jd	d
d | 	ddgddgg¡}| j
||dd qd S )N)rd   r   r(   ra   rÃ   r   r   Tr¿   rÀ   r·   rÁ   r   rd   Z
horizontalrÂ   )r,   r-   rn   r2   rº   rÄ   r   rÅ   r¹   rÆ   r:   rÇ   r   r   r   Útest_colorbars_no_overlapHâ  s   
ürÉ   c                  C   sÖ   t jdddd\} }|d  g d¢¡ |  ¡  |d  ¡ }tj |ddgddgg¡ t jdddd\} }|d  g d¢¡ |d  tj	 
d	d	¡¡}| j||d d
 |  ¡  |d  ¡ }tj |ddgddgg¡ d S )Nr   r   r(   r)   r   ©r   r   ç333333Ó?rË   r   rq   é   ©r   g)\Âõ(Ü?)r,   r2   Zset_positionrR   rS   r    r¢   r£   r"   ÚrandomZrandr:   )r0   r5   Úppr¼   r   r   r   Útest_manually_set_positionî  s   rÐ   ztest_bboxtight.pngZbbox_inchesZtight)r­   r®   Zsavefig_kwargc                  C   ó   t jdd\} }| d¡ d S ©Nr(   r)   r   ©r,   r2   rm   r/   r   r   r   Útest_bboxtightþ  s   rÔ   ztest_bbox.pngrq   g      @r   c                  C   rÑ   rÒ   rÓ   r/   r   r   r   Ú	test_bbox  s   rÕ   c                  C   sà   t jddddddid\} \}}}| dd¡ | d	¡ | d
d¡ | d	¡ | dd¡ | d	¡ | j|||fd |  ¡  |jj ¡ |jj ¡ |jj ¡ g}t	j
j|d j|d jg|d jddd |d jdksnJ ‚dS )zî
    Tests for a bug in which constrained layout and align_ylabels on
    three unevenly sized subplots, one of whose y tick labels include
    negative numbers, drives the non-negative subplots' y labels off
    the edge of the plot
    r   r   r(   )gš™™™™™@r€   r~   )r   r   gffffffæ?)r*   rb   Zgridspec_kwr   ZLabelg      ø¿g      ø?)r5   r   r´   )rµ   ÚatolN)r,   r2   Zset_ylimr   Zalign_ylabelsrR   rº   rp   Zget_window_extentr    r¢   r£   r»   )r0   r™   r‚   rƒ   Zafter_alignr   r   r   Útest_align_labels  s(   
þ





þÿr×   c                  C   s  t jdd\} }|  ¡  | | j ¡ ¡}|  d¡ |  d¡ |  ¡  | | j ¡ ¡}|j|jd ks4J ‚|j	|j	d ks>J ‚t jdd\} }|  ¡  | | j ¡ ¡}| jddd | jddd |  ¡  | | j ¡ ¡}|j|jd ksvJ ‚|j	|j	d ks€J ‚d S )	Nr(   r)   ZBooZBooyg      $@rq   )r$   r¨   )
r,   r2   rR   Zget_tightbboxZcanvasZget_rendererZ	supxlabelZ	supylabelrT   r»   )r0   r   Zpos0Úposr   r   r   Útest_suplabels1  s$   

rÙ   c                  C   s:   t  ¡ } |  dd¡}|  |dd …dd …f ¡}|  ¡  d S )Nr   r   r   )r,   r-   rI   r.   rR   )r0   rK   Úspr   r   r   Útest_gridspec_addressingH  s   rÛ   c                  C   s¼   t jdd\} }|  ¡  tjtdd t  ¡ \} }|  d¡ |  ¡  W d   ƒ n1 s-w   Y  tjtdd t  ¡ \} }|  dddœ¡ |  ¡  W d   ƒ d S 1 sWw   Y  d S )NTrO   zwill be deprecatedrX   r7   rˆ   )r,   r2   rR   rZ   r[   ÚPendingDeprecationWarningÚset_constrained_layoutr/   r   r   r   Útest_discouraged_apiO  s    ÿ

üÿ
"ürÞ   c                  C   s    t jddid\} }|  ¡  d S )NrŠ   r7   rO   )r,   r2   rR   r/   r   r   r   Útest_kwargs`  s   rß   c                  C   sÀ   t jdd\} }|  ¡ jg d¢d |  ¡  | ¡ }|jdk s!J ‚|jdk s(J ‚t jdd\} }|  ¡ jg d¢d |  ¡  | ¡ }|jdk sIJ ‚|jdk sPJ ‚|jdksWJ ‚|j	dks^J ‚d S )Nr(   r)   )r   r   rq   rq   )Úrectrq   rÊ   r   )
r,   r2   rŒ   r   rR   rS   Úx1rU   r»   rT   )r0   r   Zpposr   r   r   Ú	test_recte  s   râ   c                  C   sJ  t jdddddd\} }|jD ]}| tj dd¡¡}q| j||d |  ¡  |d  	¡ }tj
j|jd	d
d |d  	¡ }tj
j|jdd
d t jddddddd\} }|jD ]}| tj dd¡¡}qW| j||d |  ¡  |d  	¡ }tj
j|jdd
d tj
j|jdd
d |d  	¡ }tj
j|jdd
d tj
j|jdd
d d S )Nr   r   Ú
compressedTri   rÌ   rÍ   r˜   gâX·Ñ Î?gü©ñÒMbP?)rÖ   rc   g™»–zæ?)r   rd   )r*   rj   rk   rb   gGrùé·¯?gá“©‚Që?)r   r   gk+ö—Ý“ë?goð…ÉTÁÈ?)r,   r2   r3   rÆ   r    rÎ   Zrandnr:   rR   rS   r¢   r£   r»   rá   rU   rT   )r0   r5   r   r¼   rØ   r   r   r   Útest_compressed1w  s0   

ÿ


ÿ
rä   z
arg, state)TT)FFrà   c                 C   s$   t j| d\}}| ¡ |u sJ ‚d S )NrO   )r,   r2   Úget_constrained_layout)ÚargÚstater0   r   r   r   r   Útest_set_constrained_layout–  s   rè   c                  C   s~   t  ¡ \} }t t¡* |  d¡ |  ¡ sJ ‚|  d¡ |  ¡ r"J ‚|  d¡ |  ¡ s-J ‚W d   ƒ d S 1 s8w   Y  d S )NTF)r,   r2   rZ   r[   rÜ   rÝ   rå   r/   r   r   r   Útest_constrained_toggle¡  s   


"úré   c                  C   sP   t jddd} |  ¡  |  ¡  t  d¡ ~ t ¡  tdd„ t ¡ D ƒƒr&J ‚d S )NT)r`   r`   )rP   rb   r›   c                 s   s    | ]
}t |tjjƒV  qd S )N)Ú
isinstancer’   Z_layoutgridZ
LayoutGrid)Ú.0Úobjr   r   r   Ú	<genexpr>µ  s   € ÿz#test_layout_leak.<locals>.<genexpr>)	r,   r-   r.   rR   ÚcloseÚgcZcollectÚanyZget_objects)r0   r   r   r   Útest_layout_leak¬  s   
ÿrñ   )r   F)r   )@rï   Znumpyr    rZ   Z
matplotlibr’   Zmatplotlib.testing.decoratorsr   Zmatplotlib.pyplotZpyplotr,   Zmatplotlib.transformsZ
transformsZmtransformsr   r   r   r'   r1   r6   r<   rB   rE   rN   rW   r_   rh   ro   rs   r|   r   r„   rŽ   r‘   r“   r—   rš   r   rž   r    r¦   r©   r¬   r³   r¶   r¾   rÈ   rÉ   rÐ   rÔ   ZBboxrÕ   r×   rÙ   rÛ   rÞ   rß   râ   rä   ZmarkZparametrizerè   ré   rñ   r   r   r   r   Ú<module>   s¶    





	













ÿ
 

þ
ÿþ
"
ü
