
    9Цii6                        S SK r S SKrS SKrS SKJr  S SKrS SKrS SK	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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&S r'S  r(S! r)S" r*g)#    N)Path)subprocess_run_for_testing)pyplotc                    [         R                  " SSS9  [        [        R                  5      R
                  S   S-  nUR                  5       (       d  [         R                  " S5        [        [        R                  5      R                  5       nU S-  nUR                  US5        [        [        R                  [        U5      [        U5      /S	S
9  UR                  S5      nX$:w  a`  SR                  [         R"                  " UR%                  S5      UR%                  S5      SSSSS95      n[         R&                  " SU-  5        g g )Nblackz24.1)
minversion   ztools/boilerplate.pyzboilerplate.py not foundz	pyplot.pyzutf-8T)check
zfound pyplot.pyzexpected pyplot.pyr    )fromfiletofilenlinetermzpyplot.py is not up-to-date. Please run 'python tools/boilerplate.py' to update pyplot.py. This needs to be done from an environment where your current working copy is installed (e.g. 'pip install -e'd). Here is a diff of unexpected differences:
%s)pytestimportorskipr   mpl__file__parentsexistsskipplt	read_text
write_textr   sys
executablestrjoindifflibunified_diffsplitfail)tmp_path
gen_scriptorig_contentsplt_filenew_contentsdiff_msgs         [/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/matplotlib/tests/test_pyplot.pytest_pyplot_up_to_dater*      s   
F3cll#++A.1GGJ./&002M+%Hw/	Z#h-8 %%g.L$99  ##D)<+=+=d+C*+b	"# 	< ?G	G	
 %    c                 p   [         R                  R                  [         R                  SS5      [         R                  R	                  [         R                  S5      S
S j5       5       n[
        R                  " U5      S
S j5       nU" S 5        U" S S9  U" S S S9  U" S S S9  U (       a   e[        R                  " [         R                  5         U" S S	9  S S S 5        [        R                  " [         R                  5         U" S S 5        S S S 5        g ! , (       d  f       NE= f! , (       d  f       g = f)Noldnewkwoc                     g N r.   r/   s     r)   func1test_copy_docstring_and_deprecators.<locals>.func.   s     	r+   c                     g r1   r2   r3   s     r)   wrapper_func9test_copy_docstring_and_deprecators.<locals>.wrapper_func3   s    r+   )r.   )r/   r3   )r-   r1   )
r   _apirename_parameter__version__make_keyword_onlyr   _copy_docstring_and_deprecatorsr   warnsMatplotlibDeprecationWarning)recwarnr4   r7   s      r)   #test_copy_docstring_and_deprecatorsrA   -   s    XXsu=XX7 8 > 	((. / T4 Tt$;	c66	7 
8	c66	7T4  
8	7 
8	7	7	7s   D
D'
D$'
D5c                     [         R                  " 5       u  p[         R                  " S5        UR                  5       (       a   e[         R                  " S5        UR                  5       (       d   e[         R                  " 5         UR                  5       (       a   e[         R                  " 5         UR                  5       (       d   eg )NFT)r   subplotsboxget_frame_on)figaxs     r)   test_pyplot_boxrH   B   s    llnGCGGEN    GGDM??GGI    GGI??r+   c                  :    [         R                  " / SQ/ SQ5        g )N)   r	      )r   	stackplotr2   r+   r)   test_stackplot_smokerM   N   s    MM)Y'r+   c                  $   [         R                  " [        5         [        R                  " SS9  S S S 5        [         R                  " [        5         [        R                  " SS9  S S S 5        g ! , (       d  f       NF= f! , (       d  f       g = f)NrJ   )nrows)ncols)r   raises	TypeErrorr   subplotr2   r+   r)   test_nrows_errorrT   S   sO    	y	!! 
"	y	!! 
"	! 
"	!	!	!s   A0B0
A>
Bc                  h   [         R                  " 5         [        R                  " 5       (       d   e[         R                  " 5          [        R                  " 5       (       a   e S S S 5        [        R                  " 5       (       d   e[         R                  " 5         [        R                  " 5       (       a   e[         R                  " 5          [        R                  " 5       (       a   e S S S 5        [        R                  " 5       (       a   eg ! , (       d  f       N= f! , (       d  f       N<= fr1   )r   ionr   is_interactiveioffr2   r+   r)   	test_ioffrY   Z   s    GGI	%%''''' 
HHJ!!####	%%''''' 
!!##### 
 
   DD#
D #
D1c                  h   [         R                  " 5         [        R                  " 5       (       a   e[         R                  " 5          [        R                  " 5       (       d   e S S S 5        [        R                  " 5       (       a   e[         R                  " 5         [        R                  " 5       (       d   e[         R                  " 5          [        R                  " 5       (       d   e S S S 5        [        R                  " 5       (       d   eg ! , (       d  f       N= f! , (       d  f       N<= fr1   )r   rX   r   rW   rV   r2   r+   r)   test_ionr\   h   s    HHJ!!####	!!#### 
!!####GGI	!!#### 
 
 
rZ   c                     [         R                  " 5         [         R                  " 5          [        R                  " 5       (       a   e[         R                  " 5          [        R                  " 5       (       d   e S S S 5        [        R                  " 5       (       a   e S S S 5        [        R                  " 5       (       d   e[         R                  " 5          [         R                  " 5          [        R                  " 5       (       a   e S S S 5        S S S 5        [        R                  " 5       (       d   e[         R                  " 5          [         R                  " 5         S S S 5        [        R                  " 5       (       d   e[         R                  " 5         [         R                  " 5          [        R                  " 5       (       d   e[         R                  " 5          [        R                  " 5       (       a   e S S S 5        [        R                  " 5       (       d   e S S S 5        [        R                  " 5       (       a   e[         R                  " 5          [         R                  " 5          [        R                  " 5       (       d   e S S S 5        S S S 5        [        R                  " 5       (       a   e[         R                  " 5          [         R                  " 5         S S S 5        [        R                  " 5       (       a   eg ! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN.= f! , (       d  f       GN8= f! , (       d  f       GN= f! , (       d  f       GNo= f! , (       d  f       GN\= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       N= fr1   )r   rV   rX   r   rW   r2   r+   r)   test_nested_ion_ioffr^   v   sG   GGI 
%%''''WWY%%'''' %%'''''	 

  
XXZ))+++++  
 	
 
 HHJ 
!!####XXZ))+++++ !!####	 

 !!#### 
WWY%%''''  
 !!####		 
!!#####E Y 
 Z 

 
 Z 
 Y 

 
s   2L"L;$L"M/L4MM22M<$M*$M< N 6NN N2
L	L""
L14
M	>M
M
M'*
M9	4M<<
N
N	N  
N/2
O c                       [         R                  " S5        g ! [         a  n [        U 5      S:X  d   e S n A g S n A ff = f)Ng?zQclose() argument must be a Figure, an int, a string, or None, not <class 'float'>)r   closerR   r   )es    r)   
test_closerb      sD    B		# B1v B B 	B BBs    
>9>c                  0   [         R                  " S5      n U [         R                  " 5       L d   e[         R                  " S5      nU[         R                  " 5       L d   e[         R                  " S5      nU [         R                  " 5       L d   eXL d   eg )Ny   z   )r   rS   gcaax1ax2ax3s      r)   test_subplot_reuserk      sr    
++c
C#'')
++c
C#'')
++c
C#'')::r+   c                  \   [         R                  " 5         [         R                  " 5       n [         R                  " 5       nU c   eXLd   e[         R                  " 5         [         R                  " 5         [         R                  " SS9n [         R                  " SS9nU c   eXLd   e[         R                  " 5         [         R                  " 5         [         R                  " SS9n [         R                  " 5       nU c   eUR                  S:X  d   eXLd   e[         R                  " 5         g )Npolar
projectionrectilinear)r   figureaxesr`   namerG   rh   s     r)   test_axes_kwargsru      s    JJL	B
((*C>>==IIKJJL	W	%B
((g
&C>>==IIKJJL	W	%B
((*C>>88}$$$==IIKr+   c                  &   [         R                  " 5       n [         R                  " SSS5      n[         R                  " SSS5      n[         R                  " SSS5      n[         R                  " SSSSS9n[         R                  " SSSSS9nUc   eX!L d   eX1Ld   eXALd   eXEL d   eXR                  ;   d   eX0R                  ;   d   eX@R                  ;   d   eUR                  S:X  d   eUR                  S:X  d   eUR                  S:X  d   eg )NrJ   r	   rm   rn   rp   )r   rq   rS   rr   rs   )rF   rG   rh   ri   rj   ax4s         r)   test_subplot_replace_projectionrx      s     **,C	Q1	B
++aA
C
++aA
C
++aA'
2C
++aA'
2C>>99====::>>((??((??77m###88}$$$88wr+   c                     [         R                  " SSS9n [         R                  " SSS9nXL d   eU R                  5         [         R                  " SSS9nXLd   eU [         R                  " 5       R                  ;  d   eg )Nrm   r   )ro   theta_offsetrJ   )r   rS   removegcfrr   rg   s      r)   test_subplot_kwarg_collisionr}      sg    
++q
9C
++q
9C::JJL
++q
9C>>cgginn$$$r+   c                      [         R                  " 5         [         R                  " 5       n [         R                  " 5       nU c   eXL d   e[         R                  " 5         g r1   )r   rq   rf   r`   rt   s     r)   test_gcar      s>    JJL	B
'')C>>99IIKr+   c                  l   [         R                  " S5      n U [         R                  " 5       L d   eU [         R                  " S5      L d   eU R                  5         [         R                  " SSS9nU[         R                  " 5       L d   eU [         R                  " 5       R
                  ;  d   eU[         R                  " S5      L d   eUR                  5         [         R                  " SSS9nU[         R                  " 5       L d   eX!Ld   eU[         R                  " 5       R
                  ;  d   eg )No   rm   rn   rp   )r   rS   rf   r{   r|   rr   rg   s      r)   test_subplot_projection_reuser      s    
++c
C#'')#++c""""JJL
++cg
.C#'')cgginn$$$#++c""""JJL ++cm
4C#'')>>cgginn$$$r+   c                  .   [         R                  " SSS9n [         R                  " SSS9n[         R                  " SSSS9nXL d   eXL d   e[        R                  " [        SS9   [         R                  " SSS	S9nS S S 5        g ! , (       d  f       g = f)
Nr   rm   rn   T)rm   )rm   ro   zpolar=True, yet projection='3d'match3d)r   rS   r   rQ   
ValueErrorrg   s      r)    test_subplot_polar_normalizationr     s    
++cg
.C
++c
&C
++c'
:C::::	z>
@kk#Td;
@ 
@ 
@s   &B
Bc                  v   [        5       n [        R                  " 5       nU R                  U5        SnU Hd  nUR	                  5         [        R                  " US9nU[        R                  " 5       L d   eUR
                  U:X  d   eU R                  U5        Mf     [        U 5      S[        U5      -   :X  d   eg )N)aitoffhammerlambert	mollweiderm   rp   r   rn   rJ   )setr   rS   addr{   rs   len)created_axesrG   projectionsprojs       r)   test_subplot_change_projectionr     s    5L	BR1K
		[[D)S[[]"""ww$  |C$4 4444r+   c                  N   [         R                  " SSS5      u  n [        U [        R                  R
                  5      (       d   e[         R                  " SSS5      u  n[        U[        R                  R
                  5      (       d   eU R                  UR                  L d   eg )Ng        g      ?rogQ?      ?bo)r   rm   
isinstancer   linesLine2Drr   )ln1ln2s     r)   test_polar_second_callr   .  sz    99RT"DCc399++,,,,99T2t$DCc399++,,,,88sxxr+   c                     [         R                  " / SQ5      n [         R                  " / SQS9n[        R                  R	                  UR
                  R                  5       U R
                  R                  5       5        [         R                  " / SQ5      n [         R                  " / SQ/ SQS9n[        R                  R	                  UR
                  R                  5       U R
                  R                  5       5        g )N)皙?r   r   r   )position)皙?r   皙?r   )r   rr   nptestingassert_allclosebbox
get_points)axrefaxtests     r)   test_fallback_positionr   8  s    HH)*EXX34FJJv{{557$zz4468 HH)*EXX*5IJFJJv{{557$zz4468r+   c                  &   [         R                  " 5       n U R                  S5      n[         R                  " 5         [         R                  " 5       U :w  d   e[         R                  " US   5      n[         R                  " 5       U :X  d   eX :X  d   eg )Nr	   rJ   )r   rq   
subfiguresr|   )fig1subfigscurrents      r)   %test_set_current_figure_via_subfigurer   F  sh    ::<Dooa GJJL779jj$G779??r+   c                  4   [         R                  " 5       n U R                  S5      nUS   R                  SSS9nUS   R                  SSS9  [         R                  " 5       U:w  d   e[         R
                  " U5        [         R                  " 5       U:X  d   eg )Nr	   r   rJ   T)squeeze)r   rq   r   rC   rf   sca)rF   r   rG   s      r)   "test_set_current_axes_on_subfigurer   R  sz    
**,CnnQG			Q		-BAJ4(779??GGBK779??r+   c                      [         R                  " S5      n [        R                  R	                  U R
                  SSSR                  S5      SS9  g )NIPythonz--pylabz-c;)zimport matplotlib.pyplot as pltz<assert plt._REPL_DISPLAYHOOK == plt._ReplDisplayHook.IPYTHON<   )timeout)r   r   r   r   subprocess_run_helperstart_ipythonr   )r   s    r)   test_pylab_integrationr   ^  sN    !!),GKK%% 
 	  & 	r+   c                     [        [        5      R                  S-  n U R                  5       (       d  [        R
                  " S5        S nU R                  5       R                  S5      n[        U" U5      5      n[        [        R                  " 5       5      nUR                  U5      nU(       a  [        SU< 35      eUR                  U5      nU(       a  [        SU< 35      eg)z6Test that pyplot_summary lists all the plot functions.z#../../../doc/api/pyplot_summary.rstz#Documentation sources not availablec                    / nSnU  H  nU(       d  UR                  S5      (       a  SnM$  M&  U(       a  UR                  S5      (       a  ME  US   R                  5       (       d  SnMa  UR                  UR                  5       5        M     U$ )a  
Return a list of all the functions that are mentioned in the
autosummary blocks contained in *lines*.

An autosummary block looks like this::

    .. autosummary::
       :toctree: _as_gen
       :template: autosummary.rst
       :nosignatures:

       plot
       plot_date

Fz.. autosummary::Tz   :r   )
startswithisspaceappendstrip)r   	functionsin_autosummarylines       r)   extract_documented_functions=test_doc_pyplot_summary.<locals>.extract_documented_functionsr  s      	D!??#566%)N 7 tv66Aw((%*N  .  r+   r   zsThe following pyplot functions are not listed in the documentation. Please add them to doc/api/pyplot_summary.rst: zThe following functions are listed in the pyplot documentation, but they do not exist in pyplot. Please remove them from doc/api/pyplot_summary.rst: N)r   r   parentr   r   r   r   r!   r   r   _get_pyplot_commands
differenceAssertionError)pyplot_docsr   r   doc_functionsplot_commandsmissingextras          r)   test_doc_pyplot_summaryr   l  s    x.''*OOK9:B !!#))$/E4U;<M0023M&&}5GMk 	 $$]3ECCH)MN 	N r+   c                     [         R                  " 5         [         R                  " [        R                  " SS5      5        [         R
                  " SS9u  p[        R                  " U[        R                  " / [        R                  S9:H  5      (       d   eU/ :X  d   e[         R                  " SS/SS	/SS
9  [         R                  " 5       nUR                  SS9n UR                  SS9n[        R                  " U [        R                  " SS/5      :H  5      (       d   eU Vs/ s H  o3R                  5       PM     snSS	/:X  d   eg s  snf )NrJ   
   T)minor)dtypeg      @g      @ab)tickslabelsr   )r   rq   plotr   arangexticksallarrayfloat64yticksrf   
get_yticksget_yticklabelsget_text)tick_postick_labelsrG   ls       r)   test_minor_ticksr     s    JJLHHRYYq"JJT2H66+"BJJ!??@@@@"JJc3Zc
$?	B}}4}(H$$4$0K66(bhhSz223333"-.+QJJL+.3*<<<.s   'Ec                     [         R                  " S5        [         R                  " 5       n [         R                  " 5       n [        [         R                  " 5       5      S:X  d   e[         R                  " S5        [        [         R                  " 5       5      S:X  d   e[         R                  " S5        [        [         R                  " 5       5      S:X  d   eg )Naggr	   svg)r   switch_backendrq   r   get_fignums)rF   s    r)   test_switch_backend_no_closer     s    u
**,C
**,Cs !Q&&&us !Q&&&us !Q&&&r+   c                     SU l         g )NT)_test_was_here)rq   s    r)   figure_hook_exampler     s
     Fr+   c                      SS/0n [         R                  " U 5         [        R                  " 5       nS S S 5        WR                  (       d   eg ! , (       d  f       N"= f)Nzfigure.hooksz0matplotlib.tests.test_pyplot:figure_hook_example)r   
rc_contextr   rq   r   )test_rcrF   s     r)   test_figure_hookr     sL     	KLG 
	 jjl 
!  
!	 s   A
Ac                     [         R                  " SSS9n [        R                  " [        SS9   [         R                  " S[
        R                  " SS/5      S9nS S S 5        [        R                  " [        SS9   [         R                  " U [
        R                  " SS	/5      S9  S S S 5        U WL d   e[         R                  " S5      nXL d   eg ! , (       d  f       N= f! , (       d  f       NC= f)
NrJ   )rJ   r	   )figsizez)Ignoring specified arguments in this callr   rK            )r   rq   r   r>   UserWarningr   r   )rF   fig2fig3s      r)   test_multiple_same_figure_callsr     s    
**Q
'C	k)T	Uzz!RXXq!f%56 
V	k)T	U

3!Q 01 
V$;;::a=D;; 
V	U	U	Us   ,C<,C%
C"%
C3c                      [         R                  " 5       n [        R                  " [        SS9   [         R                  " S5      nS S S 5        g ! , (       d  f       g = f)Nzcloses all existing figuresr   r   )r   rq   r   r>   r   )r   r   s     r)   test_close_all_warningr     s9    ::<D 
k)F	Gzz%  
H	G	Gs   A
Ac                  z    [         R                  " 5       n SS/SS//n[         R                  " XR                  S9  g )Nr   rJ   r	   )fignum)r   rq   matshownumber)rF   arrs     r)   test_matshowr    s1    
**,Cq6Aq6
C KKJJ'r+   )+r   numpyr   r   pathlibr   r   
matplotlibr   matplotlib.testingr   r   r   r*   rA   rH   rM   rT   rY   r\   r^   rb   rk   ru   rx   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r2   r+   r)   <module>r     s      
    9 $
>!*	(
$ )$XB20%%2	<5  8		5Np='!!(r+   