o
    -h                     @   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	   figsizeo   )pltfigurer   add_subplotfigax r   d/var/www/vscode/kcb/lib/python3.10/site-packages/mpl_toolkits/axisartist/tests/test_floating_axes.pytest_subplot   s   
r   zcurvelinear3.pngdefaultr	   )styletolc                  C   s  t jdd} t tjd dtjj	dd }t
|dtdtg d	t d d
}| jt|d}d}t dd| | }t
|ddd| d| ftg d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 ||}g d g d!}	}
||	|
 ||	|
d"\}||j d S )#Nr   r
         Fapply_theta_transforms)r   h  
                     r   extremesgrid_locator1grid_locator2tick_formatter1tick_formatter2
axes_classgrid_helperr   r   r   r   )   <   Z   )r'   r)   right)axesleftTest 1Test 2)r4   r2      bottomr3   axis_directionzTalllabelz = ?0.5C   r1   K   r/   r"   r	   r%   r#   k-)r   r   mtransformsAffine2Dscalenppimprojections	PolarAxesPolarTransformr   r   
LocatorDMSr   FormatterDMSr   r   new_fixed_axisaxisr>   set_textset_visiblenew_floating_axistoggleline	set_colorget_aux_axesscatterplotset_clip_pathpatch)r   trr.   ax1r_scaletr2grid_helper2rQ   ax2xxyylr   r   r   test_curvelinear3   sJ   




rf   zcurvelinear4.pngg?c            	      C   sL  dt jd< t jdd} t tjd dtj	j
dd }t|d	td
tg d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 ||}g dg d}}||| |||d\}||j  d S )Nr$   ztext.kerning_factorr   r
   r   r   Fr   )x   r/   r   r   r	   r!   r&   r,   r4   r5   r2   r6   topF   r8   r9   r;   Tr<   r?   r@   rA   rD   rE   )!r   rcParamsr   rF   rG   rH   rI   rJ   rK   rL   rM   r   r   rN   r   rO   r   r   clearrQ   r>   rR   rS   rT   rU   set_axis_directionrV   rW   rX   rY   rZ   r[   r\   )	r   r]   r.   r^   rQ   rb   rc   rd   re   r   r   r   test_curvelinear4D   s@   




rm   c                  C   sJ   t  } t| d}| | |jdddd|jd< |jd jdks#J d S )Nr   r   r   r4   )	nth_coordvaluer:   y)r   r   r   r   rT   rQ   _axis_directionr   r   r   r   test_axis_directionl   s   

rr   )numpyrI   matplotlib.pyplotpyplotr   matplotlib.projectionsprojectionsrK   matplotlib.transforms
transformsrF   matplotlib.testing.decoratorsr   !mpl_toolkits.axisartist.axislinesr   %mpl_toolkits.axisartist.floating_axesr   r   #mpl_toolkits.axisartist.grid_finderr   mpl_toolkits.axisartistr   r   rf   rm   rr   r   r   r   r   <module>   s    
-
'