Menu

[r6320]: / trunk / htdocs / matplotlib.contour.html.template  Maximize  Restore  History

Download this file

387 lines (337 with data), 29.3 kB

@header@
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<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/lib64/python2.5/site-packages/matplotlib/contour.py">/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/contour.py</a></font></td></tr></table>
    <p><tt>These&nbsp;are&nbsp;&nbsp;classes&nbsp;to&nbsp;support&nbsp;contour&nbsp;plotting&nbsp;and<br>
labelling&nbsp;for&nbsp;the&nbsp;axes&nbsp;class</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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="numpy.ma.html">numpy.ma</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.path.html">matplotlib.path</a><br>
<a href="matplotlib.text.html">matplotlib.text</a><br>
<a href="matplotlib.ticker.html">matplotlib.ticker</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>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Mixin&nbsp;to&nbsp;provide&nbsp;labelling&nbsp;capability&nbsp;to&nbsp;<a href="#ContourSet">ContourSet</a><br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ContourLabeler-add_label"><strong>add_label</strong></a>(self, x, y, rotation, lev, cvalue)</dt></dl>

<dl><dt><a name="ContourLabeler-calc_label_rot_and_inline"><strong>calc_label_rot_and_inline</strong></a>(self, slc, ind, lw, lc<font color="#909090">=None</font>, spacing<font color="#909090">=5</font>)</dt><dd><tt>This&nbsp;function&nbsp;calculates&nbsp;the&nbsp;appropriate&nbsp;label&nbsp;rotation&nbsp;given<br>
the&nbsp;linecontour&nbsp;coordinates&nbsp;in&nbsp;screen&nbsp;units,&nbsp;the&nbsp;index&nbsp;of&nbsp;the<br>
label&nbsp;location&nbsp;and&nbsp;the&nbsp;label&nbsp;width.<br>
&nbsp;<br>
It&nbsp;will&nbsp;also&nbsp;break&nbsp;contour&nbsp;and&nbsp;calculate&nbsp;inlining&nbsp;if&nbsp;*lc*&nbsp;is<br>
not&nbsp;empty&nbsp;(lc&nbsp;defaults&nbsp;to&nbsp;the&nbsp;empty&nbsp;list&nbsp;if&nbsp;None).&nbsp;&nbsp;*spacing*<br>
is&nbsp;the&nbsp;space&nbsp;around&nbsp;the&nbsp;label&nbsp;in&nbsp;pixels&nbsp;to&nbsp;leave&nbsp;empty.<br>
&nbsp;<br>
Do&nbsp;both&nbsp;of&nbsp;these&nbsp;tasks&nbsp;at&nbsp;once&nbsp;to&nbsp;avoid&nbsp;calling&nbsp;cbook.path_length<br>
multiple&nbsp;times,&nbsp;which&nbsp;is&nbsp;relatively&nbsp;costly.<br>
&nbsp;<br>
The&nbsp;method&nbsp;used&nbsp;here&nbsp;involves&nbsp;calculating&nbsp;the&nbsp;path&nbsp;length<br>
along&nbsp;the&nbsp;contour&nbsp;in&nbsp;pixel&nbsp;coordinates&nbsp;and&nbsp;then&nbsp;looking<br>
approximately&nbsp;label&nbsp;width&nbsp;/&nbsp;2&nbsp;away&nbsp;from&nbsp;central&nbsp;point&nbsp;to<br>
determine&nbsp;rotation&nbsp;and&nbsp;then&nbsp;to&nbsp;break&nbsp;contour&nbsp;if&nbsp;desired.</tt></dd></dl>

<dl><dt><a name="ContourLabeler-clabel"><strong>clabel</strong></a>(self, *args, **kwargs)</dt><dd><tt>call&nbsp;signature::<br>
&nbsp;<br>
&nbsp;&nbsp;<a href="#ContourLabeler-clabel">clabel</a>(cs,&nbsp;**kwargs)<br>
&nbsp;<br>
adds&nbsp;labels&nbsp;to&nbsp;line&nbsp;contours&nbsp;in&nbsp;*cs*,&nbsp;where&nbsp;*cs*&nbsp;is&nbsp;a<br>
:class:`~matplotlib.contour.<a href="#ContourSet">ContourSet</a>`&nbsp;object&nbsp;returned&nbsp;by<br>
contour.<br>
&nbsp;<br>
::<br>
&nbsp;<br>
&nbsp;&nbsp;<a href="#ContourLabeler-clabel">clabel</a>(cs,&nbsp;v,&nbsp;**kwargs)<br>
&nbsp;<br>
only&nbsp;labels&nbsp;contours&nbsp;listed&nbsp;in&nbsp;*v*.<br>
&nbsp;<br>
Optional&nbsp;keyword&nbsp;arguments:<br>
&nbsp;<br>
&nbsp;&nbsp;*fontsize*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;<a href="http://matplotlib.sf.net/fonts.html">http://matplotlib.sf.net/fonts.html</a><br>
&nbsp;<br>
..&nbsp;TODO:&nbsp;Update&nbsp;this&nbsp;link&nbsp;to&nbsp;new&nbsp;fonts&nbsp;document<br>
&nbsp;<br>
&nbsp;&nbsp;*colors*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;if&nbsp;*None*,&nbsp;the&nbsp;color&nbsp;of&nbsp;each&nbsp;label&nbsp;matches&nbsp;the&nbsp;color&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;corresponding&nbsp;contour<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;if&nbsp;one&nbsp;string&nbsp;color,&nbsp;e.g.&nbsp;*colors*&nbsp;=&nbsp;'r'&nbsp;or&nbsp;*colors*&nbsp;=<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'red',&nbsp;all&nbsp;labels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;in&nbsp;this&nbsp;color<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;if&nbsp;a&nbsp;tuple&nbsp;of&nbsp;matplotlib&nbsp;color&nbsp;args&nbsp;(string,&nbsp;float,&nbsp;rgb,&nbsp;etc),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;different&nbsp;labels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;in&nbsp;different&nbsp;colors&nbsp;in&nbsp;the&nbsp;order<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;specified<br>
&nbsp;<br>
&nbsp;&nbsp;*inline*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;controls&nbsp;whether&nbsp;the&nbsp;underlying&nbsp;contour&nbsp;is&nbsp;removed&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;not.&nbsp;Default&nbsp;is&nbsp;*True*.<br>
&nbsp;<br>
&nbsp;&nbsp;*inline_spacing*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;space&nbsp;in&nbsp;pixels&nbsp;to&nbsp;leave&nbsp;on&nbsp;each&nbsp;side&nbsp;of&nbsp;label&nbsp;when<br>
&nbsp;&nbsp;&nbsp;&nbsp;placing&nbsp;inline.&nbsp;&nbsp;Defaults&nbsp;to&nbsp;5.&nbsp;&nbsp;This&nbsp;spacing&nbsp;will&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;exact&nbsp;for&nbsp;labels&nbsp;at&nbsp;locations&nbsp;where&nbsp;the&nbsp;contour&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;straight,&nbsp;less&nbsp;so&nbsp;for&nbsp;labels&nbsp;on&nbsp;curved&nbsp;contours.<br>
&nbsp;<br>
&nbsp;&nbsp;*fmt*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;format&nbsp;string&nbsp;for&nbsp;the&nbsp;label.&nbsp;Default&nbsp;is&nbsp;'%1.3f'<br>
&nbsp;&nbsp;&nbsp;&nbsp;Alternatively,&nbsp;this&nbsp;can&nbsp;be&nbsp;a&nbsp;dictionary&nbsp;matching&nbsp;contour<br>
&nbsp;&nbsp;&nbsp;&nbsp;levels&nbsp;with&nbsp;arbitrary&nbsp;strings&nbsp;to&nbsp;use&nbsp;for&nbsp;each&nbsp;contour&nbsp;level<br>
&nbsp;&nbsp;&nbsp;&nbsp;(i.e.,&nbsp;fmt[level]=string)<br>
&nbsp;<br>
&nbsp;&nbsp;*manual*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;*True*,&nbsp;contour&nbsp;labels&nbsp;will&nbsp;be&nbsp;placed&nbsp;manually&nbsp;using<br>
&nbsp;&nbsp;&nbsp;&nbsp;mouse&nbsp;clicks.&nbsp;&nbsp;Click&nbsp;the&nbsp;first&nbsp;button&nbsp;near&nbsp;a&nbsp;contour&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;add&nbsp;a&nbsp;label,&nbsp;click&nbsp;the&nbsp;second&nbsp;button&nbsp;(or&nbsp;potentially&nbsp;both<br>
&nbsp;&nbsp;&nbsp;&nbsp;mouse&nbsp;buttons&nbsp;at&nbsp;once)&nbsp;to&nbsp;finish&nbsp;adding&nbsp;labels.&nbsp;&nbsp;The&nbsp;third<br>
&nbsp;&nbsp;&nbsp;&nbsp;button&nbsp;can&nbsp;be&nbsp;used&nbsp;to&nbsp;remove&nbsp;the&nbsp;last&nbsp;label&nbsp;added,&nbsp;but<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;if&nbsp;labels&nbsp;are&nbsp;not&nbsp;inline.</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&nbsp;are&nbsp;ploted&nbsp;at&nbsp;a&nbsp;location&nbsp;with&nbsp;the&nbsp;smallest<br>
dispersion&nbsp;of&nbsp;the&nbsp;contour&nbsp;from&nbsp;a&nbsp;straight&nbsp;line<br>
unless&nbsp;there's&nbsp;another&nbsp;label&nbsp;nearby,&nbsp;in&nbsp;which&nbsp;case<br>
the&nbsp;second&nbsp;best&nbsp;place&nbsp;on&nbsp;the&nbsp;contour&nbsp;is&nbsp;picked&nbsp;up<br>
if&nbsp;there's&nbsp;no&nbsp;good&nbsp;place&nbsp;a&nbsp;label&nbsp;isplotted&nbsp;at&nbsp;the<br>
beginning&nbsp;of&nbsp;the&nbsp;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&nbsp;the&nbsp;width&nbsp;of&nbsp;the&nbsp;label&nbsp;in&nbsp;points</tt></dd></dl>

<dl><dt><a name="ContourLabeler-get_real_label_width"><strong>get_real_label_width</strong></a>(self, lev, fmt, fsize)</dt><dd><tt>This&nbsp;computes&nbsp;actual&nbsp;onscreen&nbsp;label&nbsp;width.<br>
This&nbsp;uses&nbsp;some&nbsp;black&nbsp;magic&nbsp;to&nbsp;determine&nbsp;onscreen&nbsp;extent&nbsp;of&nbsp;non-drawn<br>
label.&nbsp;&nbsp;This&nbsp;magic&nbsp;may&nbsp;not&nbsp;be&nbsp;very&nbsp;robust.</tt></dd></dl>

<dl><dt><a name="ContourLabeler-get_text"><strong>get_text</strong></a>(self, lev, fmt)</dt><dd><tt>get&nbsp;the&nbsp;text&nbsp;of&nbsp;the&nbsp;label</tt></dd></dl>

<dl><dt><a name="ContourLabeler-labels"><strong>labels</strong></a>(self, inline, inline_spacing)</dt></dl>

<dl><dt><a name="ContourLabeler-locate_label"><strong>locate_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>find&nbsp;a&nbsp;good&nbsp;place&nbsp;to&nbsp;plot&nbsp;a&nbsp;label&nbsp;(relatively&nbsp;flat<br>
part&nbsp;of&nbsp;the&nbsp;contour)&nbsp;and&nbsp;the&nbsp;angle&nbsp;of&nbsp;rotation&nbsp;for&nbsp;the<br>
text&nbsp;object</tt></dd></dl>

<dl><dt><a name="ContourLabeler-pop_label"><strong>pop_label</strong></a>(self, index<font color="#909090">=-1</font>)</dt><dd><tt>Defaults&nbsp;to&nbsp;removing&nbsp;last&nbsp;label,&nbsp;but&nbsp;any&nbsp;index&nbsp;can&nbsp;be&nbsp;supplied</tt></dd></dl>

<dl><dt><a name="ContourLabeler-print_label"><strong>print_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>if&nbsp;contours&nbsp;are&nbsp;too&nbsp;short,&nbsp;don't&nbsp;plot&nbsp;a&nbsp;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&nbsp;the&nbsp;label&nbsp;properties&nbsp;-&nbsp;color,&nbsp;fontsize,&nbsp;text</tt></dd></dl>

<dl><dt><a name="ContourLabeler-too_close"><strong>too_close</strong></a>(self, x, y, lw)</dt><dd><tt>if&nbsp;there's&nbsp;a&nbsp;label&nbsp;already&nbsp;nearby,&nbsp;find&nbsp;a&nbsp;better&nbsp;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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Create&nbsp;and&nbsp;store&nbsp;a&nbsp;set&nbsp;of&nbsp;contour&nbsp;lines&nbsp;or&nbsp;filled&nbsp;regions.<br>
&nbsp;<br>
User-callable&nbsp;method:&nbsp;clabel<br>
&nbsp;<br>
Useful&nbsp;attributes:<br>
&nbsp;&nbsp;ax:<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;axes&nbsp;object&nbsp;in&nbsp;which&nbsp;the&nbsp;contours&nbsp;are&nbsp;drawn<br>
&nbsp;&nbsp;collections:<br>
&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;silent_list&nbsp;of&nbsp;LineCollections&nbsp;or&nbsp;PolyCollections<br>
&nbsp;&nbsp;levels:<br>
&nbsp;&nbsp;&nbsp;&nbsp;contour&nbsp;levels<br>
&nbsp;&nbsp;layers:<br>
&nbsp;&nbsp;&nbsp;&nbsp;same&nbsp;as&nbsp;levels&nbsp;for&nbsp;line&nbsp;contours;&nbsp;half-way&nbsp;between<br>
&nbsp;&nbsp;&nbsp;&nbsp;levels&nbsp;for&nbsp;filled&nbsp;contours.&nbsp;&nbsp;See&nbsp;_process_colors&nbsp;method.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</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&nbsp;contour&nbsp;lines&nbsp;or&nbsp;filled&nbsp;regions,&nbsp;depending&nbsp;on<br>
whether&nbsp;keyword&nbsp;arg&nbsp;'filled'&nbsp;is&nbsp;False&nbsp;(default)&nbsp;or&nbsp;True.<br>
&nbsp;<br>
The&nbsp;first&nbsp;argument&nbsp;of&nbsp;the&nbsp;initializer&nbsp;must&nbsp;be&nbsp;an&nbsp;axes<br>
object.&nbsp;&nbsp;The&nbsp;remaining&nbsp;arguments&nbsp;and&nbsp;keyword&nbsp;arguments<br>
are&nbsp;described&nbsp;in&nbsp;<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-find_nearest_contour"><strong>find_nearest_contour</strong></a>(self, x, y, indices<font color="#909090">=None</font>, pixel<font color="#909090">=True</font>)</dt><dd><tt>Finds&nbsp;contour&nbsp;that&nbsp;is&nbsp;closest&nbsp;to&nbsp;a&nbsp;point.&nbsp;&nbsp;Defaults&nbsp;to<br>
measuring&nbsp;distance&nbsp;in&nbsp;pixels&nbsp;(screen&nbsp;space&nbsp;-&nbsp;useful&nbsp;for&nbsp;manual<br>
contour&nbsp;labeling),&nbsp;but&nbsp;this&nbsp;can&nbsp;be&nbsp;controlled&nbsp;via&nbsp;a&nbsp;keyword<br>
argument.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;tuple&nbsp;containing&nbsp;the&nbsp;contour,&nbsp;segment,&nbsp;index&nbsp;of<br>
segment,&nbsp;x&nbsp;&amp;&nbsp;y&nbsp;of&nbsp;segment&nbsp;point&nbsp;and&nbsp;distance&nbsp;to&nbsp;minimum&nbsp;point.<br>
&nbsp;<br>
Call&nbsp;signature::<br>
&nbsp;<br>
conmin,segmin,imin,xmin,ymin,dmin&nbsp;=&nbsp;<a href="#ContourSet-find_nearest_contour">find_nearest_contour</a>(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self,&nbsp;x,&nbsp;y,&nbsp;indices=None,&nbsp;pixel=True&nbsp;)<br>
&nbsp;<br>
Optional&nbsp;keyword&nbsp;arguments::<br>
&nbsp;<br>
*indices*:<br>
&nbsp;&nbsp;&nbsp;Indexes&nbsp;of&nbsp;contour&nbsp;levels&nbsp;to&nbsp;consider&nbsp;when&nbsp;looking&nbsp;for<br>
&nbsp;&nbsp;&nbsp;nearest&nbsp;point.&nbsp;&nbsp;Defaults&nbsp;to&nbsp;using&nbsp;all&nbsp;levels.<br>
&nbsp;<br>
*pixel*:<br>
&nbsp;&nbsp;&nbsp;If&nbsp;*True*,&nbsp;measure&nbsp;distance&nbsp;in&nbsp;pixel&nbsp;space,&nbsp;if&nbsp;not,&nbsp;measure<br>
&nbsp;&nbsp;&nbsp;distance&nbsp;in&nbsp;axes&nbsp;space.&nbsp;&nbsp;Defaults&nbsp;to&nbsp;*True*.</tt></dd></dl>

<dl><dt><a name="ContourSet-get_alpha"><strong>get_alpha</strong></a>(self)</dt><dd><tt>returns&nbsp;alpha&nbsp;to&nbsp;be&nbsp;applied&nbsp;to&nbsp;all&nbsp;<a href="#ContourSet">ContourSet</a>&nbsp;artists</tt></dd></dl>

<dl><dt><a name="ContourSet-set_alpha"><strong>set_alpha</strong></a>(self, alpha)</dt><dd><tt>sets&nbsp;alpha&nbsp;for&nbsp;all&nbsp;<a href="#ContourSet">ContourSet</a>&nbsp;artists</tt></dd></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>contour_doc</strong> = '<font color="#c040c0">\n</font>        :func:`~matplotlib.pyplot.contour` and<font color="#c040c0">\n</font>...le:**<font color="#c040c0">\n\n</font>        .. plot:: contour_demo.py<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&nbsp;an&nbsp;entry&nbsp;to&nbsp;a&nbsp;dictionary&nbsp;of&nbsp;boolean&nbsp;flags<br>
that&nbsp;are&nbsp;set&nbsp;to&nbsp;True&nbsp;when&nbsp;the&nbsp;mappable&nbsp;is&nbsp;changed.</tt></dd></dl>

<dl><dt><a name="ContourSet-autoscale"><strong>autoscale</strong></a>(self)</dt><dd><tt>Autoscale&nbsp;the&nbsp;scalar&nbsp;limits&nbsp;on&nbsp;the&nbsp;norm&nbsp;instance&nbsp;using&nbsp;the<br>
current&nbsp;array</tt></dd></dl>

<dl><dt><a name="ContourSet-autoscale_None"><strong>autoscale_None</strong></a>(self)</dt><dd><tt>Autoscale&nbsp;the&nbsp;scalar&nbsp;limits&nbsp;on&nbsp;the&nbsp;norm&nbsp;instance&nbsp;using&nbsp;the<br>
current&nbsp;array,&nbsp;changing&nbsp;only&nbsp;limits&nbsp;that&nbsp;are&nbsp;None</tt></dd></dl>

<dl><dt><a name="ContourSet-check_update"><strong>check_update</strong></a>(self, checker)</dt><dd><tt>If&nbsp;mappable&nbsp;has&nbsp;changed&nbsp;since&nbsp;the&nbsp;last&nbsp;check,<br>
return&nbsp;True;&nbsp;else&nbsp;return&nbsp;False</tt></dd></dl>

<dl><dt><a name="ContourSet-get_array"><strong>get_array</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;array</tt></dd></dl>

<dl><dt><a name="ContourSet-get_clim"><strong>get_clim</strong></a>(self)</dt><dd><tt>return&nbsp;the&nbsp;min,&nbsp;max&nbsp;of&nbsp;the&nbsp;color&nbsp;limits&nbsp;for&nbsp;image&nbsp;scaling</tt></dd></dl>

<dl><dt><a name="ContourSet-get_cmap"><strong>get_cmap</strong></a>(self)</dt><dd><tt>return&nbsp;the&nbsp;colormap</tt></dd></dl>

<dl><dt><a name="ContourSet-set_array"><strong>set_array</strong></a>(self, A)</dt><dd><tt>Set&nbsp;the&nbsp;image&nbsp;array&nbsp;from&nbsp;numpy&nbsp;array&nbsp;*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&nbsp;the&nbsp;norm&nbsp;limits&nbsp;for&nbsp;image&nbsp;scaling;&nbsp;if&nbsp;*vmin*&nbsp;is&nbsp;a&nbsp;length2<br>
sequence,&nbsp;interpret&nbsp;it&nbsp;as&nbsp;``(vmin,&nbsp;vmax)``&nbsp;which&nbsp;is&nbsp;used&nbsp;to<br>
support&nbsp;setp<br>
&nbsp;<br>
ACCEPTS:&nbsp;a&nbsp;length&nbsp;2&nbsp;sequence&nbsp;of&nbsp;floats</tt></dd></dl>

<dl><dt><a name="ContourSet-set_cmap"><strong>set_cmap</strong></a>(self, cmap)</dt><dd><tt>set&nbsp;the&nbsp;colormap&nbsp;for&nbsp;luminance&nbsp;data<br>
&nbsp;<br>
ACCEPTS:&nbsp;a&nbsp;colormap</tt></dd></dl>

<dl><dt><a name="ContourSet-set_colorbar"><strong>set_colorbar</strong></a>(self, im, ax)</dt><dd><tt>set&nbsp;the&nbsp;colorbar&nbsp;image&nbsp;and&nbsp;axes&nbsp;associated&nbsp;with&nbsp;mappable</tt></dd></dl>

<dl><dt><a name="ContourSet-set_norm"><strong>set_norm</strong></a>(self, norm)</dt><dd><tt>set&nbsp;the&nbsp;normalization&nbsp;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&nbsp;a&nbsp;normalized&nbsp;rgba&nbsp;array&nbsp;corresponding&nbsp;to&nbsp;*x*.&nbsp;If&nbsp;*x*<br>
is&nbsp;already&nbsp;an&nbsp;rgb&nbsp;array,&nbsp;insert&nbsp;*alpha*;&nbsp;if&nbsp;it&nbsp;is&nbsp;already<br>
rgba,&nbsp;return&nbsp;it&nbsp;unchanged.&nbsp;If&nbsp;*bytes*&nbsp;is&nbsp;True,&nbsp;return&nbsp;rgba&nbsp;as<br>
4&nbsp;uint8s&nbsp;instead&nbsp;of&nbsp;4&nbsp;floats.</tt></dd></dl>

<hr>
Methods inherited from <a href="matplotlib.contour.html#ContourLabeler">ContourLabeler</a>:<br>
<dl><dt><a name="ContourSet-add_label"><strong>add_label</strong></a>(self, x, y, rotation, lev, cvalue)</dt></dl>

<dl><dt><a name="ContourSet-calc_label_rot_and_inline"><strong>calc_label_rot_and_inline</strong></a>(self, slc, ind, lw, lc<font color="#909090">=None</font>, spacing<font color="#909090">=5</font>)</dt><dd><tt>This&nbsp;function&nbsp;calculates&nbsp;the&nbsp;appropriate&nbsp;label&nbsp;rotation&nbsp;given<br>
the&nbsp;linecontour&nbsp;coordinates&nbsp;in&nbsp;screen&nbsp;units,&nbsp;the&nbsp;index&nbsp;of&nbsp;the<br>
label&nbsp;location&nbsp;and&nbsp;the&nbsp;label&nbsp;width.<br>
&nbsp;<br>
It&nbsp;will&nbsp;also&nbsp;break&nbsp;contour&nbsp;and&nbsp;calculate&nbsp;inlining&nbsp;if&nbsp;*lc*&nbsp;is<br>
not&nbsp;empty&nbsp;(lc&nbsp;defaults&nbsp;to&nbsp;the&nbsp;empty&nbsp;list&nbsp;if&nbsp;None).&nbsp;&nbsp;*spacing*<br>
is&nbsp;the&nbsp;space&nbsp;around&nbsp;the&nbsp;label&nbsp;in&nbsp;pixels&nbsp;to&nbsp;leave&nbsp;empty.<br>
&nbsp;<br>
Do&nbsp;both&nbsp;of&nbsp;these&nbsp;tasks&nbsp;at&nbsp;once&nbsp;to&nbsp;avoid&nbsp;calling&nbsp;cbook.path_length<br>
multiple&nbsp;times,&nbsp;which&nbsp;is&nbsp;relatively&nbsp;costly.<br>
&nbsp;<br>
The&nbsp;method&nbsp;used&nbsp;here&nbsp;involves&nbsp;calculating&nbsp;the&nbsp;path&nbsp;length<br>
along&nbsp;the&nbsp;contour&nbsp;in&nbsp;pixel&nbsp;coordinates&nbsp;and&nbsp;then&nbsp;looking<br>
approximately&nbsp;label&nbsp;width&nbsp;/&nbsp;2&nbsp;away&nbsp;from&nbsp;central&nbsp;point&nbsp;to<br>
determine&nbsp;rotation&nbsp;and&nbsp;then&nbsp;to&nbsp;break&nbsp;contour&nbsp;if&nbsp;desired.</tt></dd></dl>

<dl><dt><a name="ContourSet-clabel"><strong>clabel</strong></a>(self, *args, **kwargs)</dt><dd><tt>call&nbsp;signature::<br>
&nbsp;<br>
&nbsp;&nbsp;<a href="#ContourSet-clabel">clabel</a>(cs,&nbsp;**kwargs)<br>
&nbsp;<br>
adds&nbsp;labels&nbsp;to&nbsp;line&nbsp;contours&nbsp;in&nbsp;*cs*,&nbsp;where&nbsp;*cs*&nbsp;is&nbsp;a<br>
:class:`~matplotlib.contour.<a href="#ContourSet">ContourSet</a>`&nbsp;object&nbsp;returned&nbsp;by<br>
contour.<br>
&nbsp;<br>
::<br>
&nbsp;<br>
&nbsp;&nbsp;<a href="#ContourSet-clabel">clabel</a>(cs,&nbsp;v,&nbsp;**kwargs)<br>
&nbsp;<br>
only&nbsp;labels&nbsp;contours&nbsp;listed&nbsp;in&nbsp;*v*.<br>
&nbsp;<br>
Optional&nbsp;keyword&nbsp;arguments:<br>
&nbsp;<br>
&nbsp;&nbsp;*fontsize*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;<a href="http://matplotlib.sf.net/fonts.html">http://matplotlib.sf.net/fonts.html</a><br>
&nbsp;<br>
..&nbsp;TODO:&nbsp;Update&nbsp;this&nbsp;link&nbsp;to&nbsp;new&nbsp;fonts&nbsp;document<br>
&nbsp;<br>
&nbsp;&nbsp;*colors*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;if&nbsp;*None*,&nbsp;the&nbsp;color&nbsp;of&nbsp;each&nbsp;label&nbsp;matches&nbsp;the&nbsp;color&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;corresponding&nbsp;contour<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;if&nbsp;one&nbsp;string&nbsp;color,&nbsp;e.g.&nbsp;*colors*&nbsp;=&nbsp;'r'&nbsp;or&nbsp;*colors*&nbsp;=<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'red',&nbsp;all&nbsp;labels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;in&nbsp;this&nbsp;color<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;if&nbsp;a&nbsp;tuple&nbsp;of&nbsp;matplotlib&nbsp;color&nbsp;args&nbsp;(string,&nbsp;float,&nbsp;rgb,&nbsp;etc),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;different&nbsp;labels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;in&nbsp;different&nbsp;colors&nbsp;in&nbsp;the&nbsp;order<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;specified<br>
&nbsp;<br>
&nbsp;&nbsp;*inline*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;controls&nbsp;whether&nbsp;the&nbsp;underlying&nbsp;contour&nbsp;is&nbsp;removed&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;not.&nbsp;Default&nbsp;is&nbsp;*True*.<br>
&nbsp;<br>
&nbsp;&nbsp;*inline_spacing*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;space&nbsp;in&nbsp;pixels&nbsp;to&nbsp;leave&nbsp;on&nbsp;each&nbsp;side&nbsp;of&nbsp;label&nbsp;when<br>
&nbsp;&nbsp;&nbsp;&nbsp;placing&nbsp;inline.&nbsp;&nbsp;Defaults&nbsp;to&nbsp;5.&nbsp;&nbsp;This&nbsp;spacing&nbsp;will&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;exact&nbsp;for&nbsp;labels&nbsp;at&nbsp;locations&nbsp;where&nbsp;the&nbsp;contour&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;straight,&nbsp;less&nbsp;so&nbsp;for&nbsp;labels&nbsp;on&nbsp;curved&nbsp;contours.<br>
&nbsp;<br>
&nbsp;&nbsp;*fmt*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;format&nbsp;string&nbsp;for&nbsp;the&nbsp;label.&nbsp;Default&nbsp;is&nbsp;'%1.3f'<br>
&nbsp;&nbsp;&nbsp;&nbsp;Alternatively,&nbsp;this&nbsp;can&nbsp;be&nbsp;a&nbsp;dictionary&nbsp;matching&nbsp;contour<br>
&nbsp;&nbsp;&nbsp;&nbsp;levels&nbsp;with&nbsp;arbitrary&nbsp;strings&nbsp;to&nbsp;use&nbsp;for&nbsp;each&nbsp;contour&nbsp;level<br>
&nbsp;&nbsp;&nbsp;&nbsp;(i.e.,&nbsp;fmt[level]=string)<br>
&nbsp;<br>
&nbsp;&nbsp;*manual*:<br>
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;*True*,&nbsp;contour&nbsp;labels&nbsp;will&nbsp;be&nbsp;placed&nbsp;manually&nbsp;using<br>
&nbsp;&nbsp;&nbsp;&nbsp;mouse&nbsp;clicks.&nbsp;&nbsp;Click&nbsp;the&nbsp;first&nbsp;button&nbsp;near&nbsp;a&nbsp;contour&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;add&nbsp;a&nbsp;label,&nbsp;click&nbsp;the&nbsp;second&nbsp;button&nbsp;(or&nbsp;potentially&nbsp;both<br>
&nbsp;&nbsp;&nbsp;&nbsp;mouse&nbsp;buttons&nbsp;at&nbsp;once)&nbsp;to&nbsp;finish&nbsp;adding&nbsp;labels.&nbsp;&nbsp;The&nbsp;third<br>
&nbsp;&nbsp;&nbsp;&nbsp;button&nbsp;can&nbsp;be&nbsp;used&nbsp;to&nbsp;remove&nbsp;the&nbsp;last&nbsp;label&nbsp;added,&nbsp;but<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;if&nbsp;labels&nbsp;are&nbsp;not&nbsp;inline.</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&nbsp;are&nbsp;ploted&nbsp;at&nbsp;a&nbsp;location&nbsp;with&nbsp;the&nbsp;smallest<br>
dispersion&nbsp;of&nbsp;the&nbsp;contour&nbsp;from&nbsp;a&nbsp;straight&nbsp;line<br>
unless&nbsp;there's&nbsp;another&nbsp;label&nbsp;nearby,&nbsp;in&nbsp;which&nbsp;case<br>
the&nbsp;second&nbsp;best&nbsp;place&nbsp;on&nbsp;the&nbsp;contour&nbsp;is&nbsp;picked&nbsp;up<br>
if&nbsp;there's&nbsp;no&nbsp;good&nbsp;place&nbsp;a&nbsp;label&nbsp;isplotted&nbsp;at&nbsp;the<br>
beginning&nbsp;of&nbsp;the&nbsp;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&nbsp;the&nbsp;width&nbsp;of&nbsp;the&nbsp;label&nbsp;in&nbsp;points</tt></dd></dl>

<dl><dt><a name="ContourSet-get_real_label_width"><strong>get_real_label_width</strong></a>(self, lev, fmt, fsize)</dt><dd><tt>This&nbsp;computes&nbsp;actual&nbsp;onscreen&nbsp;label&nbsp;width.<br>
This&nbsp;uses&nbsp;some&nbsp;black&nbsp;magic&nbsp;to&nbsp;determine&nbsp;onscreen&nbsp;extent&nbsp;of&nbsp;non-drawn<br>
label.&nbsp;&nbsp;This&nbsp;magic&nbsp;may&nbsp;not&nbsp;be&nbsp;very&nbsp;robust.</tt></dd></dl>

<dl><dt><a name="ContourSet-get_text"><strong>get_text</strong></a>(self, lev, fmt)</dt><dd><tt>get&nbsp;the&nbsp;text&nbsp;of&nbsp;the&nbsp;label</tt></dd></dl>

<dl><dt><a name="ContourSet-labels"><strong>labels</strong></a>(self, inline, inline_spacing)</dt></dl>

<dl><dt><a name="ContourSet-locate_label"><strong>locate_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>find&nbsp;a&nbsp;good&nbsp;place&nbsp;to&nbsp;plot&nbsp;a&nbsp;label&nbsp;(relatively&nbsp;flat<br>
part&nbsp;of&nbsp;the&nbsp;contour)&nbsp;and&nbsp;the&nbsp;angle&nbsp;of&nbsp;rotation&nbsp;for&nbsp;the<br>
text&nbsp;object</tt></dd></dl>

<dl><dt><a name="ContourSet-pop_label"><strong>pop_label</strong></a>(self, index<font color="#909090">=-1</font>)</dt><dd><tt>Defaults&nbsp;to&nbsp;removing&nbsp;last&nbsp;label,&nbsp;but&nbsp;any&nbsp;index&nbsp;can&nbsp;be&nbsp;supplied</tt></dd></dl>

<dl><dt><a name="ContourSet-print_label"><strong>print_label</strong></a>(self, linecontour, labelwidth)</dt><dd><tt>if&nbsp;contours&nbsp;are&nbsp;too&nbsp;short,&nbsp;don't&nbsp;plot&nbsp;a&nbsp;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&nbsp;the&nbsp;label&nbsp;properties&nbsp;-&nbsp;color,&nbsp;fontsize,&nbsp;text</tt></dd></dl>

<dl><dt><a name="ContourSet-too_close"><strong>too_close</strong></a>(self, x, y, lw)</dt><dd><tt>if&nbsp;there's&nbsp;a&nbsp;label&nbsp;already&nbsp;nearby,&nbsp;find&nbsp;a&nbsp;better&nbsp;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>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>division</strong> = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)</td></tr></table>
@footer@
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.