149 lines (119 with data), 8.8 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/lib64/python2.4/site-packages/matplotlib/texmanager.py">/usr/lib64/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 ~/.matplotlib/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 (<a href="http://matplotlib.sf.net/matplotlibrc">http://matplotlib.sf.net/matplotlibrc</a>)<br>
or include these two lines in your script:<br>
from matplotlib import rc<br>
rc('text', usetex=True)</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="glob.html">glob</a><br>
<a href="md5.html">md5</a><br>
</td><td width="25%" valign=top><a href="os.html">os</a><br>
<a href="shutil.html">shutil</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
<a href="warnings.html">warnings</a><br>
</td><td width="25%" valign=top></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_basefile"><strong>get_basefile</strong></a>(self, tex, fontsize, dpi<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="TexManager-get_font_config"><strong>get_font_config</strong></a>(self)</dt></dl>
<dl><dt><a name="TexManager-get_font_preamble"><strong>get_font_preamble</strong></a>(self)</dt></dl>
<dl><dt><a name="TexManager-get_ps_bbox"><strong>get_ps_bbox</strong></a>(self, tex, fontsize)</dt></dl>
<dl><dt><a name="TexManager-get_rgba"><strong>get_rgba</strong></a>(self, tex, fontsize<font color="#909090">=None</font>, dpi<font color="#909090">=None</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-get_shell_cmd"><strong>get_shell_cmd</strong></a>(self, *args)</dt><dd><tt>On windows, changing directories can be complicated by the presence of <br>
multiple drives. get_shell_cmd deals with this issue.</tt></dd></dl>
<dl><dt><a name="TexManager-make_dvi"><strong>make_dvi</strong></a>(self, tex, fontsize, force<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="TexManager-make_png"><strong>make_png</strong></a>(self, tex, fontsize, dpi, force<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="TexManager-make_ps"><strong>make_ps</strong></a>(self, tex, fontsize, force<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="TexManager-make_tex"><strong>make_tex</strong></a>(self, tex, fontsize)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>arrayd</strong> = {}</dl>
<dl><dt><strong>configdir</strong> = '/home/darren/.matplotlib'</dl>
<dl><dt><strong>cursive</strong> = ('pzc', r'\usepackage{chancery}')</dl>
<dl><dt><strong>dvipngVersion</strong> = '1.8'</dl>
<dl><dt><strong>font_family</strong> = 'serif'</dl>
<dl><dt><strong>font_info</strong> = {'avant garde': ('pag', r'\usepackage{avant}'), 'bookman': ('pbk', r'\renewcommand{\rmdefault}{pbk}'), 'charter': ('pch', r'\usepackage{charter}'), 'computer modern roman': ('cmr', ''), 'computer modern sans serif': ('cmss', ''), 'computer modern typewriter': ('cmtt', ''), 'courier': ('pcr', r'\usepackage{courier}'), 'helvetica': ('phv', r'\usepackage{helvet}'), 'monospace': ('cmtt', ''), 'new century schoolbook': ('pnc', r'\renewcommand{\rmdefault}{pnc}'), ...}</dl>
<dl><dt><strong>monospace</strong> = ('cmtt', '')</dl>
<dl><dt><strong>oldcache</strong> = '/home/darren/.tex.cache'</dl>
<dl><dt><strong>oldpath</strong> = '/home/darren'</dl>
<dl><dt><strong>postscriptd</strong> = {}</dl>
<dl><dt><strong>pscnt</strong> = 0</dl>
<dl><dt><strong>sans_serif</strong> = ('cmss', '')</dl>
<dl><dt><strong>serif</strong> = ('cmr', '')</dl>
<dl><dt><strong>texcache</strong> = '/home/darren/.matplotlib/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="-get_dvipng_version"><strong>get_dvipng_version</strong></a>()</dt></dl>
<dl><dt><a name="-readpng"><strong>readpng</strong></a>(...)</dt><dd><tt>readpng</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>cmd_split</strong> = ';'<br>
<strong>debug</strong> = False<br>
<strong>rcParams</strong> = {'axes.axisbelow': False, 'axes.edgecolor': 'k', 'axes.facecolor': 'w', 'axes.formatter.limits': (-7, 7), 'axes.grid': False, 'axes.hold': True, 'axes.labelcolor': 'k', 'axes.labelsize': 'medium', 'axes.linewidth': 1.0, 'axes.titlesize': 'medium', ...}<br>
<strong>sqrt</strong> = <ufunc 'sqrt'><br>
<strong>verbose</strong> = <matplotlib.Verbose instance></td></tr></table>
@footer@