B
    Mô`S  ã               @   sž   d dl Zd dlZd dlZd dlmZmZ d dlm	Z
 e d¡sJej d¡Zedgddgdd	�d
d„ ƒZeƒ dd„ ƒZeƒ dd„ ƒZdd„ Zdd„ Zdd„ ZdS )é    N)Úcheck_figures_equalÚimage_comparisonTz$Missing TeX of Ghostscript or dvipngÚtest_usetexZpdfZpngÚmpl20)Zbaseline_imagesÚ
extensionsÚstylec              C   sÂ   dt jd< t ¡ } |  d¡}ddtdddd	�d
œ}|jd|Ž |jd|Ž |jd|Ž |jd|Ž |jd|Ž x"dd„ |jD ƒD ]}| |¡ q€W x"dd„ |jD ƒD ]}| 	|¡ q¤W | 
¡  d S )NTztext.usetexéo   Zbaselineé   r   ÚkÚnone)ÚpadZ	edgecolorZ	facecolor)ZverticalalignmentÚsizeZbboxçš™™™™™É?çffffffæ?úO\LaTeX\ $\left[\int\limits_e^{2e}\sqrt\frac{\log^3 x}{x}\,\mathrm{d}x \right\}$ç333333Ó?Úlgçš™™™™™Ù?ú$\frac{1}{2}\pi$ç333333ã?ú	$p^{3^A}$çš™™™™™é?ú	$p_{3_2}$c             S   s   h | ]}|  ¡ d  ’qS )r   )Úget_position)Ú.0Út© r   ú@/tmp/pip-unpacked-wheel-0c1wfn4v/matplotlib/tests/test_usetex.pyú	<setcomp>"   s    ztest_usetex.<locals>.<setcomp>c             S   s   h | ]}|  ¡ d  ’qS )é   )r   )r   r   r   r   r   r   $   s    )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )ÚmplÚrcParamsÚpltÚfigureÚadd_subplotÚdictÚtextZtextsZaxvlineZaxhlineZset_axis_off)ÚfigZaxÚkwargsÚxÚyr   r   r   r      s"    

c             C   s   dt jd< |  ddd¡ d S )NTztext.usetexg      à?z% a comment)r    r!   r&   )Úfig_testÚfig_refr   r   r   Ú
test_empty)   s    
r-   c             C   s*   dt jd< |  ddd¡ | ddd¡ d S )NTztext.usetexg      à?z$-$u   âˆ’)r    r!   r&   )r+   r,   r   r   r   Útest_unicode_minus/   s    
r.   c              C   s:   dt jd< t  ¡ } |  ¡  dd¡ dtjd< | j ¡  d S )NTzaxes.formatter.use_mathtextéÿÿÿÿr   ztext.usetex)r"   r!   r#   r$   Zset_xlimr    ÚcanvasÚdraw)r'   r   r   r   Útest_mathdefault6   s
    

r2   c              C   s¢   t j d¡ i } t ¡ }xndD ]f}| ¡  x&|D ]}|jddd|› d�dd� q0W |j ¡  t	 
|j ¡ ¡d dkjd	d
� ¡ | |< qW t|  ¡ ™ƒd	ksžt‚d S )Nr   ))r   )r/   )r/   r   g      à?ú$T)Úusetex).r   éÿ   r   )Zaxis)r    r   Zuser"   r#   Zclfr&   r0   r1   ÚnpÚarrayZbuffer_rgbaÚanyÚsumÚlenÚvaluesÚAssertionError)Zheightsr'   Úvalsr)   r   r   r   Útest_minus_no_descent@   s    


r>   c              C   s2   dt jd< t  ¡ } | jddddd� | j ¡  d S )Nz\usepackage[full]{textcomp}ztext.latex.preambleg      à?zhello, worldT)r4   )r"   r!   r#   r&   r0   r1   )r'   r   r   r   Útest_textcomp_fullR   s    
r?   )Znumpyr6   ZpytestZ
matplotlibr    Zmatplotlib.testing.decoratorsr   r   Zmatplotlib.pyplotZpyplotr"   Zcheckdep_usetexÚmarkÚskipZ
pytestmarkr   r-   r.   r2   r>   r?   r   r   r   r   Ú<module>   s   

