292 lines (223 with data), 23.5 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_gd</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_gd.py">/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_gd.py</a></font></td></tr></table>
<p><tt>A gd backend <a href="http://newcenturycomputers.net/projects/gdmodule.html">http://newcenturycomputers.net/projects/gdmodule.html</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="gd.html">gd</a><br>
</td><td width="25%" valign=top><a href="math.html">math</a><br>
</td><td width="25%" valign=top><a href="os.html">os</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.backend_bases.html#FigureCanvasBase">matplotlib.backend_bases.FigureCanvasBase</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_gd.html#FigureCanvasGD">FigureCanvasGD</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_gd.html#FigureManagerGD">FigureManagerGD</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.backends.backend_gd.html#FigureManagerGD">FigureManagerGD</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_gd.html#GraphicsContextGD">GraphicsContextGD</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_gd.html#RendererGD">RendererGD</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="FigureCanvasGD">class <strong>FigureCanvasGD</strong></a>(<a href="matplotlib.backend_bases.html#FigureCanvasBase">matplotlib.backend_bases.FigureCanvasBase</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FigureCanvasGD-draw"><strong>draw</strong></a>(self)</dt><dd><tt>Draw to a gd image and return the image instance</tt></dd></dl>
<dl><dt><a name="FigureCanvasGD-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 using self.<strong>renderer</strong> as the<br>
renderer if neccessary<br>
<br>
filename can be a string filename or writable file instance</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#FigureCanvasBase">matplotlib.backend_bases.FigureCanvasBase</a>:<br>
<dl><dt><a name="FigureCanvasGD-__init__"><strong>__init__</strong></a>(self, figure)</dt></dl>
<dl><dt><a name="FigureCanvasGD-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>
</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 FigureManagerGD</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>This class manages all the figures for matlab mode<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="FigureManagerGD-__init__"><strong>__init__</strong></a>(self, canvas, num)</dt></dl>
<dl><dt><a name="FigureManagerGD-add_axes"><strong>add_axes</strong></a>(self, rect, **kwargs)</dt><dd><tt>Add an axes to the current figure</tt></dd></dl>
<dl><dt><a name="FigureManagerGD-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="FigureManagerGD-clf"><strong>clf</strong></a>(self)</dt><dd><tt>clear the figure</tt></dd></dl>
<dl><dt><a name="FigureManagerGD-destroy"><strong>destroy</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureManagerGD-get_current_axis"><strong>get_current_axis</strong></a>(self)</dt><dd><tt>Return the current axes</tt></dd></dl>
<dl><dt><a name="FigureManagerGD-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="FigureManagerGD">class <strong>FigureManagerGD</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>This class manages all the figures for matlab mode<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="FigureManagerGD-__init__"><strong>__init__</strong></a>(self, canvas, num)</dt></dl>
<dl><dt><a name="FigureManagerGD-add_axes"><strong>add_axes</strong></a>(self, rect, **kwargs)</dt><dd><tt>Add an axes to the current figure</tt></dd></dl>
<dl><dt><a name="FigureManagerGD-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="FigureManagerGD-clf"><strong>clf</strong></a>(self)</dt><dd><tt>clear the figure</tt></dd></dl>
<dl><dt><a name="FigureManagerGD-destroy"><strong>destroy</strong></a>(self)</dt></dl>
<dl><dt><a name="FigureManagerGD-get_current_axis"><strong>get_current_axis</strong></a>(self)</dt><dd><tt>Return the current axes</tt></dd></dl>
<dl><dt><a name="FigureManagerGD-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="GraphicsContextGD">class <strong>GraphicsContextGD</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.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="GraphicsContextGD-__init__"><strong>__init__</strong></a>(self, im, renderer)</dt><dd><tt>Initialize with a gd image</tt></dd></dl>
<dl><dt><a name="GraphicsContextGD-set_clip_rectangle"><strong>set_clip_rectangle</strong></a>(self, rectangle)</dt></dl>
<dl><dt><a name="GraphicsContextGD-set_linestyle"><strong>set_linestyle</strong></a>(self, style)</dt></dl>
<dl><dt><a name="GraphicsContextGD-set_linewidth"><strong>set_linewidth</strong></a>(self, lw)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#GraphicsContextBase">matplotlib.backend_bases.GraphicsContextBase</a>:<br>
<dl><dt><a name="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-get_antialiased"><strong>get_antialiased</strong></a>(self)</dt><dd><tt>Return true if the object shuold try to do antialiased rendering</tt></dd></dl>
<dl><dt><a name="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-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="GraphicsContextGD-set_foreground"><strong>set_foreground</strong></a>(self, fg, isRGB<font color="#909090">=None</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="GraphicsContextGD-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="GraphicsContextGD-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>
</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="RendererGD">class <strong>RendererGD</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="RendererGD-__init__"><strong>__init__</strong></a>(self, im, dpi)</dt><dd><tt>Initialize the renderer with a gd image instance</tt></dd></dl>
<dl><dt><a name="RendererGD-draw_arc"><strong>draw_arc</strong></a>(self, gc, rgbFace, 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</tt></dd></dl>
<dl><dt><a name="RendererGD-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="RendererGD-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="RendererGD-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="RendererGD-draw_polygon"><strong>draw_polygon</strong></a>(self, gc, rgbFace, points)</dt><dd><tt>Draw a polygon. points is a len vertices tuple, each element<br>
giving the x,y coords a vertex</tt></dd></dl>
<dl><dt><a name="RendererGD-draw_rectangle"><strong>draw_rectangle</strong></a>(self, gc, rgbFace, x, y, width, height)</dt><dd><tt>Draw a rectangle at lower left x,y with width and height<br>
If filled=True, fill the rectangle with the gc foreground<br>
gc is a GraphicsContext instance</tt></dd></dl>
<dl><dt><a name="RendererGD-draw_text"><strong>draw_text</strong></a>(self, gc, x, y, s, prop, angle)</dt><dd><tt>Render the text using the <a href="#RendererGD">RendererGD</a> instance</tt></dd></dl>
<dl><dt><a name="RendererGD-finish"><strong>finish</strong></a>(self)</dt></dl>
<dl><dt><a name="RendererGD-flipy"><strong>flipy</strong></a>(self)</dt><dd><tt>return true if y small numbers are top for renderer</tt></dd></dl>
<dl><dt><a name="RendererGD-flush_clip"><strong>flush_clip</strong></a>(self)</dt></dl>
<dl><dt><a name="RendererGD-get_canvas_width_height"><strong>get_canvas_width_height</strong></a>(self)</dt><dd><tt>return the canvas width and height in display coords</tt></dd></dl>
<dl><dt><a name="RendererGD-get_gd_color"><strong>get_gd_color</strong></a>(self, rgb)</dt><dd><tt>RGB is a unit RGB tuple, return a gd color</tt></dd></dl>
<dl><dt><a name="RendererGD-get_text_scale"><strong>get_text_scale</strong></a>(self)</dt><dd><tt>Return the scale factor for fontsize taking screendpi and pixels per<br>
inch into account</tt></dd></dl>
<dl><dt><a name="RendererGD-get_text_width_height"><strong>get_text_width_height</strong></a>(self, s, prop)</dt><dd><tt>get the width and height in display coords of the string s<br>
with fontsize in points</tt></dd></dl>
<dl><dt><a name="RendererGD-new_gc"><strong>new_gc</strong></a>(self)</dt><dd><tt>Return an instance of a <a href="#GraphicsContextGD">GraphicsContextGD</a></tt></dd></dl>
<dl><dt><a name="RendererGD-points_to_pixels"><strong>points_to_pixels</strong></a>(self, points)</dt><dd><tt>convert point measures to pixes using dpi and the pixels per<br>
inch of the display</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.backend_bases.html#RendererBase">matplotlib.backend_bases.RendererBase</a>:<br>
<dl><dt><a name="RendererGD-draw_image"><strong>draw_image</strong></a>(self, x, y, im)</dt><dd><tt>Draw the Image instance into the current axes</tt></dd></dl>
<dl><dt><a name="RendererGD-draw_mathtext"><strong>draw_mathtext</strong></a>(self, gc, x, y, s, prop, angle)</dt><dd><tt>Draw string s at x,y (display coords) with font properties<br>
instance prop at angle in degrees</tt></dd></dl>
<dl><dt><a name="RendererGD-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="RendererGD-using_ft2font"><strong>using_ft2font</strong></a>(self)</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="-error_msg"><strong>error_msg</strong></a> = error_msg_gd(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_gd"><strong>error_msg_gd</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="-gd_requirements_failed"><strong>gd_requirements_failed</strong></a>()</dt><dd><tt>Print a message about the required gd version and quit</tt></dd></dl>
<dl><dt><a name="-new_figure_manager"><strong>new_figure_manager</strong></a>(num, *args)</dt><dd><tt>Add a new figure num (default autoincrement). For GUI<br>
backends, you'll need to instantiate a new window and embed<br>
the figure in it.</tt></dd></dl>
<dl><dt><a name="-round"><strong>round</strong></a>(x)</dt></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>PIXELS_PER_INCH</strong> = 96<br>
<strong>True</strong> = True<br>
<strong>colorConverter</strong> = <matplotlib.colors.ColorConverter instance><br>
<strong>division</strong> = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)<br>
<strong>fontManager</strong> = <matplotlib.font_manager.FontManager instance></td></tr></table>
@footer@