
    hV6                        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5        [        [        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black   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         N/var/www/html/env/lib/python3.13/site-packages/matplotlib/tests/test_pyplot.pytest_pyplot_up_to_dater)      s   
 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 r0   r1   r2   s     r(   wrapper_func9test_copy_docstring_and_deprecators.<locals>.wrapper_func3   s    r*   )r-   )r.   r2   )r,   r0   )
r   _apirename_parameter__version__make_keyword_onlyr   _copy_docstring_and_deprecatorsr   warnsMatplotlibDeprecationWarning)recwarnr3   r6   s      r(   #test_copy_docstring_and_deprecatorsr@   -   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_boxrG   B   s    llnGCGGEN    GGDM??GGI    GGI??r*   c                  :    [         R                  " / SQ/ SQ5        g )N)   r      )r   	stackplotr1   r*   r(   test_stackplot_smokerL   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)NrI   )nrows)ncols)r   raises	TypeErrorr   subplotr1   r*   r(   test_nrows_errorrS   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r0   )r   ionr   is_interactiveioffr1   r*   r(   	test_ioffrX   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r0   )r   rW   r   rV   rU   r1   r*   r(   test_ionr[   h   s    HHJ!!####	!!#### 
!!####GGI	!!#### 
 
 
rY   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r0   )r   rU   rW   r   rV   r1   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   closerQ   r   )es    r(   
test_closera      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   rR   gcaax1ax2ax3s      r(   test_subplot_reuserj      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rF   rg   s     r(   test_axes_kwargsrt      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 )NrI   r   rl   rm   ro   )r   rp   rR   rq   rr   )rE   rF   rg   rh   ri   ax4s         r(   test_subplot_replace_projectionrw      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 )Nrl   r   )rn   theta_offsetrI   )r   rR   removegcfrq   rf   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 r0   )r   rp   re   r_   rs   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   rl   rm   ro   )r   rR   re   rz   r{   rq   rf   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   rl   rm   T)rl   )rl   rn   zpolar=True, yet projection='3d'match3d)r   rR   r   rP   
ValueErrorrf   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	mollweiderl   ro   r   rm   rI   )setr   rR   addrz   rr   len)created_axesrF   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   rl   
isinstancer   linesLine2Drq   )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   rq   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   rI   )r   rp   
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   rI   T)squeeze)r   rp   r   rB   re   sca)rE   r   rF   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 )NrI   
   T)minor)dtypeg      @g      @ab)tickslabelsr   )r   rp   plotr   arangexticksallarrayfloat64yticksre   
get_yticksget_yticklabelsget_text)tick_postick_labelsrF   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_backendrp   r   get_fignums)rE   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)rp   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   rp   r   )test_rcrE   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)
NrI   )rI   r   )figsizez)Ignoring specified arguments in this callr   rJ            )r   rp   r   r=   UserWarningr   r   )rE   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   rp   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   rI   r   )fignum)r   rp   matshownumber)rE   arrs     r(   test_matshowr    s1    
**,Cq6Aq6
C KKJJ'r*   )+r   numpyr   r   pathlibr   r   
matplotlibr   matplotlib.testingr   r   r   r)   r@   rG   rL   rS   rX   r[   r]   ra   rj   rt   rw   r|   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r1   r*   r(   <module>r
     s      
    9 $
>!*	(
$ )$XB20%%2	<5  8		5Np='!!(r*   