Ñò „ñ™Jc @ sL d Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z l Z l Z y d d k l Z Wn# e j o d d k l Z n Xd d k Z d d k Z d d k Z d d k l Z d d k l Z d d k i Z d d k Z e Z e i i d ƒ o 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 i d j ƒ} | i | i } } xn | D]f } | i d ƒ oP | i ƒ d } t i i d | d ƒ t i i | ƒ } | t i i d ƒ j SqM Wt d ƒ ‚ d S( Ns dvipng -versiont shellt stdint stdoutt stderrt close_fdst win32s dvipng iÿÿÿÿs Found dvipng version %st helpfuls 1.6s Could not obtain dvipng version( R t TrueR R t syst platformR R t startswitht splitt mplt verboset reportt distutilst versiont LooseVersiont RuntimeError( t pR R t lineR ( ( s; /usr/lib64/python2.6/site-packages/matplotlib/texmanager.pyt dvipng_hack_alpha9 s t TexManagerc B sw e Z d Z e i ƒ Z e d? j o e i ƒ Z n e i i e d ƒ Z e i ƒ Z e i i e d ƒ Z e i i e ƒ o+ e i d e e f IJe i e e ƒ n e i i e ƒ p e i e ƒ n e ƒ Z h Z h Z h Z d Z d@ Z dA Z dB Z dC Z d Z dD Z h dE d 6dF d 6dG d 6dH d 6dI d 6dJ d 6dK d 6dL d 6dM d 6dN d! 6dO d$ 6dP d' 6dQ d 6dR d( 6dS d) 6dT d* 6Z! d? Z" dU e# g Z$ dV e D] Z% e$ d- e% q£[$ ƒ Z&