
    6Dh7                         S SK r S SKrS SKrS SKJr  S SKJr  SSKJ	r	  SSK
JrJr  SSKJr  S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rg)    N)assert_warns)Version   )Exporter)FakeRendererFullFakeRenderer   )pltc                 `    U" 5       n[        U5      nUR                  U 5        UR                  $ N)r   runoutput)figRendererrendererexporters       b/var/www/html/env/lib/python3.13/site-packages/plotly/matplotlylib/mplexporter/tests/test_basic.pyfake_renderer_outputr      s)    zH!HLL??    c                     [        U R                  5       R                  5       UR                  5       R                  5       5       H  u  p#X#:X  a  M   e   g r   )zipstripsplit)text1text2line1line2s       r   _assert_output_equalr      s>    EKKM//15;;=3F3F3HI~~ Jr   c                      [         R                  " 5       u  pUR                  [        S5      S5        [	        [        U [        5      S5        [	        [        U [        5      S5        g )N   z-kz
                         opening figure
                         opening axes
                         draw path with 20 vertices
                         closing axes
                         closing figure
                         z
                         opening figure
                         opening axes
                         draw line with 20 points
                         closing axes
                         closing figure
                         r
   subplotsplotranger   r   r   r   r   axs     r   
test_linesr'      sR    llnGCGGE"ItS,/		 S"23		r   c                      [         R                  " 5       u  pUR                  [        S5      S5        [	        [        U [        5      S5        [	        [        U [        5      S5        g )Nr   oka  
                         opening figure
                         opening axes
                         draw path with 25 vertices
                         draw path with 25 vertices
                         closing axes
                         closing figure
                         z
                         opening figure
                         opening axes
                         draw 2 markers
                         closing axes
                         closing figure
                         r!   r%   s     r   test_markersr*   3   sR    llnGCGGE!HdS,/	
 S"23		r   c                      [         R                  " 5       u  pUR                  [        S5      [        S5      5        [	        [        U [        5      S5        [	        [        U [        5      S5        g )N   aR  
                         opening figure
                         opening axes
                         draw path with 25 vertices
                         draw path with 25 vertices
                         draw path with 25 vertices
                         closing axes
                         closing figure
                         z
                         opening figure
                         opening axes
                         draw path collection with 3 offsets
                         closing axes
                         closing figure
                         )r
   r"   scatterr$   r   r   r   r   r%   s     r   test_path_collectionr.   O   sV    llnGCJJuQxq"S,/	 S"23		r   c                      [         R                  " 5       u  pUR                  S5        UR                  S5        UR	                  S5        UR                  SSS5        [        [        U [        5      S5        g )Nz
my x labelz
my y labelzmy titleg      ?zmy texta  
                         opening figure
                         opening axes
                         draw text 'my text' None
                         draw text 'my x label' xlabel
                         draw text 'my y label' ylabel
                         draw text 'my title' title
                         closing axes
                         closing figure
                         )	r
   r"   
set_xlabel
set_ylabel	set_titletextr   r   r   r%   s     r   	test_textr4   l   sZ    llnGCMM,MM,LLGGCi S,/		r   c                      [         R                  " 5       u  pUR                  [         R                  " SS5      5        UR                  [         R                  " SSS5      5        [        [        U [        5      S5        g )Nr   r   r	   r     
                         opening figure
                         opening axes
                         draw path with 25 vertices
                         draw path with 4 vertices
                         closing axes
                         closing figure
                         )r
   r"   	add_patchCircle	Rectangler   r   r   r%   s     r   	test_pathr;      sV    llnGCLLFA&'LLvq!,-S,/	
r   c                     [         R                  " 5       n U R                  S5      nUR                  [         R                  " SS5      5        UR                  [         R
                  " SSS5      5        [        [        U [        5      S5        g)zHif the fig is not associated with a canvas, FakeRenderer shall
not fail.o   r6   r	   r   r7   N)	r
   Figureadd_subplotr8   r9   r:   r   r   r   r%   s     r   test_Figurer@      sd     **,C		BLLFA&'LLvq!,-S,/	
r   c                      [         R                  " S5      u  pUS   R                  [        S5      5        US   R                  [        S5      5        [	        [        U [        5      S5        g )Nr   r      r	   
   ai  
                         opening figure
                         opening axes
                         draw path with 4 vertices
                         closing axes
                         opening axes
                         draw path with 10 vertices
                         closing axes
                         closing figure
                         )r
   r"   r#   r$   r   r   r   r%   s     r   test_multiaxesrD      sP    ll1oGCqEJJuQxqEJJuRyS,/		r   c                     [        [        R                  5      [        S5      :X  a  Sn O[        R                  " S5        [
        R                  R                  S5        [        R                  " SS9u  pUR                  [
        R                  R                  S5      [        R                  R                  SS	9  [        [        U[        5      S
W  S35        g )Nz3.4.1i  zTest fails for older matplotlibr   )r   r   )figsize)rC   rC   nearest)cmapinterpolationz{
                         opening figure
                         opening axes
                         draw image of size zi 
                         closing axes
                         closing figure
                         )r   
matplotlib__version__pytestskipnprandomseedr
   r"   imshowcmjetr   r   r   )
image_sizer   r&   s      r   
test_imagerU      s     z%%&''*::
56IINN1ll6*GCIIbiix(svvzzISS,/- .8L 9		r   c                      [         R                  " 5       u  pUR                  / SQSS9  UR                  5       R	                  S5        [        [        U [        5      S5        g )Nr	   r   r,   labelrX   Fa9  
                         opening figure
                         opening axes
                         draw path with 3 vertices
                         opening legend
                         closing legend
                         closing axes
                         closing figure
                         )r
   r"   r#   legendset_visibler   r   r   r%   s     r   test_legendr\      sJ    llnGCGGIWG%IIKE"S,/	r   c                      [         R                  " 5       u  pUR                  / SQSS9  UR                  / SQSSS9  UR                  5       R	                  S5        [        [        U [        5      S5        g )	NrW   rX   rY   )r   r   r   odotsTaK  
                         opening figure
                         opening axes
                         draw line with 3 points
                         draw 3 markers
                         opening legend
                         draw line with 2 points
                         draw text 'label' None
                         draw 1 markers
                         draw text 'dots' None
                         draw path with 13 vertices
                         closing legend
                         closing axes
                         closing figure
                         )r
   r"   r#   rZ   r[   r   r   r   r%   s     r   test_legend_dotsr`      s_    llnGCGGIWG%GGIs&G)IIKD! S"23	r   c                  T    [         R                  " 5       u  pUR                  S5        g )Nr   )r
   r"   axvliner%   s     r   test_blendedrc      s    llnGCJJqMr   )rJ   numpyrN   rL   numpy.testingr   packaging.versionr   r   r   	renderersr   r    r
   r   r   r'   r*   r.   r4   r;   r@   rD   rU   r\   r`   rc    r   r   <module>rj      s^       & %  6 
68:,$*(,$6r   