263 lines (219 with data), 20.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>.contour</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/contour.py">/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/contour.py</a></font></td></tr></table>
<p><tt>These are classes to support contour plotting and<br>
labelling for the axes class</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="matplotlib._cntr.html">matplotlib._cntr</a><br>
<a href="matplotlib.cbook.html">matplotlib.cbook</a><br>
<a href="matplotlib.cm.html">matplotlib.cm</a><br>
<a href="matplotlib.collections.html">matplotlib.collections</a><br>
</td><td width="25%" valign=top><a href="matplotlib.colors.html">matplotlib.colors</a><br>
<a href="matplotlib.font_manager.html">matplotlib.font_manager</a><br>
<a href="matplotlib.numerix.npyma.html">matplotlib.numerix.npyma</a><br>
<a href="matplotlib.html">matplotlib</a><br>
</td><td width="25%" valign=top><a href="numpy.html">numpy</a><br>
<a href="matplotlib.text.html">matplotlib.text</a><br>
<a href="matplotlib.ticker.html">matplotlib.ticker</a><br>
<a href="matplotlib.transforms.html">matplotlib.transforms</a><br>
</td><td width="25%" valign=top><a href="warnings.html">warnings</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.cm.html#ScalarMappable">matplotlib.cm.ScalarMappable</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.contour.html#ContourSet">ContourSet</a>(<a href="matplotlib.cm.html#ScalarMappable">matplotlib.cm.ScalarMappable</a>, <a href="matplotlib.contour.html#ContourLabeler">ContourLabeler</a>)
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.contour.html#ContourLabeler">ContourLabeler</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.contour.html#ContourSet">ContourSet</a>(<a href="matplotlib.cm.html#ScalarMappable">matplotlib.cm.ScalarMappable</a>, <a href="matplotlib.contour.html#ContourLabeler">ContourLabeler</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="ContourLabeler">class <strong>ContourLabeler</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Mixin to provide labelling capability to <a href="#ContourSet">ContourSet</a><br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ContourLabeler-break_linecontour"><strong>break_linecontour</strong></a>(self, linecontour, rot, labelwidth, ind)</dt><dd><tt>break a contour in two contours at the location of the label</tt></dd></dl>
<dl><dt><a name="ContourLabeler-clabel"><strong>clabel</strong></a>(self, *args, **kwargs)</dt><dd><tt><a href="#ContourLabeler-clabel">clabel</a>(CS, **kwargs) - add labels to line contours in CS,<br>
where CS is a <a href="#ContourSet">ContourSet</a> object returned by contour.<br>
<br>
<a href="#ContourLabeler-clabel">clabel</a>(CS, V, **kwargs) - only label contours listed in V<br>
<br>
keyword arguments:<br>
<br>
* fontsize = None: as described in <a href="http://matplotlib.sf.net/fonts.html">http://matplotlib.sf.net/fonts.html</a><br>
<br>
* colors = None:<br>
<br>
- a tuple of matplotlib color args (string, float, rgb, etc),<br>
different labels will be plotted in different colors in the order<br>
specified<br>
<br>
- one string color, e.g. colors = 'r' or colors = 'red', all labels<br>
will be plotted in this color<br>
<br>
- if colors == None, the color of each label matches the color<br>
of the corresponding contour<br>
<br>
* inline = True: controls whether the underlying contour is removed<br>
(inline = True) or not (False)<br>
<br>
* fmt = '%1.3f': a format string for the label</tt></dd></dl>
<dl><dt><a name="ContourLabeler-get_label_coords"><strong>get_label_coords</strong></a>(self, distances, XX, YY, ysize, lw)</dt><dd><tt>labels are ploted at a location with the smallest<br>
dispersion of the contour from a straight line<br>
unless there's another label nearby, in which case<br>
the second best place on the contour is picked up<br>
if there's no good place a label isplotted at the<br>
beginning of the contour</tt></dd></dl>
<dl><dt><a name="ContourLabeler-get_label_width"><strong>get_label_width</strong></a>(self, lev, fmt, fsize)</dt><dd><tt>get the width of the label in points</tt></dd></dl>
<dl><dt><a name="ContourLabeler-get_text"><strong>get_text</strong></a>(self, lev, fmt)</dt><dd><tt>get the text of the label</tt></dd></dl>
<dl><dt><a name="ContourLabeler-labels"><strong>labels</strong></a>(self, inline)</dt></dl>
<dl><dt><a name="ContourLabeler-locate_label"><strong>locate_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>find a good place to plot a label (relatively flat<br>
part of the contour) and the angle of rotation for the<br>
text object</tt></dd></dl>
<dl><dt><a name="ContourLabeler-print_label"><strong>print_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>if contours are too short, don't plot a label</tt></dd></dl>
<dl><dt><a name="ContourLabeler-set_label_props"><strong>set_label_props</strong></a>(self, label, text, color)</dt><dd><tt>set the label properties - color, fontsize, text</tt></dd></dl>
<dl><dt><a name="ContourLabeler-too_close"><strong>too_close</strong></a>(self, x, y, lw)</dt><dd><tt>if there's a label already nearby, find a better place</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="ContourSet">class <strong>ContourSet</strong></a>(<a href="matplotlib.cm.html#ScalarMappable">matplotlib.cm.ScalarMappable</a>, <a href="matplotlib.contour.html#ContourLabeler">ContourLabeler</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Create and store a set of contour lines or filled regions.<br>
<br>
User-callable method: clabel<br>
<br>
Useful attributes:<br>
ax - the axes object in which the contours are drawn<br>
collections - a silent_list of LineCollections or PolyCollections<br>
levels - contour levels<br>
layers - same as levels for line contours; half-way between<br>
levels for filled contours. See _process_colors method.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="matplotlib.contour.html#ContourSet">ContourSet</a></dd>
<dd><a href="matplotlib.cm.html#ScalarMappable">matplotlib.cm.ScalarMappable</a></dd>
<dd><a href="matplotlib.contour.html#ContourLabeler">ContourLabeler</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="ContourSet-__init__"><strong>__init__</strong></a>(self, ax, *args, **kwargs)</dt><dd><tt>Draw contour lines or filled regions, depending on<br>
whether keyword arg 'filled' is False (default) or True.<br>
<br>
The first argument of the initializer must be an axes<br>
object. The remaining arguments and keyword arguments<br>
are described in <a href="#ContourSet">ContourSet</a>.contour_doc.</tt></dd></dl>
<dl><dt><a name="ContourSet-changed"><strong>changed</strong></a>(self)</dt></dl>
<dl><dt><a name="ContourSet-get_alpha"><strong>get_alpha</strong></a>(self)</dt><dd><tt>For compatibility with artists, return self.<strong>alpha</strong></tt></dd></dl>
<dl><dt><a name="ContourSet-set_alpha"><strong>set_alpha</strong></a>(self, alpha)</dt><dd><tt>For compatibility with artists, set self.<strong>alpha</strong></tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>contour_doc</strong> = '<font color="#c040c0">\n</font> contour and contourf draw contour lines... boundaries unless antialiased = False<font color="#c040c0">\n</font> '</dl>
<hr>
Methods inherited from <a href="matplotlib.cm.html#ScalarMappable">matplotlib.cm.ScalarMappable</a>:<br>
<dl><dt><a name="ContourSet-add_checker"><strong>add_checker</strong></a>(self, checker)</dt><dd><tt>Add an entry to a dictionary of boolean flags<br>
that are set to True when the mappable is changed.</tt></dd></dl>
<dl><dt><a name="ContourSet-add_observer"><strong>add_observer</strong></a>(self, mappable)</dt><dd><tt>whenever the norm, clim or cmap is set, call the notify<br>
instance of the mappable observer with self.<br>
<br>
This is designed to allow one image to follow changes in the<br>
cmap of another image</tt></dd></dl>
<dl><dt><a name="ContourSet-autoscale"><strong>autoscale</strong></a>(self)</dt><dd><tt>Autoscale the scalar limits on the norm instance using the<br>
current array</tt></dd></dl>
<dl><dt><a name="ContourSet-autoscale_None"><strong>autoscale_None</strong></a>(self)</dt><dd><tt>Autoscale the scalar limits on the norm instance using the<br>
current array, changing only limits that are None</tt></dd></dl>
<dl><dt><a name="ContourSet-check_update"><strong>check_update</strong></a>(self, checker)</dt><dd><tt>If mappable has changed since the last check,<br>
return True; else return False</tt></dd></dl>
<dl><dt><a name="ContourSet-get_array"><strong>get_array</strong></a>(self)</dt><dd><tt>Return the array</tt></dd></dl>
<dl><dt><a name="ContourSet-get_clim"><strong>get_clim</strong></a>(self)</dt><dd><tt>return the min, max of the color limits for image scaling</tt></dd></dl>
<dl><dt><a name="ContourSet-notify"><strong>notify</strong></a>(self, mappable)</dt><dd><tt>If this is called then we are pegged to another mappable.<br>
Update our cmap, norm, alpha from the other mappable.</tt></dd></dl>
<dl><dt><a name="ContourSet-set_array"><strong>set_array</strong></a>(self, A)</dt><dd><tt>Set the image array from numpy array A</tt></dd></dl>
<dl><dt><a name="ContourSet-set_clim"><strong>set_clim</strong></a>(self, vmin<font color="#909090">=None</font>, vmax<font color="#909090">=None</font>)</dt><dd><tt>set the norm limits for image scaling; if vmin is a length2<br>
sequence, interpret it as (vmin, vmax) which is used to<br>
support setp<br>
<br>
ACCEPTS: a length 2 sequence of floats</tt></dd></dl>
<dl><dt><a name="ContourSet-set_cmap"><strong>set_cmap</strong></a>(self, cmap)</dt><dd><tt>set the colormap for luminance data<br>
<br>
ACCEPTS: a colormap</tt></dd></dl>
<dl><dt><a name="ContourSet-set_colorbar"><strong>set_colorbar</strong></a>(self, im, ax)</dt><dd><tt>set the colorbar image and axes associated with mappable</tt></dd></dl>
<dl><dt><a name="ContourSet-set_norm"><strong>set_norm</strong></a>(self, norm)</dt><dd><tt>set the normalization instance</tt></dd></dl>
<dl><dt><a name="ContourSet-to_rgba"><strong>to_rgba</strong></a>(self, x, alpha<font color="#909090">=1.0</font>, bytes<font color="#909090">=False</font>)</dt><dd><tt>Return a normalized rgba array corresponding to x.<br>
If x is already an rgb array, insert alpha; if it is<br>
already rgba, return it unchanged.<br>
If bytes is True, return rgba as 4 uint8s instead of 4 floats.</tt></dd></dl>
<hr>
Methods inherited from <a href="matplotlib.contour.html#ContourLabeler">ContourLabeler</a>:<br>
<dl><dt><a name="ContourSet-break_linecontour"><strong>break_linecontour</strong></a>(self, linecontour, rot, labelwidth, ind)</dt><dd><tt>break a contour in two contours at the location of the label</tt></dd></dl>
<dl><dt><a name="ContourSet-clabel"><strong>clabel</strong></a>(self, *args, **kwargs)</dt><dd><tt><a href="#ContourSet-clabel">clabel</a>(CS, **kwargs) - add labels to line contours in CS,<br>
where CS is a <a href="#ContourSet">ContourSet</a> object returned by contour.<br>
<br>
<a href="#ContourSet-clabel">clabel</a>(CS, V, **kwargs) - only label contours listed in V<br>
<br>
keyword arguments:<br>
<br>
* fontsize = None: as described in <a href="http://matplotlib.sf.net/fonts.html">http://matplotlib.sf.net/fonts.html</a><br>
<br>
* colors = None:<br>
<br>
- a tuple of matplotlib color args (string, float, rgb, etc),<br>
different labels will be plotted in different colors in the order<br>
specified<br>
<br>
- one string color, e.g. colors = 'r' or colors = 'red', all labels<br>
will be plotted in this color<br>
<br>
- if colors == None, the color of each label matches the color<br>
of the corresponding contour<br>
<br>
* inline = True: controls whether the underlying contour is removed<br>
(inline = True) or not (False)<br>
<br>
* fmt = '%1.3f': a format string for the label</tt></dd></dl>
<dl><dt><a name="ContourSet-get_label_coords"><strong>get_label_coords</strong></a>(self, distances, XX, YY, ysize, lw)</dt><dd><tt>labels are ploted at a location with the smallest<br>
dispersion of the contour from a straight line<br>
unless there's another label nearby, in which case<br>
the second best place on the contour is picked up<br>
if there's no good place a label isplotted at the<br>
beginning of the contour</tt></dd></dl>
<dl><dt><a name="ContourSet-get_label_width"><strong>get_label_width</strong></a>(self, lev, fmt, fsize)</dt><dd><tt>get the width of the label in points</tt></dd></dl>
<dl><dt><a name="ContourSet-get_text"><strong>get_text</strong></a>(self, lev, fmt)</dt><dd><tt>get the text of the label</tt></dd></dl>
<dl><dt><a name="ContourSet-labels"><strong>labels</strong></a>(self, inline)</dt></dl>
<dl><dt><a name="ContourSet-locate_label"><strong>locate_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>find a good place to plot a label (relatively flat<br>
part of the contour) and the angle of rotation for the<br>
text object</tt></dd></dl>
<dl><dt><a name="ContourSet-print_label"><strong>print_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>if contours are too short, don't plot a label</tt></dd></dl>
<dl><dt><a name="ContourSet-set_label_props"><strong>set_label_props</strong></a>(self, label, text, color)</dt><dd><tt>set the label properties - color, fontsize, text</tt></dd></dl>
<dl><dt><a name="ContourSet-too_close"><strong>too_close</strong></a>(self, x, y, lw)</dt><dd><tt>if there's a label already nearby, find a better place</tt></dd></dl>
</td></tr></table></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@