3
$ßL]f  ã               @   sÐ   d dl Z d dlmZ d dljZd dljZd dl	j
Zd dlmZmZmZ edgdd�dd„ ƒZd	d
„ Zdd„ Zdd„ Ze jjddgd gd d!gd"gd fƒe jjdd$ƒe jjdd&ƒe jjdd'ƒdd„ ƒƒƒƒZdS )(é    N)Úimage_comparison)ÚAnchoredOffsetboxÚDrawingAreaÚ_get_packed_offsetsZoffsetbox_clippingT)Zbaseline_imagesZremove_textc           	   C   s®   t jƒ \} }d}t||dd�}tjd||dddd�}tj| d |d	 g|d
 |d
 gddd�}td|ddd|jdd�}|j	|ƒ |j	|ƒ |j	|ƒ |j
dƒ |jdƒ d S )Néd   T)Úclipr   z#CCCCCCÚNone)Ú	facecolorÚ	edgecolorÚ	linewidthç      à?g      ø?é   Úblacké
   )Úcolorr   Úcenterg        F)ÚlocÚchildÚpadÚframeonÚbbox_to_anchorÚbbox_transformÚ	borderpadé   )r   r   )r   r   )r   r   )r   r   )ÚpltÚsubplotsr   ÚmpatchesÚ	RectangleÚmlinesÚLine2Dr   Ú	transAxesÚ
add_artistZset_xlimZset_ylim)ÚfigÚaxÚsizeÚdaÚbgÚlineÚanchored_box© r)   úG/tmp/pip-install-edjban26/matplotlib/matplotlib/tests/test_offsetbox.pyÚtest_offsetbox_clipping
   s.    	
"



r+   c           	   C   sÀ   t jƒ \} }d}t||dd�}tjd||dddd�}tj| d |d	 g|d
 |d
 gddd�}td|ddd|jdd�}|j	|ƒ |j	|ƒ |j	|ƒ | j
jƒ  | j s¬t‚d|_| js¼t‚d S )Nr   T)r   r   z#CCCCCCr   )r	   r
   r   ç      à?g      ø?r   r   r   )r   r   r   g        F)r   r   r   r   r   r   r   )r   r   )r,   r,   )r   r   r   r   r   r   r   r   r    r!   ÚcanvasÚdrawÚstaleÚAssertionErrorZclip_children)r"   r#   r$   r%   r&   r'   r(   r)   r)   r*   Útest_offsetbox_clip_children-   s2    
"



r1   c              C   sb   ddddddddd	d
dœ
} t jƒ \}}tddƒ}x"| D ]}t||d�}|j|ƒ q6W |jjƒ  d S )Nr   r   é   é   é   é   é   é   é	   r   )
zupper rightz
upper leftz
lower leftzlower rightÚrightzcenter leftzcenter rightzlower centerzupper centerr   r   )r   r   )r   r   r   r   r!   r-   r.   )Úcodesr"   r#   r%   Úcoder(   r)   r)   r*   Útest_offsetbox_loc_codesR   s     

r<   c              C   sR   t jƒ \} }ddg}ddg}|j|dd� |j|dd� |jddd� | jƒ  d S )Nr   r   zseries 1)Úlabelzseries 2Úexpand)ZncolÚmode)r   r   ZplotZlegendZtight_layout)r"   r#   Zd1Zd2r)   r)   r*   Útest_expand_with_tight_layoutg   s    r@   Úwd_listé–   r   r2   çš™™™™™¹?r   Útotaléú   r   Úsepr?   r>   ÚfixedÚequalc             C   s   t | |||d� d S )N)r?   )r   )rA   rD   rF   r?   r)   r)   r*   Útest_get_packed_offsetst   s    
rI   )rB   r   )rB   r   )rC   r   )rC   r   éÿÿÿÿ)rE   r   r   rJ   NrJ   )rE   r   r   rJ   )r>   rG   rH   )ZpytestZmatplotlib.testing.decoratorsr   Zmatplotlib.pyplotZpyplotr   Zmatplotlib.patchesZpatchesr   Zmatplotlib.linesÚlinesr   Zmatplotlib.offsetboxr   r   r   r+   r1   r<   r@   ÚmarkZparametrizerI   r)   r)   r)   r*   Ú<module>   s   


#%