567 lines (427 with data), 44.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>.<a href="matplotlib.backends.html"><font color="#ffffff">backends</font></a>.backend_template</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="/matplotlib/backends/backend_template.py">/matplotlib/backends/backend_template.py</a></font></td></tr></table>
<p><tt>This is a fully functional do nothing backend to provide a template to<br>
backend writers. It is fully functional in that you can select it as<br>
a backend with<br>
<br>
import matplotlib<br>
matplotlib.use('Template')<br>
<br>
and your matplotlib scripts will (should!) run without error, though<br>
no output is produced. This provides a nice starting points for<br>
backend writers because you can selectively start implementing methods<br>
(draw_rectangle, draw_lines, etc...) and slowly see your figure come<br>
to life w/o having to have a full blown implementation before getting<br>
any results.<br>
<br>
Copy this to backend_xxx.py and replace all instances of 'template'<br>
with 'xxx'. Then implement the class methods and functions below, and<br>
add 'xxx' to the switchyard in matplotlib/backends/__init__.py and<br>
'xxx' to the _knownBackends dict in matplotlib/__init__.py and you're<br>
off. You can use your backend with<br>
<br>
import matplotlib<br>
matplotlib.use('xxx')<br>
from matplotlib.matlab import *<br>
plot([1,2,3])<br>
<a href="#-show">show</a>()<br>
<br>
The files that are most relevant to backend_writers are<br>
<br>
matplotlib/backends/backend_your_backend.py<br>
matplotlib/backend_bases.py<br>
matplotlib/backends/__init__.py<br>
matplotlib/__init__.py<br>
matplotlib/_matlab_helpers.py<br>
<br>
Naming Conventions<br>
<br>
* classes MixedUpperCase<br>
<br>
* varables lowerUpper<br>
<br>
* functions underscore_separated<br>
<br>
REQUIREMENTS<br>
<br>
matplotlib requires python2.2 and Numeric, and I don't yet want to<br>
make python2.3 a requirement. I provide the Python Cookbook version<br>
of enumerate in cbook.py and define the constants True and False if<br>
version <=2.3. Of course as a backend writer, you are free to make<br>
additional requirements, but the less required the better.</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="sys.html">sys</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></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.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a>(<a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#AxisTextTemplate">AxisTextTemplate</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#AxisTextTemplate">AxisTextTemplate</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.backend_bases.html#FigureBase">matplotlib.backend_bases.FigureBase</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#FigureTemplate">FigureTemplate</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#FigureTemplate">FigureTemplate</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.backend_bases.html#FigureManagerBase">matplotlib.backend_bases.FigureManagerBase</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#FigureManagerTemplate">FigureManagerTemplate</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#FigureManagerTemplate">FigureManagerTemplate</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.backend_bases.html#GraphicsContextBase">matplotlib.backend_bases.GraphicsContextBase</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#GraphicsContextTemplate">GraphicsContextTemplate</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.backend_bases.html#RendererBase">matplotlib.backend_bases.RendererBase</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#RendererTemplate">RendererTemplate</a>
</font></dt></dl>
</dd>
</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"><strong>AxisText</strong> = <a name="AxisText">class AxisTextTemplate</a>(<a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Handle storing and drawing of text<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="matplotlib.backends.backend_template.html#AxisTextTemplate">AxisTextTemplate</a></dd>
<dd><a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a></dd>
<dd><a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="AxisTextTemplate-__init__"><strong>__init__</strong></a>(self, *args, **kwargs)</dt></dl>
<dl><dt><a name="AxisTextTemplate-get_window_extent"><strong>get_window_extent</strong></a>(self)</dt><dd><tt>Return the ink extent of the text as Bound2D instance</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a>:<br>
<dl><dt><a name="AxisTextTemplate-__del__"><strong>__del__</strong></a>(self)</dt><dd><tt>Bye bye</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-erase"><strong>erase</strong></a>(self)</dt></dl>
<dl><dt><a name="AxisTextTemplate-get_fontangle"><strong>get_fontangle</strong></a>(self)</dt><dd><tt>Get the font angle as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_fontname"><strong>get_fontname</strong></a>(self)</dt><dd><tt>Return the font name as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_fontsize"><strong>get_fontsize</strong></a>(self)</dt><dd><tt>Return the font size as integer</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_fontweight"><strong>get_fontweight</strong></a>(self)</dt><dd><tt>Get the font weight as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_horizontalalignment"><strong>get_horizontalalignment</strong></a>(self)</dt><dd><tt>Return the horizontal alignment as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_position"><strong>get_position</strong></a>(self)</dt><dd><tt>Return x, y as tuple</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_text"><strong>get_text</strong></a>(self)</dt><dd><tt>Get the text as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_verticalalignment"><strong>get_verticalalignment</strong></a>(self)</dt><dd><tt>Return the vertical alignment as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_backgroundcolor"><strong>set_backgroundcolor</strong></a>(self, color)</dt><dd><tt>Set the background color of the text</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_color"><strong>set_color</strong></a>(self, color)</dt><dd><tt>Set the foreground color of the text</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontangle"><strong>set_fontangle</strong></a>(self, angle)</dt><dd><tt>Set the font angle, one of 'normal', 'italic', 'oblique'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontname"><strong>set_fontname</strong></a>(self, fontname)</dt><dd><tt>Set the font name, eg, 'Sans', 'Courier', 'Helvetica'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontsize"><strong>set_fontsize</strong></a>(self, fontsize)</dt><dd><tt>Set the font size, eg, 8, 10, 12, 14...</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontweight"><strong>set_fontweight</strong></a>(self, weight)</dt><dd><tt>Set the font weight, one of:<br>
'normal', 'bold', 'heavy', 'light', 'ultrabold', 'ultralight'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_horizontalalignment"><strong>set_horizontalalignment</strong></a>(self, align)</dt><dd><tt>Set the horizontal alignment to one of<br>
'center', 'right', or 'left'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_position"><strong>set_position</strong></a>(self, xy)</dt></dl>
<dl><dt><a name="AxisTextTemplate-set_rotation"><strong>set_rotation</strong></a>(self, s)</dt><dd><tt>Currently only s='vertical', or s='horizontal' are supported</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_text"><strong>set_text</strong></a>(self, text)</dt><dd><tt>Set the text</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_verticalalignment"><strong>set_verticalalignment</strong></a>(self, align)</dt><dd><tt>Set the vertical alignment to one of<br>
'center', 'top', or 'bottom'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_x"><strong>set_x</strong></a>(self, x)</dt></dl>
<dl><dt><a name="AxisTextTemplate-set_y"><strong>set_y</strong></a>(self, y)</dt></dl>
<dl><dt><a name="AxisTextTemplate-update_properties"><strong>update_properties</strong></a>(self, d)</dt><dd><tt>Update the font attributes with the dictionary in d</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-wash_brushes"><strong>wash_brushes</strong></a>(self)</dt><dd><tt>Flush all state vars and prepare for a clean redraw</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a>:<br>
<dl><dt><strong>fontangles</strong> = {'italic': None, 'normal': None, 'oblique': None}</dl>
<dl><dt><strong>fontweights</strong> = {'bold': None, 'heavy': None, 'light': None, 'normal': None, 'ultrabold': None, 'ultralight': None}</dl>
<hr>
Methods inherited from <a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>:<br>
<dl><dt><a name="AxisTextTemplate-draw"><strong>draw</strong></a>(self, drawable<font color="#909090">=None</font>, *args, **kwargs)</dt><dd><tt>Derived classes drawing method</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_child_artists"><strong>get_child_artists</strong></a>(self)</dt><dd><tt>Return all artists contained in self</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_dpi"><strong>get_dpi</strong></a>(self)</dt><dd><tt>Get the DPI of the display</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_child_attr"><strong>set_child_attr</strong></a>(self, attr, val)</dt><dd><tt>Set attribute attr for self, and all child artists</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_clip_on"><strong>set_clip_on</strong></a>(self, b)</dt><dd><tt>Set whether artist is clipped to bbox</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_lod"><strong>set_lod</strong></a>(self, on)</dt><dd><tt>Set Level of Detail on or off. If on, the artists may examine<br>
things like the pixel width of the axes and draw a subset of<br>
their contents accordingly</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_renderer"><strong>set_renderer</strong></a>(self, renderer)</dt><dd><tt>Set the renderer</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_transform"><strong>set_transform</strong></a>(self, transform)</dt><dd><tt>Set the artist transform for self and all children</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>:<br>
<dl><dt><strong>aname</strong> = 'Artist'</dl>
</td></tr></table> <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="AxisTextTemplate">class <strong>AxisTextTemplate</strong></a>(<a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Handle storing and drawing of text<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="matplotlib.backends.backend_template.html#AxisTextTemplate">AxisTextTemplate</a></dd>
<dd><a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a></dd>
<dd><a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="AxisTextTemplate-__init__"><strong>__init__</strong></a>(self, *args, **kwargs)</dt></dl>
<dl><dt><a name="AxisTextTemplate-get_window_extent"><strong>get_window_extent</strong></a>(self)</dt><dd><tt>Return the ink extent of the text as Bound2D instance</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a>:<br>
<dl><dt><a name="AxisTextTemplate-__del__"><strong>__del__</strong></a>(self)</dt><dd><tt>Bye bye</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-erase"><strong>erase</strong></a>(self)</dt></dl>
<dl><dt><a name="AxisTextTemplate-get_fontangle"><strong>get_fontangle</strong></a>(self)</dt><dd><tt>Get the font angle as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_fontname"><strong>get_fontname</strong></a>(self)</dt><dd><tt>Return the font name as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_fontsize"><strong>get_fontsize</strong></a>(self)</dt><dd><tt>Return the font size as integer</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_fontweight"><strong>get_fontweight</strong></a>(self)</dt><dd><tt>Get the font weight as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_horizontalalignment"><strong>get_horizontalalignment</strong></a>(self)</dt><dd><tt>Return the horizontal alignment as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_position"><strong>get_position</strong></a>(self)</dt><dd><tt>Return x, y as tuple</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_text"><strong>get_text</strong></a>(self)</dt><dd><tt>Get the text as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_verticalalignment"><strong>get_verticalalignment</strong></a>(self)</dt><dd><tt>Return the vertical alignment as string</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_backgroundcolor"><strong>set_backgroundcolor</strong></a>(self, color)</dt><dd><tt>Set the background color of the text</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_color"><strong>set_color</strong></a>(self, color)</dt><dd><tt>Set the foreground color of the text</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontangle"><strong>set_fontangle</strong></a>(self, angle)</dt><dd><tt>Set the font angle, one of 'normal', 'italic', 'oblique'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontname"><strong>set_fontname</strong></a>(self, fontname)</dt><dd><tt>Set the font name, eg, 'Sans', 'Courier', 'Helvetica'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontsize"><strong>set_fontsize</strong></a>(self, fontsize)</dt><dd><tt>Set the font size, eg, 8, 10, 12, 14...</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_fontweight"><strong>set_fontweight</strong></a>(self, weight)</dt><dd><tt>Set the font weight, one of:<br>
'normal', 'bold', 'heavy', 'light', 'ultrabold', 'ultralight'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_horizontalalignment"><strong>set_horizontalalignment</strong></a>(self, align)</dt><dd><tt>Set the horizontal alignment to one of<br>
'center', 'right', or 'left'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_position"><strong>set_position</strong></a>(self, xy)</dt></dl>
<dl><dt><a name="AxisTextTemplate-set_rotation"><strong>set_rotation</strong></a>(self, s)</dt><dd><tt>Currently only s='vertical', or s='horizontal' are supported</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_text"><strong>set_text</strong></a>(self, text)</dt><dd><tt>Set the text</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_verticalalignment"><strong>set_verticalalignment</strong></a>(self, align)</dt><dd><tt>Set the vertical alignment to one of<br>
'center', 'top', or 'bottom'</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_x"><strong>set_x</strong></a>(self, x)</dt></dl>
<dl><dt><a name="AxisTextTemplate-set_y"><strong>set_y</strong></a>(self, y)</dt></dl>
<dl><dt><a name="AxisTextTemplate-update_properties"><strong>update_properties</strong></a>(self, d)</dt><dd><tt>Update the font attributes with the dictionary in d</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-wash_brushes"><strong>wash_brushes</strong></a>(self)</dt><dd><tt>Flush all state vars and prepare for a clean redraw</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.backend_bases.html#AxisTextBase">matplotlib.backend_bases.AxisTextBase</a>:<br>
<dl><dt><strong>fontangles</strong> = {'italic': None, 'normal': None, 'oblique': None}</dl>
<dl><dt><strong>fontweights</strong> = {'bold': None, 'heavy': None, 'light': None, 'normal': None, 'ultrabold': None, 'ultralight': None}</dl>
<hr>
Methods inherited from <a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>:<br>
<dl><dt><a name="AxisTextTemplate-draw"><strong>draw</strong></a>(self, drawable<font color="#909090">=None</font>, *args, **kwargs)</dt><dd><tt>Derived classes drawing method</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_child_artists"><strong>get_child_artists</strong></a>(self)</dt><dd><tt>Return all artists contained in self</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-get_dpi"><strong>get_dpi</strong></a>(self)</dt><dd><tt>Get the DPI of the display</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_child_attr"><strong>set_child_attr</strong></a>(self, attr, val)</dt><dd><tt>Set attribute attr for self, and all child artists</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_clip_on"><strong>set_clip_on</strong></a>(self, b)</dt><dd><tt>Set whether artist is clipped to bbox</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_lod"><strong>set_lod</strong></a>(self, on)</dt><dd><tt>Set Level of Detail on or off. If on, the artists may examine<br>
things like the pixel width of the axes and draw a subset of<br>
their contents accordingly</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_renderer"><strong>set_renderer</strong></a>(self, renderer)</dt><dd><tt>Set the renderer</tt></dd></dl>
<dl><dt><a name="AxisTextTemplate-set_transform"><strong>set_transform</strong></a>(self, transform)</dt><dd><tt>Set the artist transform for self and all children</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>:<br>
<dl><dt><strong>aname</strong> = 'Artist'</dl>
</td></tr></table> <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"><strong>Figure</strong> = <a name="Figure">class FigureTemplate</a>(<a href="matplotlib.backend_bases.html#FigureBase">matplotlib.backend_bases.FigureBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>The figure is the main object -- it contains the Axes and Text,<br>
which in turn contain lines, patches, and more text<br>
<br>
GUI implementers will probably want to look at FigureGTK in<br>
backend_gtk.py for examples of handling events with respect to<br>
matplotlib.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FigureTemplate-__init__"><strong>__init__</strong></a>(self, figsize, dpi)</dt></dl>
<dl><dt><a name="FigureTemplate-draw"><strong>draw</strong></a>(self, drawable<font color="#909090">=None</font>, *args, **kwargs)</dt><dd><tt>Render the figure using <a href="#RendererTemplate">RendererTemplate</a> instance drawable</tt></dd></dl>
<dl><dt><a name="FigureTemplate-print_figure"><strong>print_figure</strong></a>(self, filename, dpi<font color="#909090">=300</font>)</dt><dd><tt>Render the figure to hardcopy using self.<strong>drawable</strong> as the<br>
renderer if neccessary</tt></dd></dl>
<dl><dt><a name="FigureTemplate-realize"><strong>realize</strong></a>(self, *args)</dt><dd><tt>This method will be called when the system is ready to draw,<br>
eg when a GUI window is realized</tt></dd></dl>
<dl><dt><a name="FigureTemplate-text"><strong>text</strong></a>(self, x, y, s, *args, **kwargs)</dt><dd><tt>Add text to figure at location x,y (relative 0-1 coords) See<br>
the help for Axis text for the meaning of the other arguments</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#FigureBase">matplotlib.backend_bases.FigureBase</a>:<br>
<dl><dt><a name="FigureTemplate-add_axis"><strong>add_axis</strong></a>(self, a)</dt></dl>
<dl><dt><a name="FigureTemplate-clear"><strong>clear</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureTemplate-get_axes"><strong>get_axes</strong></a>(self)</dt></dl>
</td></tr></table> <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"><strong>FigureManager</strong> = <a name="FigureManager">class FigureManagerTemplate</a>(<a href="matplotlib.backend_bases.html#FigureManagerBase">matplotlib.backend_bases.FigureManagerBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>GUIs need to override<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods inherited from <a href="matplotlib.backend_bases.html#FigureManagerBase">matplotlib.backend_bases.FigureManagerBase</a>:<br>
<dl><dt><a name="FigureManagerTemplate-__init__"><strong>__init__</strong></a>(self, figure, num)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-add_axes"><strong>add_axes</strong></a>(self, rect, axisbg)</dt><dd><tt>Add an axes to the current figure</tt></dd></dl>
<dl><dt><a name="FigureManagerTemplate-add_subplot"><strong>add_subplot</strong></a>(self, *args, **kwargs)</dt><dd><tt>Add a subplot to the current figure</tt></dd></dl>
<dl><dt><a name="FigureManagerTemplate-destroy"><strong>destroy</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-get_current_axis"><strong>get_current_axis</strong></a>(self)</dt><dd><tt>Return the current axes</tt></dd></dl>
<dl><dt><a name="FigureManagerTemplate-set_current_axes"><strong>set_current_axes</strong></a>(self, a)</dt><dd><tt>Set the current axes to be a</tt></dd></dl>
</td></tr></table> <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="FigureManagerTemplate">class <strong>FigureManagerTemplate</strong></a>(<a href="matplotlib.backend_bases.html#FigureManagerBase">matplotlib.backend_bases.FigureManagerBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>GUIs need to override<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods inherited from <a href="matplotlib.backend_bases.html#FigureManagerBase">matplotlib.backend_bases.FigureManagerBase</a>:<br>
<dl><dt><a name="FigureManagerTemplate-__init__"><strong>__init__</strong></a>(self, figure, num)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-add_axes"><strong>add_axes</strong></a>(self, rect, axisbg)</dt><dd><tt>Add an axes to the current figure</tt></dd></dl>
<dl><dt><a name="FigureManagerTemplate-add_subplot"><strong>add_subplot</strong></a>(self, *args, **kwargs)</dt><dd><tt>Add a subplot to the current figure</tt></dd></dl>
<dl><dt><a name="FigureManagerTemplate-destroy"><strong>destroy</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-get_current_axis"><strong>get_current_axis</strong></a>(self)</dt><dd><tt>Return the current axes</tt></dd></dl>
<dl><dt><a name="FigureManagerTemplate-set_current_axes"><strong>set_current_axes</strong></a>(self, a)</dt><dd><tt>Set the current axes to be a</tt></dd></dl>
</td></tr></table> <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="FigureTemplate">class <strong>FigureTemplate</strong></a>(<a href="matplotlib.backend_bases.html#FigureBase">matplotlib.backend_bases.FigureBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>The figure is the main object -- it contains the Axes and Text,<br>
which in turn contain lines, patches, and more text<br>
<br>
GUI implementers will probably want to look at FigureGTK in<br>
backend_gtk.py for examples of handling events with respect to<br>
matplotlib.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FigureTemplate-__init__"><strong>__init__</strong></a>(self, figsize, dpi)</dt></dl>
<dl><dt><a name="FigureTemplate-draw"><strong>draw</strong></a>(self, drawable<font color="#909090">=None</font>, *args, **kwargs)</dt><dd><tt>Render the figure using <a href="#RendererTemplate">RendererTemplate</a> instance drawable</tt></dd></dl>
<dl><dt><a name="FigureTemplate-print_figure"><strong>print_figure</strong></a>(self, filename, dpi<font color="#909090">=300</font>)</dt><dd><tt>Render the figure to hardcopy using self.<strong>drawable</strong> as the<br>
renderer if neccessary</tt></dd></dl>
<dl><dt><a name="FigureTemplate-realize"><strong>realize</strong></a>(self, *args)</dt><dd><tt>This method will be called when the system is ready to draw,<br>
eg when a GUI window is realized</tt></dd></dl>
<dl><dt><a name="FigureTemplate-text"><strong>text</strong></a>(self, x, y, s, *args, **kwargs)</dt><dd><tt>Add text to figure at location x,y (relative 0-1 coords) See<br>
the help for Axis text for the meaning of the other arguments</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#FigureBase">matplotlib.backend_bases.FigureBase</a>:<br>
<dl><dt><a name="FigureTemplate-add_axis"><strong>add_axis</strong></a>(self, a)</dt></dl>
<dl><dt><a name="FigureTemplate-clear"><strong>clear</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureTemplate-get_axes"><strong>get_axes</strong></a>(self)</dt></dl>
</td></tr></table> <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="GraphicsContextTemplate">class <strong>GraphicsContextTemplate</strong></a>(<a href="matplotlib.backend_bases.html#GraphicsContextBase">matplotlib.backend_bases.GraphicsContextBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>The graphics context provides the color, line styles, etc... See<br>
the gtk and postscript backends for examples of mapping the<br>
graphics context attributes (cap styles, join styles, line widths,<br>
colors) to a particular backend. In GTK this is done by wrapping<br>
a gtk.gdk.GC object and forwarding the appropriate calls to it<br>
using a dictionary mapping styles to gdk constants. In<br>
Postscript, all the work is done by the renderer, mapping line<br>
styles to postscript calls.<br>
<br>
The base GraphicsContext stores colors as a RGB tuple on the unit<br>
interval, eg, (0.5, 0.0, 1.0). You will probably need to map this<br>
to colors appropriate for your backend. Eg, see the ColorManager<br>
class for the GTK backend. If it's more appropriate to do the<br>
mapping at the renderer level (as in the postscript backend), you<br>
don't need to override any of the GC methods. If it's more<br>
approritate to wrap an instance (as in the GTK backend) and do the<br>
mapping here, you'll need to override several of the setter<br>
methods.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods inherited from <a href="matplotlib.backend_bases.html#GraphicsContextBase">matplotlib.backend_bases.GraphicsContextBase</a>:<br>
<dl><dt><a name="GraphicsContextTemplate-__init__"><strong>__init__</strong></a>(self)</dt></dl>
<dl><dt><a name="GraphicsContextTemplate-copy_properties"><strong>copy_properties</strong></a>(self, gc)</dt><dd><tt>Copy properties from gc to self</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_capstyle"><strong>get_capstyle</strong></a>(self)</dt><dd><tt>Return the capstyle as a string in ('butt', 'round', 'projecting')</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_clip_rectangle"><strong>get_clip_rectangle</strong></a>(self)</dt><dd><tt>Return the clip rectangle as (left, bottom, width, height)</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_dashes"><strong>get_dashes</strong></a>(self)</dt><dd><tt>Return the dash information as an offset dashlist tuple The<br>
dash list is a even size list that gives the ink on, ink off<br>
in pixels. See p107 of to postscript BLUEBOOK for more info<br>
<br>
Default value is None</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_joinstyle"><strong>get_joinstyle</strong></a>(self)</dt><dd><tt>Return the line join style as one of ('miter', 'round', 'bevel')</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_linestyle"><strong>get_linestyle</strong></a>(self, style)</dt><dd><tt>Return the linestyle: one of ('solid', 'dashed', 'dashdot',<br>
'dotted').</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_linewidth"><strong>get_linewidth</strong></a>(self)</dt><dd><tt>Return the line width in points as a scalar</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_rgb"><strong>get_rgb</strong></a>(self)</dt><dd><tt>returns a tuple of three floats from 0-1. color can be a<br>
matlab format string, a html hex color string, or a rgb tuple</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_capstyle"><strong>set_capstyle</strong></a>(self, cs)</dt><dd><tt>Set the capstyle as a string in ('butt', 'round', 'projecting')</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_clip_rectangle"><strong>set_clip_rectangle</strong></a>(self, rectangle)</dt><dd><tt>Set the clip rectangle with sequence (left, bottom, width, height)</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_dashes"><strong>set_dashes</strong></a>(self, dash_offset, dash_list)</dt><dd><tt>Set the dash style for the gc. dash offset is the offset<br>
(usually 0). Dash list specifies the on-off sequence as<br>
points</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_foreground"><strong>set_foreground</strong></a>(self, fg)</dt><dd><tt>Set the foreground color. fg can be a matlab format string, a<br>
html hex color string, an rgb unit tuple, or a float between 0<br>
and 1. In the latter case, grayscale is used.</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_graylevel"><strong>set_graylevel</strong></a>(self, frac)</dt><dd><tt>Set the foreground color to be a gray level with frac frac</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_joinstyle"><strong>set_joinstyle</strong></a>(self, js)</dt><dd><tt>Set the join style to be one of ('miter', 'round', 'bevel')</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_linestyle"><strong>set_linestyle</strong></a>(self, style)</dt><dd><tt>Set the linestyle to be one of ('solid', 'dashed', 'dashdot',<br>
'dotted').</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_linewidth"><strong>set_linewidth</strong></a>(self, w)</dt><dd><tt>Set the linewidth in points</tt></dd></dl>
</td></tr></table> <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="RendererTemplate">class <strong>RendererTemplate</strong></a>(<a href="matplotlib.backend_bases.html#RendererBase">matplotlib.backend_bases.RendererBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>The renderer handles all the drawing primitives using a graphics<br>
context instance that controls the colors/styles<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="RendererTemplate-draw_arc"><strong>draw_arc</strong></a>(self, gcEdge, faceColor, x, y, width, height, angle1, angle2)</dt><dd><tt>Draw an arc centered at x,y with width and height and angles<br>
from 0.0 to 360.0.<br>
<br>
If faceColor is not None, fill the rectangle with it. gcEdge<br>
is a GraphicsContext instance</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_line"><strong>draw_line</strong></a>(self, gc, x1, y1, x2, y2)</dt><dd><tt>Draw a single line from x1,y1 to x2,y2</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_lines"><strong>draw_lines</strong></a>(self, gc, x, y)</dt><dd><tt>x and y are equal length arrays, draw lines connecting each<br>
point in x, y</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_point"><strong>draw_point</strong></a>(self, gc, x, y)</dt><dd><tt>Draw a single point at x,y</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_polygon"><strong>draw_polygon</strong></a>(self, gcEdge, faceColor, points)</dt><dd><tt>Draw a polygon. points is a len vertices tuple, each element<br>
giving the x,y coords a vertex.<br>
<br>
If faceColor is not None, fill the rectangle with it. gcEdge<br>
is a GraphicsContext instance</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_rectangle"><strong>draw_rectangle</strong></a>(self, gcEdge, faceColor, x, y, width, height)</dt><dd><tt>Draw a rectangle at lower left x,y with width and height.<br>
<br>
If faceColor is not None, fill the rectangle with it. gcEdge<br>
is a GraphicsContext instance</tt></dd></dl>
<dl><dt><a name="RendererTemplate-new_gc"><strong>new_gc</strong></a>(self)</dt><dd><tt>Return an instance of a <a href="#GraphicsContextTemplate">GraphicsContextTemplate</a></tt></dd></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="-draw_if_interactive"><strong>draw_if_interactive</strong></a>()</dt><dd><tt>This should be overriden in a windowing environment if drawing<br>
should be done in interactive python mode</tt></dd></dl>
<dl><dt><a name="-error_msg"><strong>error_msg</strong></a> = error_msg_template(msg, *args)</dt><dd><tt>Signal an error condition -- in a GUI, popup a error dialog</tt></dd></dl>
<dl><dt><a name="-error_msg_template"><strong>error_msg_template</strong></a>(msg, *args)</dt><dd><tt>Signal an error condition -- in a GUI, popup a error dialog</tt></dd></dl>
<dl><dt><a name="-new_figure_manager"><strong>new_figure_manager</strong></a>(num, figsize, dpi)</dt><dd><tt>Create a new figure manager instance</tt></dd></dl>
<dl><dt><a name="-show"><strong>show</strong></a>()</dt><dd><tt>This is usually the last line of a matlab script and tells the<br>
backend that it is time to draw. In interactive mode, this may be<br>
a do nothing func. See the GTK backend for an example of how to<br>
handle interactive versus batch mode</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>False</strong> = False<br>
<strong>True</strong> = True</td></tr></table>
@footer@