447 lines (375 with data), 35.1 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="file:/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_template.py">/usr/local/lib/python2.3/site-packages/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 point for<br>
backend writers because you can selectively implement 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 pylab 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/_pylab_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="#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#FigureCanvasBase">matplotlib.backend_bases.FigureCanvasBase</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_template.html#FigureCanvasTemplate">FigureCanvasTemplate</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"><a name="FigureCanvasTemplate">class <strong>FigureCanvasTemplate</strong></a>(<a href="matplotlib.backend_bases.html#FigureCanvasBase">matplotlib.backend_bases.FigureCanvasBase</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>The canvas the figure renders into. Calls the draw and print fig<br>
methods, creates the renderers, etc...<br>
<br>
Public attribute<br>
<br>
figure - A Figure instance<br>
<br>
Note GUI templates will want to connect events for button presses,<br>
mouse movements and key presses to functions that call the base<br>
class methods button_press_event, button_release_event,<br>
motion_notify_event, key_press_event, and key_release_event. See,<br>
eg backend_gtk.py, backend_wx.py and backend_tkagg.py<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FigureCanvasTemplate-draw"><strong>draw</strong></a>(self)</dt><dd><tt>Draw the figure using the renderer</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-print_figure"><strong>print_figure</strong></a>(self, filename, dpi<font color="#909090">=150</font>, facecolor<font color="#909090">='w'</font>, edgecolor<font color="#909090">='w'</font>, orientation<font color="#909090">='portrait'</font>)</dt><dd><tt>Render the figure to hardcopy. Set the figure patch face and edge<br>
colors. This is useful because some of the GUIs have a gray figure<br>
face color background and you'll probably want to override this on<br>
hardcopy.<br>
<br>
orientation - only currently applies to PostScript printing.<br>
<br>
A GUI backend should save and restore the original figure settings.<br>
An image backend does not need to do this since after the print the<br>
figure is done</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#FigureCanvasBase">matplotlib.backend_bases.FigureCanvasBase</a>:<br>
<dl><dt><a name="FigureCanvasTemplate-__init__"><strong>__init__</strong></a>(self, figure)</dt></dl>
<dl><dt><a name="FigureCanvasTemplate-button_press_event"><strong>button_press_event</strong></a>(self, x, y, button, guiEvent<font color="#909090">=None</font>)</dt><dd><tt>Backend derived classes should call this function on any mouse<br>
button press. x,y are the canvas coords: 0,0 is lower, left.<br>
button and key are as defined in MouseEvent</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-button_release_event"><strong>button_release_event</strong></a>(self, x, y, button, guiEvent<font color="#909090">=None</font>)</dt><dd><tt>Backend derived classes should call this function on any mouse<br>
button release. x,y are the canvas coords: 0,0 is lower, left.<br>
button and key are as defined in MouseEvent</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-draw_cursor"><strong>draw_cursor</strong></a>(self, event)</dt><dd><tt>Draw a cursor in the event.axes if inaxes is not None. Use<br>
native GUI drawing for efficiency if possible</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-draw_idle"><strong>draw_idle</strong></a>(self, *args, **kwargs)</dt><dd><tt>draw only if idle; defaults to draw but backends can overrride</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-key_press_event"><strong>key_press_event</strong></a>(self, key, guiEvent<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="FigureCanvasTemplate-key_release_event"><strong>key_release_event</strong></a>(self, key, guiEvent<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="FigureCanvasTemplate-motion_notify_event"><strong>motion_notify_event</strong></a>(self, x, y, guiEvent<font color="#909090">=None</font>)</dt><dd><tt>Backend derived classes should call this function on any mouse<br>
button release. x,y are the canvas coords: 0,0 is lower, left.<br>
button and key are as defined in MouseEvent</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-mpl_connect"><strong>mpl_connect</strong></a>(self, s, func)</dt><dd><tt>Connect event with string s to func. The signature of func is<br>
<br>
def func(event)<br>
<br>
where event is a MplEvent. The following events are recognized<br>
<br>
'key_press_event' <br>
'button_press_event' <br>
'button_release_event' <br>
'motion_notify_event' <br>
<br>
For the three events above, if the mouse is over the axes,<br>
the variable event.inaxes will be set to the axes it is over,<br>
and additionally, the variables event.xdata and event.ydata<br>
will be defined. This is the mouse location in data coords.<br>
See backend_bases.MplEvent.<br>
<br>
return value is a connection id that can be used with<br>
mpl_disconnect</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-mpl_disconnect"><strong>mpl_disconnect</strong></a>(self, cid)</dt><dd><tt>Connect s to func. return an id that can be used with disconnect<br>
Method should return None</tt></dd></dl>
<dl><dt><a name="FigureCanvasTemplate-switch_backends"><strong>switch_backends</strong></a>(self, FigureCanvasClass)</dt><dd><tt>instantiate an instance of FigureCanvasClass<br>
<br>
This is used for backend switching, eg, to instantiate a<br>
FigureCanvasPS from a FigureCanvasGTK. Note, deep copying is<br>
not done, so any changes to one of the instances (eg, setting<br>
figure size or line props), will be reflected in the other</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="matplotlib.backend_bases.html#FigureCanvasBase">matplotlib.backend_bases.FigureCanvasBase</a>:<br>
<dl><dt><strong>events</strong> = ('key_press_event', 'key_release_event', 'button_press_event', 'button_release_event', 'motion_notify_event')</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>Wrap everything up into a window for the pylab interface<br>
<br>
For non interactive backends, the base class does all the work<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, canvas, num)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-destroy"><strong>destroy</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-key_press"><strong>key_press</strong></a>(self, event)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-show_popup"><strong>show_popup</strong></a>(self, msg)</dt><dd><tt>Display message in a popup -- GUI only</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>Wrap everything up into a window for the pylab interface<br>
<br>
For non interactive backends, the base class does all the work<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, canvas, num)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-destroy"><strong>destroy</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-key_press"><strong>key_press</strong></a>(self, event)</dt></dl>
<dl><dt><a name="FigureManagerTemplate-show_popup"><strong>show_popup</strong></a>(self, msg)</dt><dd><tt>Display message in a popup -- GUI only</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="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 the gtk<br>
and postscript backends for examples of mapping the graphics context<br>
attributes (cap styles, join styles, line widths, colors) to a particular<br>
backend. In GTK this is done by wrapping a gtk.gdk.GC object and<br>
forwarding the appropriate calls to it using a dictionary mapping styles<br>
to gdk constants. In Postscript, all the work is done by the renderer,<br>
mapping line styles to postscript calls.<br>
<br>
If it's more appropriate to do the mapping at the renderer level (as in<br>
the postscript backend), you don't need to override any of the GC methods.<br>
If it's more appropriate to wrap an instance (as in the GTK backend) and<br>
do the mapping here, you'll need to override several of the setter<br>
methods.<br>
<br>
The base GraphicsContext stores colors as a RGB tuple on the unit<br>
interval, eg, (0.5, 0.0, 1.0). You may need to map this to colors<br>
appropriate for your backend.<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_alpha"><strong>get_alpha</strong></a>(self)</dt><dd><tt>Return the alpha value used for blending - not supported on<br>
all backends</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-get_antialiased"><strong>get_antialiased</strong></a>(self)</dt><dd><tt>Return true if the object should try to do antialiased rendering</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_alpha"><strong>set_alpha</strong></a>(self, alpha)</dt><dd><tt>Set the alpha value used for blending - not supported on<br>
all backends</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_antialiased"><strong>set_antialiased</strong></a>(self, b)</dt><dd><tt>True if object should be drawn with antialiased rendering</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.<br>
dash_offset is the offset (usually 0).<br>
dash_list specifies the on-off sequence as points<br>
(None, None) specifies a solid line</tt></dd></dl>
<dl><dt><a name="GraphicsContextTemplate-set_foreground"><strong>set_foreground</strong></a>(self, fg, isRGB<font color="#909090">=False</font>)</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.<br>
<br>
The GraphicsContext converts colors to rgb internally. If you<br>
know the color is rgb already, you can set isRGB to True to<br>
avoid the performace hit of the conversion</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>
<hr>
Data and other attributes inherited from <a href="matplotlib.backend_bases.html#GraphicsContextBase">matplotlib.backend_bases.GraphicsContextBase</a>:<br>
<dl><dt><strong>dashd</strong> = {'dashdot': (0, (3.0, 5.0, 1.0, 5.0)), 'dashed': (0, (6.0, 6.0)), 'dotted': (0, (1.0, 3.0)), 'solid': (None, None)}</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 drawing/rendering operations.<br>
<br>
This is a minimal do-nothing class that can be used to get started when<br>
writing a new backend. Refer to backend_bases.<a href="matplotlib.backend_bases.html#RendererBase">RendererBase</a> for<br>
documentation of the classes methods.<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, rgbFace, x, y, width, height, angle1, angle2)</dt></dl>
<dl><dt><a name="RendererTemplate-draw_image"><strong>draw_image</strong></a>(self, x, y, im, origin, bbox)</dt></dl>
<dl><dt><a name="RendererTemplate-draw_line"><strong>draw_line</strong></a>(self, gc, x1, y1, x2, y2)</dt></dl>
<dl><dt><a name="RendererTemplate-draw_lines"><strong>draw_lines</strong></a>(self, gc, x, y)</dt></dl>
<dl><dt><a name="RendererTemplate-draw_point"><strong>draw_point</strong></a>(self, gc, x, y)</dt></dl>
<dl><dt><a name="RendererTemplate-draw_polygon"><strong>draw_polygon</strong></a>(self, gcEdge, rgbFace, points)</dt></dl>
<dl><dt><a name="RendererTemplate-draw_rectangle"><strong>draw_rectangle</strong></a>(self, gcEdge, rgbFace, x, y, width, height)</dt></dl>
<dl><dt><a name="RendererTemplate-draw_text"><strong>draw_text</strong></a>(self, gc, x, y, s, prop, angle, ismath<font color="#909090">=False</font>)</dt></dl>
<dl><dt><a name="RendererTemplate-flipy"><strong>flipy</strong></a>(self)</dt></dl>
<dl><dt><a name="RendererTemplate-get_canvas_width_height"><strong>get_canvas_width_height</strong></a>(self)</dt></dl>
<dl><dt><a name="RendererTemplate-get_text_width_height"><strong>get_text_width_height</strong></a>(self, s, prop, ismath)</dt></dl>
<dl><dt><a name="RendererTemplate-new_gc"><strong>new_gc</strong></a>(self)</dt></dl>
<dl><dt><a name="RendererTemplate-points_to_pixels"><strong>points_to_pixels</strong></a>(self, points)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#RendererBase">matplotlib.backend_bases.RendererBase</a>:<br>
<dl><dt><a name="RendererTemplate-close_group"><strong>close_group</strong></a>(self, s)</dt><dd><tt>close a grouping element with label s<br>
Is only currently used by backend_svg</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_line_collection"><strong>draw_line_collection</strong></a>(self, segments, transform, clipbox, colors, linewidths, linestyle, antialiaseds, offsets, transOffset)</dt><dd><tt>This is a function for optimized line drawing. If you need to draw<br>
many line segments with similar properties, it is faster to avoid the<br>
overhead of all the object creation etc. The lack of total<br>
configurability is compensated for with efficiency. Hence we don't use<br>
a GC and many of the line props it supports. See<br>
matplotlib.collections for more details.<br>
<br>
segments is a sequence of ( line0, line1, line2), where linen =<br>
(x0, y0), (x1, y1), ... (xm, ym). Each line can be a<br>
different length<br>
<br>
transform is used to Transform the lines<br>
<br>
clipbox is a xmin, ymin, width, height clip rect<br>
<br>
colors is a tuple of RGBA tuples<br>
<br>
linewidths is a tuple of linewidths<br>
*** really should be called 'dashes' not 'linestyle', since<br>
we call gc.set_dashes() not gc.set_linestyle() ***<br>
<br>
linestyle is an (offset, onoffseq) tuple or None,None for solid<br>
<br>
antialiseds is a tuple of ones or zeros indicating whether the<br>
segment should be aa or not<br>
<br>
offsets, if not None, is a list of x,y offsets to translate the lines<br>
by after transform is used to transform the offset coords<br>
<br>
This function could be overridden in the backend to possibly implement<br>
faster drawing, but it is already much faster than using <a href="#RendererTemplate-draw_lines">draw_lines</a>()<br>
by itself.</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_poly_collection"><strong>draw_poly_collection</strong></a>(self, verts, transform, clipbox, facecolors, edgecolors, linewidths, antialiaseds, offsets, transOffset)</dt><dd><tt>Draw a polygon collection<br>
<br>
verts are a sequence of polygon vectors, where each polygon<br>
vector is a sequence of x,y tuples of vertices<br>
<br>
facecolors and edgecolors are a sequence of RGBA tuples<br>
linewidths are a sequence of linewidths<br>
antialiaseds are a sequence of 0,1 integers whether to use aa</tt></dd></dl>
<dl><dt><a name="RendererTemplate-draw_regpoly_collection"><strong>draw_regpoly_collection</strong></a>(self, clipbox, offsets, transOffset, verts, sizes, facecolors, edgecolors, linewidths, antialiaseds)</dt><dd><tt>Draw a regular poly collection<br>
<br>
offsets - is a sequence is x,y tuples<br>
transOffset - maps this to display coords<br>
<br>
verts - are the vertices of the regular polygon at the origin<br>
<br>
sizes are the area of the circle that circumscribes the<br>
polygon in points^2<br>
<br>
facecolors and edgecolors are a sequence of RGBA tuples<br>
linewidths are a sequence of linewidths<br>
antialiaseds are a sequence of 0,1 integers whether to use aa</tt></dd></dl>
<dl><dt><a name="RendererTemplate-get_text_extent"><strong>get_text_extent</strong></a>(self, text)</dt><dd><tt>Get the text extent in window coords</tt></dd></dl>
<dl><dt><a name="RendererTemplate-open_group"><strong>open_group</strong></a>(self, s)</dt><dd><tt>open a grouping element with label s<br>
Is only currently used by backend_svg</tt></dd></dl>
<dl><dt><a name="RendererTemplate-strip_math"><strong>strip_math</strong></a>(self, s)</dt></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="-Bbox"><strong>Bbox</strong></a>(...)</dt><dd><tt><a href="#-Bbox">Bbox</a>(ll, ur)</tt></dd></dl>
<dl><dt><a name="-draw_if_interactive"><strong>draw_if_interactive</strong></a>()</dt><dd><tt>For image backends - is not required<br>
For GUI backends - this should be overriden if drawing should be done in<br>
interactive python mode</tt></dd></dl>
<dl><dt><a name="-new_figure_manager"><strong>new_figure_manager</strong></a>(num, *args, **kwargs)</dt><dd><tt>Create a new figure manager instance</tt></dd></dl>
<dl><dt><a name="-show"><strong>show</strong></a>()</dt><dd><tt>For image backends - is not required<br>
For GUI backends - <a href="#-show">show</a>() is usually the last line of a pylab script and<br>
tells the backend that it is time to draw. In interactive mode, this may<br>
be a do nothing func. See the GTK backend for an example of how to handle<br>
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>division</strong> = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)</td></tr></table>
@footer@