KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64
User : equistyl ( 1341)
PHP Version : 8.1.30
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/matplotlib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/matplotlib/texmanager.pyc
�
r`]c@shdZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZyddl
mZWn!ek
r�ddlmZnXddlZddlZddlZddlmZddlmZddlmZddljZddlZeZej j!d	�rBd
Z"ndZ"d�Z#d
dd��YZ$dS(s�
This module supports embedded TeX expressions in matplotlib via dvipng
and dvips for the raster and postscript backends.  The tex and
dvipng/dvips information is cached in ~/.matplotlib/tex.cache for reuse between
sessions

Requirements:

* latex
* \*Agg backends: dvipng
* PS backend: latex w/ psfrag, dvips, and Ghostscript 8.51
  (older versions do not work properly)

Backends:

* \*Agg
* PS
* PDF

For raster output, you can get RGBA numpy arrays from TeX expressions
as follows::

  texmanager = TexManager()
  s = '\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!'
  Z = self.texmanager.get_rgba(s, size=12, dpi=80, rgb=(1,0,0))

To enable tex rendering of all text in your matplotlib figure, set
text.usetex in your matplotlibrc file (http://matplotlib.sf.net/matplotlibrc)
or include these two lines in your script::

  from matplotlib import rc
  rc('text', usetex=True)

i����(tprint_functionN(tPopentPIPEtSTDOUT(tmd5(trcParams(tread_png(tmkdirstwint&t;c
Cs�tddtdtdtdtdtjdk�}|j|j}}x{|D]s}|jd�rM|j	�d	}t
jjd
|d�|j
d�}tjj|�}|tjjd
�kSqMWt
jjdd�tS(Nsdvipng -versiontshelltstdintstdouttstderrt	close_fdstwin32sdvipng i����sFound dvipng version %sthelpfultasciis1.6sNo dvipng was found(RtTrueRRtsystplatformRR
t
startswithtsplittmpltverbosetreporttdecodet	distutilstversiontLooseVersiontFalse(tpRR
tlineR((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytdvipng_hack_alpha<s
t
TexManagercBsTeZdZej�Zed@kr3ej�Znej	j
ed�Zej�Z
ej	j
e
d�Zej	je�r�edeefdej�ejee�nee�d@ZiZiZiZdZdAZdBZdCZdDZdZdEZ idFd6dGd6dHd6dId6dJd6dKd6dLd6dMd6dNd
6dOd"6dPd%6dQd(6dRd6dSd)6dTd*6dUd+6Z!d@Z"dVe#gdWe D]Z$d.e$^q��Z%d/�Z&d@d0�Z'd1�Z(d2�Z)d3�Z*d4�Z+d5�Z,e-j.d6�Z/d7�Z0d8�Z1d9�Z2d:�Z3d;�Z4d<�Z5d@d@d=�Z6d@d@dXd>�Z7d@d?�Z8RS(YsZ
    Convert strings to dvi files using TeX, caching the results to a
    working dir
    s
.tex.caches	tex.cachesmWARNING: found a TeX cache dir in the deprecated location "%s".
  Moving it to the new default location "%s".tfileitcmrttcmsstcmtttpzcs\usepackage{chancery}tserifs
sans-seriftcursivet	monospacetpncs\renewcommand{\rmdefault}{pnc}snew century schoolbooktpbks\renewcommand{\rmdefault}{pbk}tbookmantptms\usepackage{mathptmx}ttimestppls\usepackage{mathpazo}tpalatinos
zapf chancerytpchs\usepackage{charter}tchartertphvs\usepackage{helvet}t	helveticatpags\usepackage{avant}savant gardetpcrs\usepackage{courier}tcourierscomputer modern romanscomputer modern sans serifscomputer modern typewriterstext.latex.preambletfamilysfont.cCs7t|j�tdj�}||jkr8||_n tjjd|d�d|_|jg}x&g|jD]}||j	dd�f^qqD]�\}}x�td|D]�}|j�|j
kr*|j
|j�}t|||j
|j��tr&t
d|||j
|j�f�nPq�tr�t
d	�q�q�Wtjjd
|d�t|||j
|�|jt||�d�q�Wdj|�|_|jd
|jd
|jd
g}|jdkr�|j|jd
�nxd|kr|jd�q�Wdj|�}djd|dg�|_dS(Nsfont.familysOThe %s font family is not compatible with LaTeX. serif will be used by default.RR*t-t_sfont.sfamily: %s, font: %s, info: %ss%$s font is not compatible with usetexsQNo LaTeX-compatible font found for the %s font family in rcParams. Using default.iR&iR+s\usepackage{type1cm}s
s\usepackage{textcomp}(RttexcacheRtlowert
font_familiestfont_familyRRRtreplacet	font_infotsetattrtDEBUGtprinttappendtgetattrtjoint_fontconfigR*t
sans_serifR,R+tremovet_font_preamble(tselftfft
fontconfigRAtfont_family_attrtfontt
found_fonttcmd((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pyt__init__�s@
	8		$cCsqdj||j�d||j�t|p.d�g�}t|�jd�}tjj|jt	|�j
��S(sU
        returns a filename based on a hash of the string, fontsize, and dpi
        R&s%fsutf-8(RItget_font_configtget_custom_preambletstrtunicodetencodetostpathR>Rt	hexdigest(RNttextfontsizetdpitstbytes((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytget_basefile�s!cCs(|jdkr=tg|jD]}|df^q�|_ng|jD]#}t||j|krG|^qG}|rtr�td|�nxS|D]K}tr�td||j|t|f�ntjt|�|j|<q�Wtr�td|j	�n|j
�ntr!td|j	�n|j	S(s8Reinitializes self if relevant rcParams on have changed.sDEBUG following keys changed:sDEBUG %-20s: %-10s -> %-10ssDEBUG RE-INIT
old fontconfig:sDEBUG fontconfig:N(t	_rc_cachetNonetdictt_rc_cache_keysRRERFtcopytdeepcopyRJRU(RNtktpartchanged((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pyRV�s$.

cCs|jS(sU
        returns a string containing font configuration for the tex preamble
        (RM(RN((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytget_font_preamble�scCsdjtd�S(s>returns a string containing user additions to the tex preambles
stext.latex.preamble(RIR(RN((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pyRW�scGsRtjdkr2dtjj|j�dg}ng}|j|�dj|�S(s�
        On windows, changing directories can be complicated by the presence of
        multiple drives. get_shell_cmd deals with this issue.
        Rs%sis && (RRR[R\t
splitdriveR>textendRI(RNtargstcommand((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pyt_get_shell_cmd�s
#
c	Cs|j||�}d|}|j�}idd6dd6j|jd�}||}tdrhd}nd	}d
|j||||d|f}t|d��p}	tdr�|	j|jd
��nFy|	j|jd��Wn)t	k
r}
t
jjdd��nXWdQX|S(su
        Generate a tex file to render the tex string at a specific font size

        returns the file name
        s%s.texs{\sffamily %s}s
sans-serifs{\ttfamily %s}R,s{\rmfamily %s}stext.latex.unicodes-\usepackage{ucs}
\usepackage[utf8x]{inputenc}R&s�\documentclass{article}
%s
%s
%s
\usepackage[papersize={72in,72in}, body={70in,70in}, margin={1in,1in}]{geometry}
\pagestyle{empty}
\begin{document}
\fontsize{%f}{%f}%s
\end{document}
g�?twbtutf8RsbYou are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam.RN(
RcRWtgetRARRMtopentwriteRZtUnicodeEncodeErrorRRR(RNR^R_tbasefilettexfiletcustom_preambletfontcmdtunicode_preambleRatfhterr((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytmake_tex�s,

	

	

s3MatplotlibBox:\(([\d.]+)pt\+([\d.]+)pt\)x([\d.]+)ptc	Cs|j||�}d|}|j�}idd6dd6j|jd�}||}tdrhd}nd	}d
|j||||d|f}t|d��p}	tdr�|	j|jd
��nFy|	j|jd��Wn)t	k
r}
t
jjdd��nXWdQX|S(s�
        Generate a tex file to render the tex string at a specific
        font size.  It uses the preview.sty to determin the dimension
        (width, height, descent) of the output.

        returns the file name
        s%s.texs{\sffamily %s}s
sans-serifs{\ttfamily %s}R,s{\rmfamily %s}stext.latex.unicodes-\usepackage{ucs}
\usepackage[utf8x]{inputenc}R&s�\documentclass{article}
%s
%s
%s
\usepackage[active,showbox,tightpage]{preview}
\usepackage[papersize={72in,72in}, body={70in,70in}, margin={1in,1in}]{geometry}

%% we override the default showbox as it is treated as an error and makes
%% the exit status not zero
\def\showbox#1{\immediate\write16{MatplotlibBox:(\the\ht#1+\the\dp#1)x\the\wd#1}}

\begin{document}
\begin{preview}
{\fontsize{%f}{%f}%s}
\end{preview}
\end{document}
g�?RsRtRsbYou are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam.RN(
RcRWRuRARRMRvRwRZRxRRR(RNR^R_RyRzR{R|R}RaR~R((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytmake_tex_previews,

	

	

c
	Cs�tdr|j||�S|j||�}d|}tsOtjj|�r�|j||�}|d}|jd|j	dtjj
|�d|f�}tjj
|d�tj|�}y%t|��}	|	j�}
WdQXWntk
r�d	}
nXytj|�t}Wntk
r/t}nX|s=|rZtd
t|�|
��ntjj
|
d�xgtj|d�D]O}|jd�r�q�|jd
�r�q�ytj|�Wq�tk
r�q�Xq�Wn|S(sm
        generates a dvi file containing latex's layout of tex string

        returns the file name
        stext.latex.previews%s.dvis.outputscd "%s"s(latex -interaction=nonstopmode %s > "%s"i����tdebugNs No latex error report available.seLaTeX was not able to process the following string:
%s
Here is the full report generated by LaTeX: 

t*tdviR^(Rtmake_dvi_previewRcRER[R\texistsR�RrR>RRRRtsystemRvtreadtIOErrortstatRtOSErrorRtRuntimeErrortreprtglobtendswithRL(
RNR^R_RytdvifileRztoutfileRqtexit_statusR~RR�tfname((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytmake_dviNsH


 







c
Cs|j||�}d|}d|}tsRtjj|�sRtjj|�r�|j||�}|d}|jd|jdtjj|�d|f�}t	j
j|d�tj|�}	y%t
|��}
|
j�}WdQXWntk
rd	}nX|	r%td
t|�|��nt	j
j|d�tjj|�}t
|dd��#}
|
jd
j|j���WdQXxytj|d�D]a}
|
jd�r�q�|
jd�r�q�|
jd�r�q�ytj|
�Wq�tk
r�q�Xq�Wn|S(s�
        generates a dvi file containing latex's layout of tex
        string. It calls make_tex_preview() method and store the size
        information (width, height, descent) in a separte file.

        returns the file name
        s%s.dvis%s.baselines.outputscd "%s"s(latex -interaction=nonstopmode %s > "%s"i����R�Ns No latex error report available.seLaTeX was not able to process the following string:
%s
Here is the full report generated by LaTeX: 

s	.baselinetwt R�R�R^tbaseline(RcRER[R\R�R�RrR>RRRRR�RvR�R�R�R�R#t_re_vboxtsearchRwRItgroupsR�R�RLR�(RNR^R_RyR�tbaselinefileRzR�RqR�R~RtmR�((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pyR�|sH


 

"
cCsZ|j|||�}d|}ts8tjj|�rV|j||�}|d}|jd|jd|tjj|�dtjj|�d|f�}t	j
j|d�tj|�}	y%t
|��}
|
j�}WdQXWntk
r�d}nX|	rtd	||��nt	j
j|d�ytj|�WqVtk
rRqVXn|S(
so
        generates a png file containing latex's rendering of tex string

        returns the filename
        s%s.pngs.outputscd "%s"sQdvipng -bg Transparent -D %s -T tight -o                         "%s" "%s" > "%s"i����R�Ns!No dvipng error report available.sedvipng was not able to process the following file:
%s
Here is the full report generated by dvipng: 

(RcRER[R\R�R�RrR>RRRRR�RvR�R�R�RLR�(RNR^R_R`RytpngfileR�R�RqR�R~R((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytmake_png�s0

 


c
Cs|j||�}d|}ts5tjj|�r|j||�}|d}|jd|jdtjj|�dtjj|�d|f�}t	j
j|d�tj|�}t
|��C}	|r�td||	j���nt	j
j|	j�d�WdQXtj|�n|S(	sw
        generates a postscript file containing latex's rendering of tex string

        returns the file name
        s%s.epsfs.outputscd "%s"sdvips -q -E -o "%s" "%s" > "%s"i����R�s�dvipng was not able to                     process the flowing file:
%s
Here is the full report generated by dvipng:                     

N(RcRER[R\R�R�RrR>RRRRR�RvR�R�RL(
RNR^R_RytpsfileR�R�RqR�R~((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytmake_ps�s$

 c	Cs�|j||�}t|��N}xD|D]<}|jd�r(g|j�dD]}t|�^qNSq(WWdQXtd|��dS(sw
        returns a list containing the postscript bounding box for latex's
        rendering of the tex string
        s%%BoundingBox:iNsCould not parse %s(R�RvRRtintR�(RNR^R_R�tpsR!tval((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytget_ps_bbox�s
1c	Cs||j�||f}|jj|�}|dkr|j|||�}ttjj|j	|��}t
ddk	r�t
d}n'tjdkr�t
�t_ntj}|r�d|dd�dd�df}n|dd�dd�df}||j|<n|S(sreturns the alpha channelstext.dvipnghackiNii����(RVtgrey_arraydRuReR�RR[R\RIR>RR#t_dvipng_hack_alphaR"(	RNR^R_R`tkeytalphaR�tXthack((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytget_grey�s
	&cCsE|std}n|s&td}n|\}}}||j�||t|�f}|jj|�}	|	dkrA|j|||�}
tj|
j	d|
j	ddftj
�}	||	dd�dd�df<||	dd�dd�df<||	dd�dd�df<|
|	dd�dd�df<|	|j|<n|	S(	sN
        Returns latex's rendering of the tex string as an rgba array
        s	font.sizessavefig.dpiiiiNii(RRVttupletrgba_arraydRuReR�tnptzerostshapetfloat(RNR^R_R`trgbtrtgtbR�tZR�((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytget_rgba's 

!,cCsY|j�dkrdS|r.|jd�}nd}tdr�|j||�}d|}tsstjj|�r�|j||�}nt	|��}|j
�j�}	WdQXg|	D]}
t|
�|^q�\}}}
|
|||fS|j
||�}tj|d|�}ztt|��}Wd|j�X|j|j|j|jfSdS(	s?
        return width, heigth and descent of the text.
        R&ig�?stext.latex.previews%s.baselineNiH(iii(tstriptpoints_to_pixelsRRcRER[R\R�R�RvR�RR�R�tdvireadtDvitnexttitertclosetwidththeighttdescent(RNR^R_trenderertdpi_fractionRyR�R�R~tltl1R�tdepthR�R�tpage((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pytget_text_width_height_descent?s(

,N(R%R&(R'R&(R(R&(R)s\usepackage{chancery}(sserifs
sans-serifscursives	monospace(R-s\renewcommand{\rmdefault}{pnc}(R.s\renewcommand{\rmdefault}{pbk}(R0s\usepackage{mathptmx}(R2s\usepackage{mathpazo}(R)s\usepackage{chancery}(R)s\usepackage{chancery}(R4s\usepackage{charter}(R%R&(R'R&(R6s\usepackage{helvet}(R8s\usepackage{avant}(R9s\usepackage{courier}(R(R&(R%R&(R'R&(R(R&(stext.latex.preamble(R;(iii(9t__name__t
__module__t__doc__Rtget_hometoldpathRet
get_data_pathR[R\RItoldcachet
get_configdirt	configdirR>R�RFRRtshutiltmoveRR�R�R�tpostscriptdtpscntR*RKR,R+RAR@RCRdR�tnRgRURcRVRmRWRrR�tretcompileR�R�R�R�R�R�R�R�R�R�(((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pyR#Lsx

(	(
					.	=	.	0	"		0((%R�t
__future__RRhR�R[R�Rtwarningst
subprocessRRRthashlibRtImportErrortdistutils.versionRtnumpyR�t
matplotlibRRtmatplotlib._pngRtmatplotlib.cbookRtmatplotlib.dvireadR�R�RRERRt	cmd_splitR"R#(((s;/usr/lib64/python2.7/site-packages/matplotlib/texmanager.pyt<module>"s*H
		

Anon7 - 2021