
    ^j$                         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 d dlmZ d dlmZmZ d dlmZ d dlmZ d Z edgd	
      d        Z edgd	d      d        Zd Zd Zy)    N)image_comparison)Subplot)FloatingAxesGridHelperCurveLinear)FixedLocator)angle_helperc                  j    t        j                  d      } t        | d      }| j                  |       y )N   r   figsizeo   )pltfigurer   add_subplotfigaxs     {/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/mpl_toolkits/axisartist/tests/test_floating_axes.pytest_subplotr      s(    
**V
$C	c	BOOB    zcurvelinear3.pngmpl20)stylec            	         t        j                  d      } t        j                         j	                  t
        j                  dz  d      t        j                  j                         z   }t        |dt        j                  d      t        g d      t        j                         d       }| j                  t         |	      }d
}t        j                         j	                  dd|z        |z   }t        |ddd
|z  d|z  ft        g d            }|j#                  d|      x|j$                  d<   }|j$                  d   j&                  j)                  d       |j$                  d   j&                  j)                  d       |j$                  d   j+                  d       |j-                  dd|d      }||j$                  d<   |j/                  dd       |j&                  j)                  d       |j&                  j+                  d       |j0                  j3                  d       |j5                  |      }g dg d }
}	|j7                  |	|
       |j9                  |	|
d!      \  }|j;                  |j<                         y )"Nr
   r         )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   F   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ls               r   test_curvelinear3rf      s   
**V
$C



 
&
&ruus{A
6

 
 
/
/
12B'
 "--b1"#34$113K //\{/
KCG



 
&
&q!g+
6
;C(S"w,G4"<02L
  ,::7:MMCHHWHHV##H-HHW$$X.HH_))%0((AC8@ ) BDCHHSMKKDK%JJ JJ4 II


2
C|BKKB	"b$	BAOOCIIr   zcurvelinear4.pngg{Gz?)r   tolc            	         t        j                  d      } t        j                         j	                  t
        j                  dz  d      t        j                  j                         z   }t        |dt        j                  d      t        g d      t        j                         d       }| j                  t         |	      }|j#                          |j$                  d
   j&                  j)                  d       |j$                  d   j&                  j)                  d       |j$                  d   j+                  d       |j-                  dd|d      }||j$                  d<   |j/                  dd       |j&                  j1                  d       |j&                  j)                  d       |j&                  j+                  d       |j2                  j5                  d       |j7                  |      }g dg d}}|j9                  ||       |j;                  ||d      \  }|j=                  |j>                         y )Nr
   r   r   r   )x   r/   r   r   r   r!   r&   r,   r4   r5   r2   r6   topFF   r8   r9   r;   Tr<   r?   r@   rA   rD   rE   ) r   r   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   s	            r   test_curvelinear4rn   B   s   
**V
$C



 
&
&ruus{A
6

 
 
/
/
12B'
!"--a0"#34$113K //\{/
KCIIKHHV##H-HHW$$X.HHUO&((BS8@ ) BDCHHSMKKDK%JJ!!%(JJ JJ4 II


2
C|BKKB	"b$	BAOOCIIr   c                      t        j                         } t        | d      }| j                  |       |j	                  ddd      |j
                  d<   |j
                  d   j                  dk(  sJ y )Nr   r   r   r4   )	nth_coordvaluer:   y)r   r   r   r   rT   rQ   _axis_directionr   s     r   test_axis_directionrt   g   se    
**,C	c	BOOB''!17= ( ?BGGCL773<''6111r   c                     t        j                  d      d        } d }t        j                         }|j	                  t
        t        | |fd            }|j                  j                          |j                  D ]L  }|j                  |   j                  j                  D ]$  \  }}|dz  t        j                  d	d
      k(  r$J  N y )Nignore)dividec                     t        j                  | dz         t        j                  |dz         z
  t        j                  | dz         t        j                  |dz         z   fS )N)rI   exp)xrr   s     r   r]   z0test_transform_with_zero_derivatives.<locals>.try   sO    vvq"uf~2v.2vB0OOOr   c                 ~    t        j                  | |z   dz         dz  t        j                  || z
  dz         dz  fS )Nr"   g      ?)rI   log)uvs     r   inv_trz4test_transform_with_zero_derivatives.<locals>.inv_tr}   s=    1a C(BFFAaC7O+;s*CCCr   )r   r   r   r   )r'   r,   r1   -   gMbP?)abs)rI   errstater   r   r   r   r   canvasdrawrQ   major_tickslocs_anglespytestapprox)r]   r   r   r   kre   as          r   $test_transform_with_zero_derivativesr   q   s     [[!P "PD **,C	-BL>.3 
 
4B JJOOWW 9GGAJ**66 	9DAqr6V]]248888	99r   )numpyrI   r   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   rn   rt   r    r   r   <module>r      sw       - + : 5) < 0 %&g6( 7(V %&g4@! A!H29r   