
    (?ep                     P   d Z ddlZddlZddlZddlZddlZddlZddlmZ	 ddl
mZmZ ddZej                            d	d
ddddd ej        dddeeg          d ej        ddde          g	          d             Zej                            dddg          d             ZdS )z
Test output reproducibility.
    N)pyplot)needs_ghostscriptneeds_usetexmhipdfFc           	      X   t          j        |           t           j                            d|d           t	          j                    }d| v r|                    ddd          }t          d          }|                    |dgdz  d           |                    |d	gdz  d
           |                    |dgdz  d           |                    |dgdz  d           |                    |dgdz  d           d| v r|                    ddd	          }|	                    t          dd          t          dd                    |	                    t          dd          dgdz  t          dd                    z   }|
                    g d           d}t          ||          D ]\  }	}
|	                    |
           d| v rg dg dg dg}|                    ddd                              |d           g dg dg dg}|                    ddd                              |d           g dg dg dg}|                    ddd                              |d           t          d          }|                    ddd          }|                    ||           |                    d           |                    d           |                    d           t#          t$          j        d t$          j                  }|                    ||!           d S )"Nasdf)zsvg.hashsaltztext.usetexm      
   D)marker   x   ^   H   vh)bottom)g      ?g      @g      @g      @)-+r   \*oO.i)r   r   r   )r   r   r   )r   r   r   nearest)interpolation)r   r   r   bilinear)r   r   r   bicubiczA string $1+2+\sigma$buffer)format)mplusercParamsupdatepltfigureadd_subplotrangeplotbar
set_xtickszip	set_hatchimshow	set_title
set_xlabel
set_ylabelgetattrsysstdoutsavefig)objectsfmtusetexfigax1r   ax2barspatternsr1   patternAaxr;   s                 Alib/python3.11/site-packages/matplotlib/tests/test_determinism.py_save_figurerI      s    GCLLLLGGHHH
*,,C
g~~ooaA&&"IIQC"HS)))QC"HS)))QC"HS)))QC"HS)))QC"HS)))
g~~ooaA&&aU1a[[11aaS1WU1a[[AAB+++,,,<h// 	# 	#LCMM'""""
g~~YY			999-1a  '''CCCYY			999-1a  '''DDDYY			999-1a  '''CCCaA	Aq	!	!BGGAqMMMLL)***MM*+++MM*+++SZ3:66FKKsK#####    zobjects, fmt, usetex) r   F)r
   r   F)r   r   F)r!   r   F)r   r   F)r   psFrL   T)marks)r   svgFrN   c                       fdt          d          D             }|dd         D ]9}dk    r#r!||d         k    rt          j        d           +||d         k    sJ :dS )a?  
    Output three times the same graphs and checks that the outputs are exactly
    the same.

    Parameters
    ----------
    objects : str
        Objects to be included in the test document: 'm' for markers, 'h' for
        hatch patterns, 'i' for images.
    fmt : {"pdf", "ps", "svg"}
        Output format.
    c                     g | ]A}t          j        t          j        d dddd dgi t          j        ddd          BS )	-R-czHfrom matplotlib.tests.test_determinism import _save_figure;_save_figure(z, )	946684800AggSOURCE_DATE_EPOCH
MPLBACKENDenv
subprocesscheck_outputr:   
executableosenviron).0_r>   r=   r?   s     rH   
<listcomp>z*test_determinism_check.<locals>.<listcomp>[   s         	^T4=$= =*-= =39= = =>&2: &K$& & &		' 	' 	'  rJ   r   r   NrL   r   z+failed, maybe due to ghostscript timestamps)r/   pytestskip)r=   r>   r?   plotsps   ```  rH   test_determinism_checkrh   @   s    6      q  E 122Y ! !$;;6;E!H}}IJJJa=====! !rJ   zfmt, string)r   s!   /CreationDate (D:20000101000000Z))rL   s(   %%CreationDate: Sat Jan 01 00:00:00 2000c                     t          j        t          j        ddd| dgi t          j        ddd          }||v sJ d	S )
a  
    Test SOURCE_DATE_EPOCH support. Output a document with the environment
    variable SOURCE_DATE_EPOCH set to 2000-01-01 00:00 UTC and check that the
    document contains the timestamp that corresponds to this date (given as an
    argument).

    Parameters
    ----------
    fmt : {"pdf", "ps", "svg"}
        Output format.
    string : bytes
        Timestamp string for 2000-01-01 00:00 UTC.
    rQ   rR   zMfrom matplotlib.tests.test_determinism import _save_figure; _save_figure('', rS   rT   rU   rV   rY   Nr[   )r>   stringbufs      rH   "test_determinism_source_date_epochrl   l   su    0 
!	t
& 
& 
& 
&	'"rz " " " "	# # #C S======rJ   )__doc__r_   r\   r:   rd   
matplotlibr(   matplotlib.testing.comparer   r,   matplotlib.testing._markersr   r   rI   markparametrizeparamrh   rl    rJ   rH   <module>ru      sf    
			     



      ! ! ! ! $ $ $ $ $ $ G G G G G G G G,$ ,$ ,$ ,$^ 4l4E%F	H 	H 	HUE4|<<< ! ! !< 5
 	<	 	 	 	  rJ   