U
    y±Ëhl  ã                   @   s°   d dl Zd dlmZ d dlm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lmZ d dlmZ dd„ Zed	gd
dddd„ ƒZedgd
dddd„ ƒZdd„ ZdS )é    N)Úimage_comparison)ÚSubplot)ÚFloatingAxesÚGridHelperCurveLinear)ÚFixedLocator)Úangle_helperc                  C   s$   t jdd} t| dƒ}|  |¡ d S )N©é   r	   ©Zfigsizeéo   )ÚpltÚfigurer   Úadd_subplot©ÚfigZax© r   úT/tmp/pip-unpacked-wheel-44jxpman/mpl_toolkits/axisartist/tests/test_floating_axes.pyÚtest_subplot   s    
r   zcurvelinear3.pngÚdefaultr	   )ÚstyleZtolc               
   C   s”  t jdd} t ¡  tjd d¡tj 	¡  }t
|dt d¡tddd	d
dgƒt ¡ d d}| jt|d}d}t ¡  dd| ¡| }t
|ddd| d| ftdddgƒd}|jd|d |jd< }|jd j d¡ |jd j d¡ |jd  d¡ |jdd|dd}||jd< |jd d d! |j d"¡ |j d ¡ |j d#¡ | |¡}d$dd%dgdd&d
dg }	}
| |	|
¡ | |	|
d'¡\}| |j¡ d S )(Nr   r
   é´   é   )r   éh  é
   é   é   é   é   é   é   r   ©ÚextremesZgrid_locator1Úgrid_locator2Ztick_formatter1Ztick_formatter2©Z
axes_classÚgrid_helperr   r   r   é   é<   éZ   )r!   r"   Úright)ÚaxesÚleftúTest 1úTest 2)r*   r(   Fé   Úbottom©r)   Úaxis_directionÚzT©ÚallÚlabelúz = ?ú0.5éC   éK   r	   úk-)r   r   ÚmtransformsÚAffine2DÚscaleÚnpÚpiÚmprojectionsÚ	PolarAxesÚPolarTransformr   r   Ú
LocatorDMSr   ÚFormatterDMSr   r   Znew_fixed_axisÚaxisr4   Úset_textÚset_visibleÚnew_floating_axisÚtoggleÚlineÚ	set_colorÚget_aux_axesÚscatterÚplotÚset_clip_pathÚpatch)r   Útrr$   Úax1Zr_scaleZtr2Zgrid_helper2rD   Úax2ÚxxÚyyÚlr   r   r   Útest_curvelinear3   sJ    ÿúý
ÿ

rV   zcurvelinear4.pnggÍÌÌÌÌÌì?c            	   
   C   sN  dt jd< t jdd} t ¡  tjd d¡tj	 
¡  }t|dt d¡td	d
dddgƒt ¡ d d}| jt|d}|jd j d¡ |jd j d¡ |jd  d¡ |jdd|dd}||jd< |jddd |j d¡ |j d¡ |j d¡ |j d¡ | |¡}dddd gd	ddd
g }}| ||¡ | ||d!¡\}| |j¡ d S )"Nr   ztext.kerning_factorr   r
   r   r   )éx   r%   r   r   r	   r   r   r   r   r    r#   r*   r+   r(   r,   ÚtopFéF   r.   r/   r1   Tr2   r5   r6   r7   r'   r8   r%   r9   ) r   ZrcParamsr   r:   r;   r<   r=   r>   r?   r@   rA   r   r   rB   r   rC   r   r   rD   r4   rE   rF   rG   rH   Zset_axis_directionrI   rJ   rK   rL   rM   rN   rO   )	r   rP   r$   rQ   rD   rR   rS   rT   rU   r   r   r   Útest_curvelinear4D   s>    
ÿú
ÿ

rZ   c                  C   sJ   t  ¡ } t| dƒ}|  |¡ |jdddd|jd< |jd jdksFt‚d S )Nr   r   r   r*   )Z	nth_coordÚvaluer0   Úy)r   r   r   r   rG   rD   Z_axis_directionÚAssertionErrorr   r   r   r   Útest_axis_directionk   s    

ÿr^   )Znumpyr=   Zmatplotlib.pyplotZpyplotr   Zmatplotlib.projectionsZprojectionsr?   Zmatplotlib.transformsZ
transformsr:   Zmatplotlib.testing.decoratorsr   Z!mpl_toolkits.axisartist.axislinesr   Z%mpl_toolkits.axisartist.floating_axesr   r   Z#mpl_toolkits.axisartist.grid_finderr   Zmpl_toolkits.axisartistr   r   rV   rZ   r^   r   r   r   r   Ú<module>   s   
-
&