U
    Fvfƒ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   sb   |   ddg¡ | jdd |sJ| jd|d | jd|d | jd|d n|  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   úK/tmp/pip-unpacked-wheel-7vhvci0g/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 ]6\}}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
 qN| d¡ g }|D ]$}|  |¡}||g7 }t|d	d
}q†| 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 }qH|  ¡  |d  ¡ j|d  ¡ j	ksžt
‚d S )NT©Úconstrained_layoutr   r   r   r   )r-   r.   rJ   rK   Úranger/   Údraw_without_renderingÚget_positionÚy0Úy1ÚAssertionError)r1   ZGSZGSAZGSBZaxaZaxbÚir   r   r   Útest_identical_subgridspecw   s    rY   c               	   C   sv   t jtdd^ tjdd} t dd¡}t dd|d ¡}t dd|d ¡}|D ]}|  |¡ qP|  	¡  W 5 Q R X 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     ÿra   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 ]Z}|  |||f ¡}||g7 }t|dd |dkr„| d¡ |d	k r–| d¡ | d¡ qFq&|  |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ilistrX   r   r'   r   r   r   Útest_constrained_layout8›   s(    



rj   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   rh   r   r>   r   r?   zTest Suptitleé   N)	r-   r3   r4   r(   r   r   Ú
set_aspectr;   ÚsuptitlerB   r   r   r   Útest_constrained_layout9·   s    
 ÿ



rq   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    
ru   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	}qd| j||d
dd |  |d ¡}t|dd	 dS )z"Test for multiple nested gridspecsr)   )é   r   ©r+   rd   r   r   rH   r   rg   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}qr| j||ddd |  |d ¡}t|d
d dS )z4Test for multiple nested gridspecs with width_ratiosr)   )rb   r   rw   r   r   é   )r.   Zwidth_ratiosr   )Úheight_ratiosrg   r   r   rx   ry   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.r)   )r   é   rw   r   r   rH   Nr   r   é   r   r   T)r   rf   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 5 Q R X |  ¡ j	ddd dS )úTest that padding works.r   r)   r*   r   r   r   ç      4@r8   ©r   r@   rz   r9   r   )ZwpadZhpadgUUUUUUÕ?©Úw_padÚh_padN)
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   s2   t jdd\} }t|dd |  ddddg¡}dS )zTest ax.set_position.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ƒsPt‚dS )z
Test twinxr)   r*   r,   r   N)	r-   r3   Ztwinxr   rS   ÚallrT   ÚextentsrW   r˜   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ƒsdt	‚dS )z
Test twinyr)   r*   r,   r   rh   N)
r-   r3   Ztwinyr   r   rS   r   rT   rž   rW   r˜   r   r   r   Útest_constrained_layout19Q  s    

r    c                  C   sl   t  ddd¡} t  | | dd…df ¡}t ¡ }| ddddg¡}| | | |dd…dd…f ¡}| |¡ dS )z)Smoke test cl does not mess up added axeséûÿÿÿr   rf   Nr   r   r   )r    ZlinspaceÚhypotr-   r.   r—   r#   r;   )ZgxÚ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   rp   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*   ZSuptitlers   ©r$   N)
r-   r3   rS   r    r¥   rT   rž   rp   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   z
Suptitle{}N)rR   r-   r.   rJ   rK   rp   Úformat)rX   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   rf   r   r)   r*   rh   Nr   r–   )r   r@   r   r   rs   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   s\   t jdddd\} }|d  d¡ |  ¡  t |d  ¡ j¡}tjj	|ddd	d
gdd d S )Nr   r)   r*   re   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   sv  dD ]j} 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r,|jj 	g ¡ |jj
 	g ¡ | g ¡ | g ¡ q,| ¡ jddddd | ¡  | dkr$t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¶  sD    
ÿ

 ÿ
ÿÿÿÿrÃ   ztest_colorbars_no_overlapV.png)r³   c                  C   s|   t jddd} | jddddd}|D ]H}|j t ¡ ¡ |jdd	d
 | ddgddgg¡}| j	||dd q$|  
d¡ d S )N)r   rf   r)   rc   r   r   T©rl   rm   Úbothr¼   ©Zaxisr½   r   rf   Zvertical©r   ZorientationÚfoo)r-   r.   r3   r¿   Úset_major_formatterr   ÚNullFormatterr¾   Úimshowr;   rp   ©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 ]H}|j t ¡ ¡ |jd	d
d | 	ddgddgg¡}| j
||dd q.d S )N)rf   r   r)   rc   rÈ   r   r   TrÄ   rÅ   r¼   rÆ   r   rf   Z
horizontalrÇ   )r-   r.   rp   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  ddddg¡ |  ¡  |d  ¡ }tj |ddgddgg¡ t jdddd\} }|d  ddddg¡ |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‘   ç333333Ó?rs   é   ©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   s   t jdd\} }| d¡ d S ©Nr)   r*   r   ©r-   r3   ro   r0   r   r   r   Útest_bboxtightþ  s    r×   ztest_bbox.pngrs   g      @r   c                  C   s   t jdd\} }| d¡ d S 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sÜt‚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+   rd   Zgridspec_kwr   ZLabelg      ø¿g      ø?)r6   r   r¹   )rº   ÚatolN)r-   r3   Zset_ylimr   Zalign_ylabelsrS   r¿   rr   Zget_window_extentr    r¦   r§   rÀ   rW   )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sht	‚|j
|j
d ks|t	‚t jdd\} }|  ¡  | | j ¡ ¡}| jddd | jddd |  ¡  | | j ¡ ¡}|j|jd ksìt	‚|j
|j
d kst	‚d S )	Nr)   r*   ZBooZBooyg      $@rs   )r%   r«   )r-   r3   rS   Zget_tightbboxZcanvasZget_rendererZ	supxlabelZ	supylabelrU   rW   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 5 Q R X tjtdd* t  ¡ \} }|  dddœ¡ |  ¡  W 5 Q R X d S )NTrP   zwill be deprecatedrZ   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ddddgd |  ¡  | ¡ }|jdk sFt‚|jdk sTt‚t jdd\} }|  ¡ jddddgd |  ¡  | ¡ }|jdk sšt‚|jdk s¨t‚|j	dks¶t‚|j
dksÄt‚d S )Nr)   r*   r   rs   )Úrectr‘   rÏ   )r-   r3   rŽ   r   rS   rT   Úx1rW   rV   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¡¡}q®| 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   Ú
compressedTrk   rÐ   rÑ   rš   gâX·Ñ Î?gü©ñÒMbP?)rÙ   re   g™»–zæ?)r   rf   )r+   rl   rm   rd   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  s6    
 ÿ


  ÿ

rç   z
arg, state)TT)FFrã   c                 C   s$   t j| d\}}| ¡ |ks t‚d S )NrP   )r-   r3   Úget_constrained_layoutrW   )ÚargÚstater1   r   r   r   r   Útest_set_constrained_layout–  s    rë   c               	   C   sh   t  ¡ \} }t t¡H |  d¡ |  ¡ s.t‚|  d¡ |  ¡ rDt‚|  d¡ |  ¡ sZt‚W 5 Q R X d S )NTF)r-   r3   r\   r]   rß   rà   rè   rW   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 ƒƒrLt	‚d S )NT)rb   rb   )rQ   rd   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_objectsrW   )r1   r   r   r   Útest_layout_leak¬  s    
ÿrô   )r   F)r   )@rò   Z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   rY   ra   rj   rq   ru   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º   





	













 ÿ
 

 þ
 ÿþ
"
ü
