114 lines (99 with data), 8.0 kB
@header@
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="matplotlib.html"><font color="#ffffff">matplotlib</font></a>.texmanager</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/lib/python2.4/site-packages/matplotlib/texmanager.py">/usr/lib/python2.4/site-packages/matplotlib/texmanager.py</a></font></td></tr></table>
<p><tt>This module supports embedded TeX expressions in matplotlib via dvipng<br>
and dvips for the raster and postscript backends. The tex and<br>
dvipng/dvips information is cached in ~/.tex.cache for reuse between<br>
sessions<br>
<br>
Requirements:<br>
<br>
tex<br>
<br>
*Agg backends: dvipng<br>
<br>
PS backend: latex w/ psfrag, dvips, and Ghostscript 8.51<br>
(older versions do not work properly)<br>
<br>
Backends:<br>
<br>
Only supported on *Agg and PS backends currently<br>
<br>
<br>
For raster output, you can get RGBA numerix arrays from TeX expressions<br>
as follows<br>
<br>
texmanager = <a href="#TexManager">TexManager</a>()<br>
s = r'\TeX\ is Number $\displaystyle\sum_{n=1}^\inftyrac{-e^{i\pi}}{2^n}$!'<br>
Z = self.<strong>texmanager</strong>.get_rgba(s, size=12, dpi=80, rgb=(1,0,0))<br>
<br>
To enable tex rendering of all text in your matplotlib figure, set<br>
text.usetex in your matplotlibrc file<br>
(<a href="http://matplotlib.sf.net/.matplotlibrc">http://matplotlib.sf.net/.matplotlibrc</a>)</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="md5.html">md5</a><br>
</td><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="shutil.html">shutil</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="matplotlib.texmanager.html#TexManager">TexManager</a>
</font></dt></dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="TexManager">class <strong>TexManager</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Convert strings to dvi files using TeX, caching the results to a<br>
working dir<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="TexManager-__init__"><strong>__init__</strong></a>(self)</dt></dl>
<dl><dt><a name="TexManager-get_dvipng_version"><strong>get_dvipng_version</strong></a>(self)</dt></dl>
<dl><dt><a name="TexManager-get_prefix"><strong>get_prefix</strong></a>(self, tex)</dt></dl>
<dl><dt><a name="TexManager-get_ps_bbox"><strong>get_ps_bbox</strong></a>(self, tex)</dt></dl>
<dl><dt><a name="TexManager-get_rgba"><strong>get_rgba</strong></a>(self, tex, fontsize<font color="#909090">=10</font>, dpi<font color="#909090">=80</font>, rgb<font color="#909090">=(0, 0, 0)</font>)</dt><dd><tt>Return tex string as an rgba array</tt></dd></dl>
<dl><dt><a name="TexManager-make_dvi"><strong>make_dvi</strong></a>(self, tex, force<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="TexManager-make_png"><strong>make_png</strong></a>(self, tex, dpi, force<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="TexManager-make_ps"><strong>make_ps</strong></a>(self, tex, dpi, force<font color="#909090">=0</font>)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>path</strong> = '/home/jdhunter'</dl>
<dl><dt><strong>texcache</strong> = '/home/jdhunter/.tex.cache'</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-array"><strong>array</strong></a>(...)</dt><dd><tt><a href="#-array">array</a>(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode. If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence. If copy is zero and sequence is already an array, a reference will be returned. If savespace is nonzero, the new array will maintain its precision in operations.</tt></dd></dl>
<dl><dt><a name="-readpng"><strong>readpng</strong></a>(...)</dt><dd><tt>readpng</tt></dd></dl>
<dl><dt><a name="-zeros"><strong>zeros</strong></a>(...)</dt><dd><tt><a href="#-zeros">zeros</a>((d1,...,dn),typecode='l',savespace=0) will return a new array of shape (d1,...,dn) and type typecode with all it's entries initialized to zero. If savespace is nonzero the array will be a spacesaver array.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>Float</strong> = 'd'<br>
<strong>absolute</strong> = <ufunc 'absolute'><br>
<strong>debug</strong> = False<br>
<strong>rcParams</strong> = {'axes.edgecolor': 'black', 'axes.facecolor': 'white', 'axes.grid': False, 'axes.hold': True, 'axes.labelcolor': 'black', 'axes.labelsize': 12.0, 'axes.linewidth': 1.0, 'axes.titlesize': 14.0, 'backend': 'TkAgg', 'datapath': '/usr/share/matplotlib', ...}<br>
<strong>sqrt</strong> = <ufunc 'sqrt'><br>
<strong>verbose</strong> = <matplotlib.Verbose instance></td></tr></table>
@footer@