o
    ‘i{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   úv/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/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ÚsliceÚ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   r2   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   ©r1   Úaxsr   r   r   r   Útest_constrained_layout2-   s   
ÿr7   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-   r3   Ú	enumerater4   r(   Úcolorbar)r1   r6   Únnr   r'   r9   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   r9   ÚshrinkN©r-   r3   r4   r(   r;   ©r1   r6   r   r'   r   r   r   Útest_constrained_layout4C   s   
rC   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_gridspecr9   r@   ÚlocationNrA   rB   r   r   r   Útest_constrained_layout5M   s   

þrF   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®ï?rD   r   r	   )r   r9   r@   rE   ZticksN)r-   ÚrcParamsr.   Úadd_gridspecÚsubgridspecr/   r   r   r(   r;   r   ZMaxNLocator)r1   ÚgsÚgslÚgsrZaxslr   Zaxsrr'   r   r   r   Útest_constrained_layout6\   s(   







þrO   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.   rJ   rK   Úranger/   Údraw_without_renderingÚget_positionÚy0Úy1)r1   ZGSZGSAZGSBZaxaZaxbÚir   r   r   Útest_identical_subgridspecw   s   $rX   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/   rS   )r1   rL   rM   rN   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   rH   ©r   r   r   r   é   é	   r   Ú r   Nr>   r   r?   )
r-   r.   r   r^   r/   r(   r   r   r   r;   )r1   rL   r6   ÚjZilistrW   r   r'   r   r   r   Útest_constrained_layout8›   s*   


ø	
ri   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   rg   r   r>   r   r?   zTest Suptitleé   N)	r-   r3   r4   r(   r   r   Ú
set_aspectr;   ÚsuptitlerB   r   r   r   Útest_constrained_layout9·   s   

ÿ


rp   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-   r3   r4   r   r    ZarangeZlegendr5   r   r   r   Útest_constrained_layout10Æ   s   
rt   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+   rc   r   r   rH   r   rf   r   r   ç     €Q@©r   r@   ÚaspectN©	r-   r.   r   r^   r_   r/   r   r(   r;   ©r1   Úgs0rM   Zgsl0r   r6   rL   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)   )ra   r   rv   r   r   é   )r.   Zwidth_ratiosr   )Úheight_ratiosrf   r   r   rw   rx   Nrz   r{   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~   é   rv   r~   r   rH   Nr   r   é   r   r   T)r   re   r
   )r-   r.   r   r^   r/   r   r   )r1   r|   Úax1Úax2r   r   r   r   Útest_constrained_layout12÷   s   r…   zconstrained_layout13.pngr8   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@r8   ©r   r@   ry   r9   r   )ZwpadZhpadNgUUUUUUÕ?©Úw_padÚh_pad)
r-   r3   r4   r(   r;   r[   ZraisesÚ	TypeErrorÚget_layout_engineÚsetrB   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‡   r8   rˆ   gUUUUUU¥?çš™™™™™É?©rŠ   r‹   ZhspaceZwspaceN)r-   r3   r4   r(   r;   r   rŽ   rB   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)ÚmplrI   r-   r3   r4   r   r5   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-   r3   r   Úadd_axes©r1   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   rH   ©r   r   r   r   Nr   r   )r-   r.   r   r^   r/   r   )r1   rL   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-   r3   Ztwinxr   rS   ÚallrT   Ú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   rg   N)	r-   r3   Ztwinyr   r   rS   rœ   rT   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   re   N)r   r   r   r   r   )r    ZlinspaceÚhypotr-   r.   r–   r#   r;   )ZgxZimgr1   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-   r3   ro   rS   r    ÚcopyrT   r   ÚtestingÚassert_allclose©r1   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*   ÚSuptitlerr   ©r$   N)
r-   r3   rS   r    r£   rT   r   ro   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+   ÚclearÚnumr   r   r©   N)rR   r-   r.   rJ   rK   ro   )rW   r1   rL   Ú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...
    FrG   re   r   r)   r*   rg   Nr   r•   )r   r@   r   r   rr   rD   )r   r@   rE   r   gš™™™™™©?)r   r@   rE   r9   éþÿÿÿr   Útopr™   ÚleftÚright)r-   rI   r3   r4   r(   r   r   r;   rB   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*   rd   Fr™   )g›çˆ|—R§?g\å	„bá?g&Ñ:ªšÞ?g³Ñ9?Åqï?çñhãˆµøä>)Úrtol)
r-   r3   Zset_visiblerS   r    r£   rT   r   r¤   r¥   )r1   r6   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³   rD   r   r)   r*   Úin)Ú	directionr   g{®Gáz¤?)r   rE   r@   r9   r   gÇqÇq¬?gš™™™™™¹?r‘   )r´   rµ   r   r   )r-   r3   r:   r4   Útick_paramsr(   r;   r   ZxaxisZ	set_ticksÚyaxisr   r   r   rŽ   rS   r    r¤   r¥   rT   Úx0rU   )rE   r1   r6   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   re   r)   rb   r   r   T©rk   rl   Úbothrº   ©Zaxisr»   r   re   Úvertical©r   ZorientationÚfoo)r-   r.   r3   r½   Úset_major_formatterr   ÚNullFormatterr¼   Úimshowr;   ro   ©r1   r6   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)re   r   r)   rb   rÇ   r   r   TrÂ   rÃ   rº   rÄ   r   re   Ú
horizontalrÆ   )r-   r.   ro   r3   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   rr   é   ©r   g)\Âõ(Ü?)r-   r3   Zset_positionrS   rT   r    r¤   r¥   r#   ÚrandomZrandr;   )r1   r6   Ú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-   r3   rn   r0   r   r   r   Útest_bboxtightþ  s   rÙ   ztest_bbox.pngrr   g      @r   c                  C   rÖ   r×   rØ   r0   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+   rc   Zgridspec_kwr   ÚLabelg      ø¿g      ø?)r6   r   r·   )r¸   ÚatolN)r-   r3   Zset_ylimr   Zalign_ylabelsrS   r½   rq   Zget_window_extentr    r¤   r¥   r¾   )r1   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*   ÚBooZBooyg      $@rr   )r%   rª   )
r-   r3   rS   Zget_tightbboxZcanvasZget_rendererZ	supxlabelZ	supylabelrU   r¾   )r1   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.   rJ   r/   rS   )r1   rL   Ú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 )NTrP   zwill be deprecatedrY   r8   r‰   )r-   r3   rS   r[   r\   ÚPendingDeprecationWarningÚset_constrained_layoutr0   r   r   r   Útest_discouraged_apiO  s    ÿ

üÿ
"ürå   c                  C   s    t jddid\} }|  ¡  d S )Nr‹   r8   rP   )r-   r3   rS   r0   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   rr   rr   )Úrectrr   rÏ   r   )
r-   r3   r   rŽ   rS   rT   Úx1rV   r¾   rU   )r1   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   Ú
compressedTrj   rÑ   rÒ   r™   gâX·Ñ Î?gü©ñÒMbP?)rÜ   rd   g™»–zæ?)r   re   )r+   rk   rl   rc   gGrùé·¯?gá“©‚Që?)r   r   gk+ö—Ý“ë?goð…ÉTÁÈ?)r-   r3   r4   rÊ   r    rÓ   Zrandnr;   rS   rT   r¤   r¥   r¾   rè   rV   rU   )r1   r6   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 )NrP   )r-   r3   Úget_constrained_layout)ÚargÚstater1   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-   r3   r[   r\   rã   rä   rì   r0   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)ra   ra   )rQ   rc   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/   rS   ÚcloseÚgcZcollectÚanyZget_objects)r1   r   r   r   Útest_layout_leak¬  s   
ÿrø   )r   F)r   )@rö   Únumpyr    r[   Z
matplotlibr“   Zmatplotlib.testing.decoratorsr   Zmatplotlib.pyplotZpyplotr-   Zmatplotlib.transformsZ
transformsZmtransformsr   r   r   r(   r2   r7   r=   rC   rF   rO   rX   r`   ri   rp   rt   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ë   ÚmarkZparametrizerï   rð   rø   r   r   r   r   Ú<module>   s¶    





	













ÿ
 

þ
ÿþ
"
ü
