o
    l’×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é   é   é   ©Únbinsúx-label©Úfontsizeúy-labelÚTitle)ÚplotÚlocator_paramsÚ
set_xlabelÚ
set_ylabelÚ	set_titleÚset_xticklabelsÚset_yticklabels)Úaxr   Únodec© r   úe/home/ubuntu/SoloSpeech/.venv/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   éÿÿÿÿÚRdBu_rg      ð¿ç      ð?T)ÚcmapÚvminÚvmaxÚ
rasterizedr   r   r   r   )ÚnpÚmgridÚsliceÚexpÚ
pcolormeshr   r   r   )r   r   ÚdxÚdyÚyÚxÚzÚpcmr   r   r   Úexample_pcolor   s   
ÿ4 ÿr2   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   r<   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   r3   r4   r6   r   N)r7   ÚsubplotsÚflatr   ©r;   Úaxsr   r   r   r   Útest_constrained_layout2-   s   
ÿrA   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   r3   r4   r6   r   r   g{®Gáz´?ç{®Gáz”?)r   ÚpadN)r7   r=   Ú	enumerater>   r2   Úcolorbar)r;   r@   Únnr   r1   rC   r   r   r   Útest_constrained_layout35   s   úrG   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   r3   r4   r6   r   ç{®Gáz„?r   ©r   rC   ÚshrinkN©r7   r=   r>   r2   rE   ©r;   r@   r   r1   r   r   r   Útest_constrained_layout4C   s   
rM   zconstrained_layout5.pnggü©ñÒMb`?)Ú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   r3   r4   r6   r   FrH   r   Úbottom)r   Úuse_gridspecrC   rJ   ÚlocationNrK   rL   r   r   r   Útest_constrained_layout5M   s   

þrR   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.snapr3   r4   r   r   ©r8   r   r   r   zx-label
MultiLinerH   g®Gáz®ï?rO   r   r	   )r   rC   rJ   rQ   ÚticksN)r7   ÚrcParamsr8   Úadd_gridspecÚsubgridspecr9   r   r   r2   rE   r   ÚMaxNLocator)r;   ÚgsÚgslÚgsrÚaxslr   Úaxsrr1   r   r   r   Útest_constrained_layout6\   s(   







þr_   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   )
r7   r8   rW   rX   Úranger9   Údraw_without_renderingÚget_positionÚy0Úy1)r;   ÚGSÚGSAÚGSBÚaxaÚaxbÚir   r   r   Útest_identical_subgridspecw   s   $rm   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©Úmatchr3   r4   r   r   r   N)
ÚpytestÚwarnsÚUserWarningr7   r8   r   ÚGridSpecÚGridSpecFromSubplotSpecr9   rc   )r;   rZ   r[   r\   r   r   r   Útest_constrained_layout7‹   s   ÿ
"õru   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   r3   ©Úfigsizer5   r   r   rT   ©r   r   r   r   é   é	   r   Ú r   NrH   r   rI   )
r7   r8   r   rs   r9   r2   r   r   r   rE   )r;   rZ   r@   ÚjÚilistrl   r   r1   r   r   r   Útest_constrained_layout8›   s*   


ø	
r   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   r3   F©r5   ÚsharexÚshareyr6   r   r|   r   rH   r   rI   zTest Suptitleé   N)	r7   r=   r>   r2   r   r   Ú
set_aspectrE   ÚsuptitlerL   r   r   r   Útest_constrained_layout9·   s   

ÿ


r†   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   r3   r4   r   zThis is a label)Úlabelzcenter left)gš™™™™™é?ç      à?)ÚlocÚbbox_to_anchorN)r7   r=   r>   r   r'   ÚarangeÚlegendr?   r   r   r   Útest_constrained_layout10Æ   s   
r   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 gridspecsr3   )é   r   ©r5   rx   r   r   rT   r   r{   r   r   ç     €Q@©r   rJ   ÚaspectN©	r7   r8   r   rs   rt   r9   r   r2   rE   ©r;   Úgs0r[   Úgsl0r   r@   rZ   r1   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_ratiosr3   )rv   r   r   r   r   é   )r8   Úwidth_ratiosr   )Úheight_ratiosr{   r   r   r   r‘   Nr“   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.r3   )r˜   é   r   r˜   r   rT   Nr   r   é   r   r   T)r   rz   r   )r7   r8   r   rs   r9   r   r   )r;   r•   Úax1Úax2r   r   r   r   Útest_constrained_layout12÷   s   r    zconstrained_layout13.pngrB   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   r3   r4   r   r   r   ç      4@rB   ©r   rJ   r’   rC   r   )ÚwpadÚhpadNgUUUUUUÕ?©Úw_padÚh_pad)
r7   r=   r>   r2   rE   rp   ÚraisesÚ	TypeErrorÚget_layout_engineÚsetrL   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   r3   r4   r   r   r   r¢   rB   r£   gUUUUUU¥?çš™™™™™É?©r§   r¨   ÚhspaceÚwspaceN)r7   r=   r>   r2   rE   r«   r¬   rL   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)ÚmplrV   r7   r=   r>   r   r?   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.r3   r4   r   r   )r®   r®   çš™™™™™Ù?rµ   N)r7   r=   r   Úadd_axes©r;   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 gridspecsr3   r4   r   rT   ©r   r   r   r   Nr   r    )r7   r8   r   rs   r9   r   )r;   rZ   rž   rŸ   Úax3Ú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 twinxr3   r4   r6   r   N)r7   r=   Útwinxr   rc   Úallrd   Ú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 twinyr3   r4   r6   r   r|   N)	r7   r=   Útwinyr   r   rc   r¾   rd   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   rz   N)r   r   r   r   r    )r'   ÚlinspaceÚhypotr7   r8   r¶   r+   rE   )ÚgxÚimgr;   r   Ú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 layoutr3   r4   Ú	Suptitle0Ú	Suptitle1N)
r7   r=   r…   rc   r'   Úcopyrd   r¿   ÚtestingÚassert_allclose©r;   r   Ú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 positionedr3   r4   ÚSuptitlerˆ   ©r.   N)
r7   r=   rc   r'   rÌ   rd   r¿   r…   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   r3   TÚ123)r5   ÚclearÚnumr   r   z
Suptitle{}N)rb   r7   r8   rW   rX   r…   Úformat)rl   r;   rZ   Úsubr   r   r   Útest_constrained_layout23…  s   ürÛ   ztest_colorbar_location.pngTÚ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...
    FrS   rz   r   r3   r4   r|   Nr   rµ   )r   rJ   r    r   rˆ   rO   )r   rJ   rQ   r   gš™™™™™©?)r   rJ   rQ   rC   éþÿÿÿr   Útopr¹   ÚleftÚright)r7   rV   r=   r>   r2   r   r   rE   rL   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   r3   r4   ry   Fr¹   )g›çˆ|—R§?g\å	„bá?g&Ñ:ªšÞ?g³Ñ9?Åqï?çñhãˆµøä>)Úrtol)
r7   r=   Úset_visiblerc   r'   rÌ   rd   r¿   rÍ   rÎ   )r;   r@   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à   rO   r   r3   r4   Úin)Ú	directionr   g{®Gáz¤?)r   rQ   rJ   rC   r   gÇqÇq¬?gš™™™™™¹?r¯   )rá   râ   r   r   )r7   r=   rD   r>   Útick_paramsr2   rE   r   ÚxaxisÚ	set_ticksÚyaxisr   r   r«   r¬   rc   r'   rÍ   rÎ   rd   Úx0re   )rQ   r;   r@   ÚcbsrF   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   rz   r3   rw   r   r   T©r   r‚   Úbothrè   ©Úaxisré   r   rz   Úvertical©r   ÚorientationÚfoo)r7   r8   r=   rí   Úset_major_formatterr   ÚNullFormatterrê   ÚimshowrE   r…   ©r;   r@   r   Ú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)rz   r   r3   rw   rú   r   r   Tró   rô   rè   rõ   r   rz   Ú
horizontalrø   )r7   r8   r…   r=   rí   rû   r   rü   rê   rý   rE   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   r3   r4   r   ©r®   r®   ç333333Ó?r  r®   rˆ   é   ©r   g)\Âõ(Ü?)r7   r=   Úset_positionrc   rd   r'   rÍ   rÎ   r+   ÚrandomÚrandrE   )r;   r@   Úpprð   r   r   r   Útest_manually_set_positionî  s   r  ztest_bboxtight.pngÚbbox_inchesÚtight)rÝ   rÞ   Úsavefig_kwargc                  C   ó   t jdd\} }| d¡ d S ©Nr3   r4   r"   ©r7   r=   r„   r:   r   r   r   Útest_bboxtightþ  s   r  ztest_bbox.pngrˆ   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   r3   )gš™™™™™@rœ   rš   )r   r   gffffffæ?)r5   rx   Úgridspec_kwr   ÚLabelg      ø¿g      ø?)r@   r   rä   )rå   ÚatolN)r7   r=   Úset_ylimr   Úalign_ylabelsrc   rí   r‡   Úget_window_extentr'   rÍ   rÎ   rî   )r;   rº   rž   rŸ   Ú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 )	Nr3   r4   ÚBooÚBooyg      $@rˆ   )r/   rÔ   )
r7   r=   rc   Úget_tightbboxÚcanvasÚget_rendererÚ	supxlabelÚ	supylabelre   rî   )r;   r   Úpos0Úposr   r   r   Útest_suplabels1  s$   

r%  c                  C   s:   t  ¡ } |  dd¡}|  |dd …dd …f ¡}|  ¡  d S )Nr   r   r   )r7   r8   rW   r9   rc   )r;   rZ   Ú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 )NTr`   zwill be deprecatedrn   rB   r¦   )r7   r=   rc   rp   rq   ÚPendingDeprecationWarningÚset_constrained_layoutr:   r   r   r   Útest_discouraged_apiO  s    ÿ

üÿ
"ür*  c                  C   s    t jddid\} }|  ¡  d S )Nr¨   rB   r`   )r7   r=   rc   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 )Nr3   r4   )r   r   rˆ   rˆ   )Úrectrˆ   r  r®   )
r7   r=   r«   r¬   rc   rd   Úx1rf   rî   re   )r;   r   Ú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   Ú
compressedTr€   r  r  r¹   gâX·Ñ Î?gü©ñÒMbP?)r  ry   g™»–zæ?)r   rz   )r5   r   r‚   rx   gGrùé·¯?gá“©‚Që?)r   r   gk+ö—Ý“ë?goð…ÉTÁÈ?)r7   r=   r>   rý   r'   r  ÚrandnrE   rc   rd   rÍ   rÎ   rî   r-  rf   re   )r;   r@   r   rð   r$  r   r   r   Útest_compressed1w  s0   

ÿ


ÿ
r2  z
arg, state)TT)FFr,  c                 C   s$   t j| d\}}| ¡ |u sJ ‚d S )Nr`   )r7   r=   Úget_constrained_layout)ÚargÚstater;   r   r   r   r   Útest_set_constrained_layout–  s   r6  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)r7   r=   rp   rq   r(  r)  r3  r:   r   r   r   Útest_constrained_toggle¡  s   


"úr7  c                  C   sP   t jddd} |  ¡  |  ¡  t  d¡ ~ t ¡  tdd„ t ¡ D ƒƒr&J ‚d S )NT)rv   rv   )ra   rx   r¾   c                 s   s    | ]
}t |tjjƒV  qd S )N)Ú
isinstancer³   Ú_layoutgridÚ
LayoutGrid)Ú.0Úobjr   r   r   Ú	<genexpr>µ  s   € ÿz#test_layout_leak.<locals>.<genexpr>)	r7   r8   r9   rc   ÚcloseÚgcÚcollectÚanyÚget_objects)r;   r   r   r   Útest_layout_leak¬  s   
ÿrC  )r   F)r   )@r?  Únumpyr'   rp   Ú
matplotlibr³   Úmatplotlib.testing.decoratorsr   Úmatplotlib.pyplotÚpyplotr7   Úmatplotlib.transformsÚ
transformsÚmtransformsr   r   r   r2   r<   rA   rG   rM   rR   r_   rm   ru   r   r†   r   r—   r›   r    r­   r²   r´   r¸   r¼   rÀ   rÂ   rÉ   rÒ   rÕ   rÛ   rã   rç   rò   r   r  r  r  ÚBboxr  r  r%  r'  r*  r+  r/  r2  ÚmarkÚparametrizer6  r7  rC  r   r   r   r   Ú<module>   s¶    





	













ÿ
 

þ
ÿþ
"
ü
