Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
matplotlib
/
File Content:
texmanager.pyc
� �)�Uc @ sH 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 m Z m Z y d d l m Z Wn! e k r� d d l m Z n Xd d l Z d d l Z d d l Z d d l m Z d d l m Z d d l j Z d d l Z e Z e j j d � r"d Z n d Z d � Z d d d � � YZ d S( 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����N( t Popent PIPEt STDOUT( t md5( t rcParams( t read_pngt wint &t ;c C s� t d d t d t d t d t d t j d k �} | j | j } } xl | D]d } | j d � rM | j � d } t j j d | d � t j j | � } | t j j d � k SqM Wt j j d d � t S( Ns dvipng -versiont shellt stdint stdoutt stderrt close_fdst win32s dvipng i����s Found dvipng version %st helpfuls 1.6s No dvipng was found( R t TrueR R t syst platformR R t startswitht splitt mplt verboset reportt distutilst versiont LooseVersiont False( t pR R t lineR ( ( sH /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/texmanager.pyt dvipng_hack_alpha9 s t TexManagerc B sf e Z d Z e j � Z e d? k r3 e j � Z n e j j e d � Z e j � Z e j j e d � Z e j j e � r� e j d e e f IJe j e e � n e j j e � s� e j e � n d? Z i Z i Z i Z d Z d@ Z dA Z dB Z dC Z d Z dD Z i dE d 6dF d 6dG d 6dH d 6dI d 6dJ d 6dK d 6dL d 6dM d 6dN d! 6dO d$ 6dP d'