
    Rietb                     F   d dl Z d dlmZ d dlmZ d dlmZmZmZ d dl	m
Z
 d dlmZ d dlmZmZmZmZ d dlmZ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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(m)Z)m*Z*m+Z+m,Z, d dl&m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 d dl4m5Z5m6Z6m7Z7m8Z8 d dl9m:Z; d dl<m=Z=  e-              e%dde>f          Z? G d de3          Z@ G d de3          ZAd ZBd ZCd ZDd  ZEd! ZFd" ZGd# ZHd$ ZId% ZJd& ZKd' ZLd( ZMd) ZNd* ZOd+ ZPd, ZQd- ZRd. ZSd/ ZTd0 ZUd1 ZVd2 ZWd3 ZXdS )4    N)TemporaryDirectory)Sum)Ioopi)Ne)Symbol)LambertWexp	exp_polarlog)	real_rootsqrt)	Piecewise)cossin)meijerg)Integral)And)S)sympify)import_module)Plotplotplot_parametricplot3d_parametric_lineplot3dplot3d_parametric_surface)
unset_showplot_contourPlotGridDefaultBackendMatplotlibBackendTextBackendBaseBackend)skipraiseswarnswarns_deprecated_sympy)lambdify)ignore_warnings
matplotlibz1.1.0)min_module_versioncatchc                       e Zd ZdZdS )DummyBackendNotOkz Used to verify if users can create their own backends.
    This backend is meant to raise NotImplementedError for methods `show`,
    `save`, `close`.
    N)__name__
__module____qualname____doc__     >lib/python3.11/site-packages/sympy/plotting/tests/test_plot.pyr0   r0   $   s          	Dr6   r0   c                   $    e Zd ZdZd Zd Zd ZdS )DummyBackendOkzi Used to verify if users can create their own backends.
    This backend is meant to pass all tests.
    c                     d S Nr5   selfs    r7   showzDummyBackendOk.show0       r6   c                     d S r;   r5   r<   s    r7   savezDummyBackendOk.save3   r?   r6   c                     d S r;   r5   r<   s    r7   closezDummyBackendOk.close6   r?   r6   N)r1   r2   r3   r4   r>   rA   rC   r5   r6   r7   r9   r9   ,   sK                 r6   r9   c                     t           st          d           t          d          t          d          t          d          5 } t	          dd          }t	          t                    z  t                    z  d	
          }|                    |           d |d         _        d|d         _        d|_	        d|_
        d|d         _        d|_        d|_        d|_        d}|                    t           j                            | |                     |j                                         |                    t	          dz                        |                    t	          dz   dz            d                    d}|                    t           j                            | |                     t	          dz  ddf          |d<   d}|                    t           j                            | |                     |j                                         t	          t                    dt,          z  dt,          z  f          }d}|                    t           j                            | |                     |j                                         t	          t                              }d}|                    t           j                            | |                     |j                                         t	          dz  ddffdz  ddff          }d }|                    t           j                            | |                     |j                                         t/          t0          fd!           t	          t3          ddk    fd"          d#df          }d$}|                    t           j                            | |                     |j                                         t	          t3          dk     fdz  df          ddf          }d%}|                    t           j                            | |                     |j                                         t	                    }t	          d          }|                    |           d&}|                    t           j                            | |                     |j                                         t3          d#d#k     ft5          d#k    dk               fdz  t5          dk    dk               fdz  dk    f          }t	          |ddf          }d'}|                    t           j                            | |                     |j                                         d d d            d S # 1 swxY w Y   d S )(N"Matplotlib not the default backendxysympy_prefixTf1legendlabelf2)rN   c                     | S r;   r5   as    r7   <lambda>z&test_plot_and_save_1.<locals>.<lambda>H       A r6   r   b   z	Big titlez
the x axiszstraight linerV   rV   )i   z!test_basic_options_and_colors.png      ztest_plot_extend_append.pngztest_plot_setitem.png   ztest_line_explicit.pngztest_line_default_range.png   ztest_line_multiple_range.pngc                  $    t                     S r;   )r   rF   rG   s   r7   rS   z&test_plot_and_save_1.<locals>.<lambda>m   s    41:: r6   r   Tztest_plot_piecewise.pngztest_plot_piecewise_2.pngztest_horizontal_line.pngztest_plot_piecewise_3.png)r,   r&   r	   r   r   r   r   extend
line_colortitlexlabelrN   rM   aspect_ratioxlimrA   ospathjoin_backendrC   appendr   r'   
ValueErrorr   r   )tmpdirpfilenamep1p2frF   rG   s         @@r7   test_plot_and_save_1rv   :   sY    31222sAsA	8	,	,	, G 4t,,,3q661SVV84000	%+!!$!
6	rw||FH--...	
	a!e	a!eQT""1%&&&0	rw||FH--...AqD1b!*%%!*	rw||FH--...	
Q!RUAbD)**+	rw||FH--...	
QLL0	rw||FH--...	
!Q$B
#adQAJ%7881	rw||FH--...	
z-----... Aq1u:y11Ar1:>>,	rw||FH--...	
Aq1u:1d|44q"ajAA.	rw||FH--...	
 !WW!WW
		"-	rw||FH--...	
 r1r6lQB!GQU(;(;$<T3qAvq1u%%&AqAv8 8QAJ.	rw||FH--...	
OG G G G G G G G G G G G G G G G G Gs   U7WWWc                     t           st          d           t          d          } t          d          }t          d          }t          d          5 }t	          t          |           t          |                     }d}|                    t          j	        
                    ||                     |j                                         t	          t          |           t          |           | dd	fd
d          }d}|                    t          j	        
                    ||                     |j                                         t	          t          |           t          |           f| t          |           f          }d}|                    t          j	        
                    ||                     |j                                         t	          t          |           t          |           | ddff| t          |           | dd	ff          }d}|                    t          j	        
                    ||                     |j                                         t	          | t          |           d          }d}|                    t          j	        
                    ||                     |j                                         t	          t          |           t          |           dd          }d}|                    t          j	        
                    ||                     |j                                         t          t          |           t          |           | d
d          }d}|                    t          j	        
                    ||                     |j                                         t          t          |           t          |           | | dd	fft          |           t          |           | | ddff          }d}|                    t          j	        
                    ||                     |j                                         t          t          |           t          |           | d          }d}|                    t          j	        
                    ||                     |j                                         t          | |z            }d}|                    t          j	        
                    ||                     |j                                         t          |  |z  | |z  | dd	f          }d }|                    t          j	        
                    ||                     |j                                         t          | |z  | ddf|ddff|  |z  | ddf|ddff          }d!}|                    t          j	        
                    ||                     |j                                         t          t          | |z             t          | |z
            | |z
            }d"}|                    t          j	        
                    ||                     |j                                         t          | t          |          z  | t          |          z  || dd	f|dd	fft          | |z             t          | |z
            | |z
  | dd	f|dd	ff          }d"}|                    t          j	        
                    ||                     |j                                         t!          t          |           t          |          z  | dd	f|dd	f          }d#}|                    t          j	        
                    ||                     |j                                         t!          | d$z  |d$z  z   | dz  |dz  z   | dd	f|dd	f          }d#}|                    t          j	        
                    ||                     |j                                         t!          | d$z  |d$z  z   | dd	f|dd	ff| dz  |dz  z   | ddf|ddff          }d#}|                    t          j	        
                    ||                     |j                                         d d d            d S # 1 swxY w Y   d S )%NrE   rF   rG   zrH   rI   ztest_parametric.pngr]   r^   Tparametric_plotrL   ztest_parametric_range.pngztest_parametric_multiple.pngr_   rY   z#test_parametric_multiple_ranges.png   )depthztest_recursion_depth.pngF  )adaptivenb_of_pointsztest_adaptive.png3d_parametric_plotztest_3d_line.pngztest_3d_line_multiple.png   )r~   ztest_3d_line_points.pngztest_surface.pngztest_surface_multiple.pngz test_surface_multiple_ranges.pngztest_parametric_surface.pngztest_contour_plot.pngrZ   )r,   r&   r	   r   r   r   r   rA   rj   rk   rl   rm   rC   r   r   r   r    rF   rG   rx   rp   rq   rr   s         r7   test_plot_and_save_2r      s)    31222sAsAsA	8	,	,	, m CFFCFF++(	rw||FH--...	
 FFCFFQAJt;LN N N.	rw||FH--...	
 SVVSVV,q#a&&k::1	rw||FH--...	
 VVSVVaQZ(1c!ffq"aj*AC C8	rw||FH--...	
 As1vvR000-	rw||FH--...	
 CFFCFFUMMM&	rw||FH--...	
 #FFCFFAd2FH H H%	rw||FH--...	
"VVSVVQB
+c!ffc!ffa!R-LN N.	rw||FH--...	
"3q663q6612FFF,	rw||FH--...	
 1q5MM%	rw||FH--...	
 A261q51b!*--.	rw||FH--...	
 UQAJB
+qb1fq"aj1b!*-MO O5	rw||FH--...	
 &c!a%jj#a!e**a!eDD0	rw||FH--...	
 &s1vvXqQxQAJB
;QZZQUQUQAJB
CE E 1	rw||FH--...	
 QAB
QAJ??*	rw||FH--...	
 A1adQTkAr1:2qzJJ*	rw||FH--...	
 TAqD[1b!*q"aj1TAqD[1b!*q"aj13 3 +	rw||FH--...	
[m m m m m m m m m m m m m m m m m ms   bc''c+.c+c            
      N   t           st          d           t          d          } t          d          }t          d          }t          d          5 }t	          t          |                     }d |d         _        d	}|                    t          j	        
                    ||                     d
 |d         _        d}|                    t          j	        
                    ||                     |j                                         t	          | t          |           z  | t          |           z  | ddf          }d |d         _        d}|                    t          j	        
                    ||                     d |d         _        d}|                    t          j	        
                    ||                     d |d         _        d}|                    t          j	        
                    ||                     |j                                         t          t          |           dt          |           z  t          d| z            z  z   t          |           dt          |           z  t          d| z            z  z   dt          d| z            z  | ddt          z  f          }t!          | t          d| z                      |d         _        d}|                    t          j	        
                    ||                     d |d         _        d}|                    t          j	        
                    ||                     d |d         _        d}|                    t          j	        
                    ||                     |j                                         t#          t          |           |z  | ddt          z  f|ddf          }d |d         _        d}|                    t          j	        
                    ||                     d  |d         _        d!}|                    t          j	        
                    ||                     d" |d         _        d#}|                    t          j	        
                    ||                     t!          | ||ft'          | d$t          z  z
  dz  |dz  z                       |d         _        d%}|                    t          j	        
                    ||                     |j                                         t)          | t          d|z            z  | t          d|z            z  || d&d'f|d&d'f          }d( |d         _        d)}|                    t          j	        
                    ||                     d* |d         _        d+}|                    t          j	        
                    ||                     t!          | ||ft'          | dz  |dz  z   |dz  z                       |d         _        d,}|                    t          j	        
                    ||                     |j                                         d d d            d S # 1 swxY w Y   d S )-NrE   rF   rG   rx   rH   rI   c                     | S r;   r5   rQ   s    r7   rS   z&test_plot_and_save_3.<locals>.<lambda>  rT   r6   r   ztest_colors_line_arity1.pngc                     |S r;   r5   rR   rU   s     r7   rS   z&test_plot_and_save_3.<locals>.<lambda>      q r6   ztest_colors_line_arity2.png
   c                     | S r;   r5   rQ   s    r7   rS   z&test_plot_and_save_3.<locals>.<lambda>  rT   r6   z!test_colors_param_line_arity1.pngc                     | S r;   r5   r   s     r7   rS   z&test_plot_and_save_3.<locals>.<lambda>  r   r6   c                     |S r;   r5   r   s     r7   rS   z&test_plot_and_save_3.<locals>.<lambda>#  r   r6   z"test_colors_param_line_arity2b.pngg?   rZ   r\   ztest_colors_3d_line_arity1.pngc                     |S r;   r5   r   s     r7   rS   z&test_plot_and_save_3.<locals>.<lambda>/  r   r6   ztest_colors_3d_line_arity2.pngc                     |S r;   r5   rR   rU   cs      r7   rS   z&test_plot_and_save_3.<locals>.<lambda>2      ! r6   ztest_colors_3d_line_arity3.png   r]   r^   c                     | S r;   r5   rQ   s    r7   rS   z&test_plot_and_save_3.<locals>.<lambda>8  r   r6   ztest_colors_surface_arity1.pngc                     |S r;   r5   r   s     r7   rS   z&test_plot_and_save_3.<locals>.<lambda>;  r   r6   ztest_colors_surface_arity2.pngc                     |S r;   r5   r   s      r7   rS   z&test_plot_and_save_3.<locals>.<lambda>>  s    Q r6   ztest_colors_surface_arity3a.pngrY   ztest_colors_surface_arity3b.pngrc   rV   c                     | S r;   r5   rQ   s    r7   rS   z&test_plot_and_save_3.<locals>.<lambda>H  r   r6   z!test_colors_param_surf_arity1.pngc                     | |z  S r;   r5   r   s     r7   rS   z&test_plot_and_save_3.<locals>.<lambda>K  s
    !A# r6   z!test_colors_param_surf_arity2.pngz!test_colors_param_surf_arity3.png)r,   r&   r	   r   r   r   re   rA   rj   rk   rl   rm   rC   r   r   r   	lambdify_r   surface_colorr   r   r   s         r7   test_plot_and_save_3r     s    31222sAsAsA	8	,	,	, F
 QLL%+!0	rw||FH--...(.!0	rw||FH--...	
3q661SVV8aBZ00%+!6	rw||FH--...(.!6	rw||FH--...(.!7	rw||FH--...	
"3q66CAJs1Q3xx,?#?ASVVC!HH,,AaCL1R4L  $As1Q3xx00!3	rw||FH--...(.!3	rw||FH--...++!3	rw||FH--...	
3q66!8aAbD\Ar1:66([!3	rw||FH--...+^!3	rw||FH--.....!4	rw||FH--...&1ay$AbD1}q!t7K2L2LMM!4	rw||FH--...	
%a#a!e**na#a!e**naB
QAJ( (([!6	rw||FH--...--!6	rw||FH--...&1ay$q!tad{QT7I2J2JKK!6	rw||FH--...	
MF F F F F F F F F F F F F F F F F Fs   X9ZZ!Zc                  r   t           st          d           t          d          } t          d          }t          d          5 }t	          t
          dd          5  t          t          t          |           d	z  d
z   t          | d	z  d
z             z            | d|f          }t          ||d
df          }d}|                    t          j                            ||                     |j                                         d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )NrE   rF   rG   rH   rI   z/The evaluation of the expression is problematicF)matchtest_stacklevelrZ   rV   r   r^   ztest_advanced_integral.png)r,   r&   r	   r   r(   UserWarningr   r   r   r   r   rA   rj   rk   rl   rm   rC   )rF   rG   rp   irq   rr   s         r7   test_plot_and_save_4r   T  s    31222sAsA 
8	,	,	, 
C!
 
 
 		 		
 c!ffai!mT!Q$(^^;<<q!QiHHAQAq	""A3HFF27<<11222J		 		 		 		 		 		 		 		 		 		 		 		 		 		 		
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s7   D,B+DD,D	D,D	D,,D03D0c            	      8   t           st          d           t          d          } t          d          }t          d          5 }t	          d| |z  z  | dt
          f          }t          ||ddf          }d	}|                    t          j	        
                    ||                     |j                                         t          t	          d| z  | d|f          |ddfd
          }d|d         _        d|d         _        d}t          t                     5  |                    t          j	        
                    ||                     d d d            n# 1 swxY w Y   |j                                         d d d            d S # 1 swxY w Y   d S )NrE   rF   rG   rH   rI   rV   rZ   r   ztest_advanced_inf_sum.pngFr>   Tr   ztest_advanced_fin_sum.png)r,   r&   r	   r   r   r   r   rA   rj   rk   rl   rm   rC   only_integersstepsr+   r   )rF   rG   rp   srq   rr   s         r7   test_plot_and_save_5r   q  s    31222sAsA	8	,	,	, !Q$Ar
##Q2J.	rw||FH--...	
QqS1a)$$q!Rju===!!!
. [)) 	3 	3FF27<<11222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	

-                 s7   CF4EFE"	"F%E"	&FFFc            	      n   t           st          d           t          d          } t          d          5 }d}t	          t          |           t          t          |           z  z             }|                    t          j
                            ||                     t          t                    5  t	          t          t          |                                }|                    t          j
                            ||                     d d d            n# 1 swxY w Y   t	          t          |                     }|                    t          j
                            ||                     t	          t          t          |                               }|                    t          j
                            ||                     d| dz  z  t!          t           t"          z            z  dz  }t%          dd	|          }d| dz  z  t!          t          t"          z            z  dz  }t%          dd	|          }||z   d
t"          z  z  }t	          || ddf          }|                    t          j
                            ||                     d d d            d S # 1 swxY w Y   d S )NrE   rF   rH   rI   ztest.pngr^   rZ   ))      ?r5   ))r^   r   r   r5   0   gư>{Gz?)r,   r&   r	   r   r   r   r   r   rA   rj   rk   rl   r+   RuntimeWarningr   r
   r   r   r   )	rF   rp   rr   rq   x1m1x2m2exprs	            r7   test_plot_and_save_6r     s    31222sA	8	,	,	, /
 Q!CFF("##	rw||FH--...^,, 	3 	3T$r((^^$$AFF27<<11222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 !	rw||FH--...hqkk""##	rw||FH--... AX	1"R%(((*^%8"==q!tVi"oo%a'\#4b99RBG$4''	rw||FH--...3/ / / / / / / / / / / / / / / / / /s8   A>J*4ADJ*D"	"J*%D"	&E7J**J.1J.c            	         t           st          d           t          d          } t          d          }t          d          5 }t	          |           }t          t          |           t          |           f| t          |           fd          }t          t          |           t          |           ddd	          }t          t          |           t          |           | d          }t          d
d
||||          }d}|
                    t          j                            ||                     |j                                         t          dd||||          }d}|
                    t          j                            ||                     |j                                         t	          t          |           | t            t           fd          }	d |	d         _        t	          t%          d| dk    fd          | ddfd          }
t'          | d
z  |d
z  z   | ddf|ddff| dz  |dz  z   | ddf|ddffd          }t          dd|	|
|          }d}|
                    t          j                            ||                     |j                                         d d d            d S # 1 swxY w Y   d S )NrE   rF   rG   rH   rI   Fr   r|   )r}   r~   r>   rZ   ztest_grid1.pngrY   r\   ztest_grid2.pngc                     | S r;   r5   rQ   s    r7   rS   z(test_plotgrid_and_save.<locals>.<lambda>  s    Q r6   r   rV   rb   rc   r]   r^   r_   ztest_grid3.png)r,   r&   r	   r   r   r   r   r   r   r!   rA   rj   rk   rl   rm   rC   r   re   r   r    )rF   rG   rp   rs   rt   p3p4rq   rr   p5p6p7s               r7   test_plotgrid_and_saver     s    31222sAsA	8	,	,	, !WWc!ffc!ff-3q66{GGGFFCFFU5J J J#CFFCFFAEBBBQ2r2r**#	rw||FH--...	
 Q2r2r**#	rw||FH--...	
#a&&!bS"E222&;1)QAJ	22QAJUKKKTAqD[1b!*q"aj1TAqD[1b!*q"aj1? ? ? Q2r2&&#	rw||FH--...	
9                 s   I'J99J= J=c                  0   t           st          d           t          d          } t          |           }t          | dz            }t          | dz              |                    |d                    t          |j                  dk    sJ t          t                    5  |                    |           d d d            n# 1 swxY w Y   t          t                    5  |                    |j                   d d d            d S # 1 swxY w Y   d S )NrE   rF   rZ   r   )	r,   r&   r	   r   rn   len_seriesr'   	TypeError)rF   rs   rt   s      r7   test_append_issue_7140r     sx    31222sA	aB	adBQKKK IIberz??a				  
		"               
			  
		"*                 s$   "CCC#DDDc                  T   t           st          d           t          d          } t          |           t	          t
          j         t
          j        fd          }|j                                         t	          dt
          j         t
          j        f          }|j                                         t	          dt          d          t          d          f          }|j                                         t	          t          d          t          d          fd          }|j                                         t          t          fd           t          t          fd           t          t          fd	           t          t          fd
           d S )NrE   rF   rc   rV   ri   ylimz-3.14z3.14c                  B    t           t          j         dfd          S NrV   r   r   r   r   ImaginaryUniteqns   r7   rS   z"test_issue_15265.<locals>.<lambda>  s     S 0!47CCC r6   c                  @    t           ddt          j        f          S Nr   rc   r   r   r   s   r7   rS   z"test_issue_15265.<locals>.<lambda>  s    Swb!/-BCCC r6   c                  @    t           t          j        dfd          S r   )r   r   NegativeInfinityr   s   r7   rS   z"test_issue_15265.<locals>.<lambda>  s    S 2A6WEEE r6   c                  @    t           ddt          j        f          S r   )r   r   Infinityr   s   r7   rS   z"test_issue_15265.<locals>.<lambda>
  s    Swb!*-=>>> r6   )r,   r&   r	   r   r   r   Pirm   rC   r   r'   ro   )rF   rq   r   s     @r7   test_issue_15265r     s    31222sA
a&&CSqt}7333AJSwqteQT]333AJSwgg&6&6%HIIIAJS(('&//:IIIAJ
:CCCCE E E :CCCCE E E :EEEEG G G :>>>>@ @ @ @ @r6   c                      t           st          d           t                       t                      } |                                  d S )NrE   )r,   r&   r   r   r>   )rq   s    r7   test_empty_Plotr     s>     31222 	FFFAFFHHHHHr6   c                  d   t           st          d           t          d          } | dz  d| dz  z  z
  | dz  z   }t          || ddfd	          }t	          t
                    5  t          |d
                                         d
                   dk    sJ 	 d d d            d S # 1 swxY w Y   d S )NrE   rF   g333333?r   rY   rZ   Fr   r   r   )r,   r&   r	   r   r+   r   r   get_datarF   ru   rq   s      r7   test_issue_17405r     s     31222sA	3AqD1a4AQC5)))A
 
	(	( - -1Q4==??1%&&",,,,,- - - - - - - - - - - - - - - - - -s   #4B%%B),B)c                  .   t           st          d           t          d          } t          | | ddfdd          }t	          |d                                         d                   d	k    sJ |d         j        d
k    sJ |d         j        dk    sJ d S )NrE   rF   gMbP?d   r   F)xscaler>   r   r   g      Y@)r,   r&   r	   r   r   r   endstartrF   rq   s     r7   test_logplot_PR_16796r   &  s     31222sAQD#u5999A qt}}q!""b((((Q48uQ4:r6   c                      t           st          d           t          d          } t          t	          |           d          }t          |d                                         d                   dk    sJ d S )NrE   rF   Fr   r   r   )r,   r&   r	   r   r
   r   r   r   s     r7   test_issue_16572r   3  sn     31222sAXa[[u%%%A qt}}q!""b((((((r6   c                     t           st          d           t          dd          } t          t           t          t          t          z  | z            z  | z  t          t          t           t          z  | z            z  | z  z   t          | d          fdt          z  df          }t          |d          }t          |d         
                                d                   d	k    sJ d S )
NrE   kT)integerr   rZ   Fr   r   )r,   r&   r	   r   r   r   r   r   r   r   r   )r   ru   rq   s      r7   test_issue_11865r   >  s     31222sD!!!AA2c!B$q&kk>!#aQBrE!GnQ&661aAAbD$<PPAQUA qt}}q!""b((((((r6   c            	         t           st          d           t          d          } t          t	          t          | | dz
  z            d          d          }t          |d                                         d                   dk    sJ d S )	NrE   rF   rZ   rY   Fr   r   r   )r,   r&   r	   r   r   r   r   r   r   s     r7   test_issue_11461r   K  s     31222sAYAqsGq))666A qt}}q!""b((((((r6   c                  B   t           st          d           t          d          } t          t	          |           t          |           | ddt          z  fdd          }|j        dk    sJ t          |d         	                                d                   dk    sJ d S )	NrE   rF   r   rZ   rW   F)rh   r>   r   )
r,   r&   r	   r   r   r   r   rh   r   r   r   s     r7   test_issue_11764r   W  s     31222sAAAAq2vUQVWWWA>V#### qt}}q!""b((((((r6   c                  n   t           st          d           t          d          } t          t	          |           dd          }|j        t          k    sJ t          |d                                         d                   dk    sJ t          t	          |           dd          }|j        t          k    sJ t          |d                                         d                   dk    sJ t          t	          |           d	d          }|j        t          k    sJ t          |d                                         d                   dk    sJ t          t	          |           d
          }|j        t          k    sJ t          |d                                         d                   dk    sJ d S )NrE   rF   r,   Fbackendr>   r   r   textdefaultr   )r,   r&   r	   r   r   r   r#   r   r   r$   r"   )rF   pmptpdrq   s        r7   test_issue_13516r   c  s    31222sA	c!ffl	7	7	7B:*****r!u~~"##r))))	c!fff5	1	1	1B:$$$$r!u~~"##r))))	c!ffie	4	4	4B:''''r!u~~"##r))))SVV%   A9&&&&qt}}q!""b((((((r6   c                     t           st          d           t          d          } t          | | dz  | ddf          }|j        }|j        d                                         \  }}t          |dz             dk     sJ t          |dz
            dk     sJ |j        d                                         \  }}t          |dz             dk     sJ t          |dz
            dk     sJ d S )NrE   rF   rZ   r   r   r   r   )	r,   r&   r	   r   rm   axget_xlimabsget_ylim)rF   rq   r   xminxmaxyminymaxs          r7   test_plot_limitsr   z  s     31222sAQ1q#rl##AjGA''))JD$tby>>Atby>>AA''))JD$tby>>Btcz??Rr6   c                  "   t           st          d           t          d          } dt          |           z  dt	          |           z  d| z  | ddff}t	          |           t          |           | | ddff}t          ||          }|j        }|j        d                                         \  }}t          |dz             dk     sJ t          |dz
            dk     sJ |j        d         
                                \  }}t          |dz             dk     sJ t          |dz
            dk     sJ |j        d                                         \  }	}
t          |	dz             dk     sJ t          |
dz
            dk     sJ t          ||          }|j        }|j        d                                         \  }}t          |dz             dk     sJ t          |dz
            dk     sJ |j        d         
                                \  }}t          |dz             dk     sJ t          |dz
            dk     sJ |j        d                                         \  }	}
t          |	dz             dk     sJ t          |
dz
            dk     sJ d S )	NrE   rF   rZ   r]   r^   r   r   r   )r,   r&   r	   r   r   r   rm   r   r   r   r   get_zlim)rF   v1v2rq   r   r   r   r   r   zminzmaxs              r7   "test_plot3d_parametric_line_limitsr    s    31222sA
CFF(Ac!ffHacAr1:	.B
a&&#a&&!aQZ	(Br2&&AjGA''))JD$tax==4tax==4A''))JD$tax==4tax==4A''))JD$tby>>D    tby>>D    r2&&AjGA''))JD$tax==4tax==4A''))JD$tax==4tax==4A''))JD$tby>>D    tby>>D      r6   c                     t           st          d           t          d          } t          t	          |           dd          }|j        j                                        }|d         dk    r|d         d	k    sJ t          t	          |           dd
          }|j        j                                        }|d         dk    r|d         dk    sJ t          dd||d          }|j        j                                        }|d         dk    r|d         dk    sJ t          t                    5  t          t	          |           dd           d d d            d S # 1 swxY w Y   d S )NrE   rF   r,   )   r\   )r   sizer   r  rV   r\   )r^   r   r^   r   rZ   )r   rZ   )r  r   )rc   rY   )r,   r&   r	   r   r   rm   figget_size_inchesr!   r'   ro   )rF   rs   s1rt   s2r   s3s          r7   test_plot_sizer    s    31222sA	c!ffl	8	8	8B		(	(	*	*BqEQJJRUaZZZZ	c!ffl	9	9	9B		(	(	*	*BqEQJJRUb[[[[	!QBV	,	,	,B		(	(	*	*BqEQJJRUaZZZZ	
		 9 9SVV\88889 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9s   4 E!!E%(E%c                     t           st          d           t          d          } t          t                    5  t          t          |           t          d           d d d            n# 1 swxY w Y   t          t          |           t          d          }|j	        t          k    sJ t          |d                                         d                   dk    sJ t          t          |           t          d          }|j	        t          k    sJ t          |d                                         d                   dk    sJ t          t          |           t          d          }|j	        t          k    sJ t          |d                                         d                   dk    sJ t          t                    5  |                                 d d d            n# 1 swxY w Y   t          t                    5  |                    d           d d d            n# 1 swxY w Y   t          t                    5  |j                                         d d d            d S # 1 swxY w Y   d S )NrE   rF   Fr   r   r   z	test/path)r,   r&   r	   r'   r   r   r   r   r#   r   r   r   r9   r0   NotImplementedErrorr>   rA   rm   rC   )rF   rt   r   r   s       r7   test_issue_20113r    s#    31222sA 
			 / /SVVT..../ / / / / / / / / / / / / / /	c!ff/e	<	<	<B:*****r!u~~"##r))))	c!ffn5	9	9	9B:''''r!u~~"##r)))) 
c!ff/e	<	<	<B:*****r!u~~"##r))))	#	$	$  
			              	#	$	$  
              	#	$	$  
                 sG   %A++A/2A/G&&G*-G*H''H+.H+I--I14I1c            	      2   t          d          } t          d          }t          t          |           d            t          t          |           d           t          t          |           d           t          t          |           t	          |           d            t          t          |           t	          |           d           t          t          |           t	          |           d           t          t          |           t	          |           | d            t          t          |           t	          |           | d           t          t          |           t	          |           | d           t          t          | |z             t	          | |z
            | |z
  | d	d
f|d	d
fd            t          t          | |z             t	          | |z
            | |z
  | d	d
f|d	d
fd           t          t          | |z             t	          | |z
            | |z
  | d	d
f|d	d
fd           t          | |z  | d	d
f|d	d
fd            t          | |z  | d	d
f|d	d
fd           t          | |z  | d	d
f|d	d
fd           d S )NrF   rG   c                     | S r;   r5   rQ   s    r7   rS   z&test_custom_coloring.<locals>.<lambda>  s    a r6   )re   rV   rc                     | S r;   r5   rQ   s    r7   rS   z&test_custom_coloring.<locals>.<lambda>  s     r6   c                     | S r;   r5   rQ   s    r7   rS   z&test_custom_coloring.<locals>.<lambda>  s    1 r6   r]   r^   c                     | dz  |dz  z   S NrZ   r5   r   s     r7   rS   z&test_custom_coloring.<locals>.<lambda>      q!tad{ r6   )r   c                     | dz  |dz  z   S r  r5   r   s     r7   rS   z&test_custom_coloring.<locals>.<lambda>  r  r6   )r	   r   r   r   r   r   r   r   ra   s     r7   test_custom_coloringr    s   sAsAQKK((((QAQC    CFFCFF{{;;;;CFFCFFq1111CFFCFFs33333q663q661EEEE3q663q661;;;;3q663q661====c!a%jj#a!e**a!eAJB
224 4 4 4 c!a%jj#a!e**a!eAJB
    c!a%jj#a!e**a!eAJB
    1Q3B
QAJ224 4 4 4
1Q3B
QAJa8888
1Q3B
QAJc::::::r6   c                     t           st          d           t          d          } t          |           }t	          || ddfd          }t                      5  |d                                          d d d            d S # 1 swxY w Y   d S )NrE   rF   r   r   Fr   r   )r,   r&   r	   r   r   r)   get_segmentsr   s      r7   test_deprecated_get_segmentsr    s     31222sAAAQC5)))A		!	!  	!                 s   B  BB)Yrj   tempfiler   sympy.concrete.summationsr   sympy.core.numbersr   r   r   sympy.core.relationalr   sympy.core.symbolr	   &sympy.functions.elementary.exponentialr
   r   r   r   (sympy.functions.elementary.miscellaneousr   r   $sympy.functions.elementary.piecewiser   (sympy.functions.elementary.trigonometricr   r   sympy.functions.special.hyperr   sympy.integrals.integralsr   sympy.logic.boolalgr   sympy.core.singletonr   sympy.core.sympifyr   sympy.externalr   sympy.plotting.plotr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   sympy.testing.pytestr&   r'   r(   r)   sympy.utilitiesr*   r   sympy.utilities.exceptionsr+   RuntimeErrorr,   r0   r9   rv   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r5   r6   r7   <module>r0     s7   				 ' ' ' ' ' ' ) ) ) ) ) ) * * * * * * * * * * $ $ $ $ $ $ $ $ $ $ $ $ R R R R R R R R R R R R F F F F F F F F : : : : : : ? ? ? ? ? ? ? ? 1 1 1 1 1 1 . . . . . . # # # # # # " " " " " " & & & & & & ( ( ( ( ( (                                 M L L L L L L L L L L L 1 1 1 1 1 1 6 6 6 6 6 6 
 ]W\OE E E
	 	 	 	 	 	 	 	    [   N N Nbu u upN N Nb  :  @/ / /D# # #L  (@ @ @@  - - -
 
 
) ) )
) 
) 
)	) 	) 	)	) 	) 	)) ) ).       !  !  !D9 9 9&  6; ; ;4    r6   