577 lines (460 with data), 39.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>.transforms</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/transforms.py">/usr/local/lib/python2.3/site-packages/matplotlib/transforms.py</a></font></td></tr></table>
<p><tt>This module contains the newfangled transform class which allows the<br>
placement of artists (lines, patches, text) in a variety of coordinate<br>
systems (display, arbitrary data, relative axes, physical sizes)<br>
<br>
The default <a href="#Transform">Transform</a>() is identity.<br>
<br>
t = <a href="#Transform">Transform</a>()<br>
x == <a href="#Transform">Transform</a>.positions(x) True<br>
x == <a href="#Transform">Transform</a>.scale(x) True<br>
<br>
A linear Transformation is specified by giving a <a href="#Bound1D">Bound1D</a> (min, max)<br>
instance for the domain and range. The transform below maps the<br>
interval [0,1] to [-10,10]<br>
<br>
t = <a href="#Transform">Transform</a>( <a href="#Bound1D">Bound1D</a>(0,1), <a href="#Bound1D">Bound1D</a>(-10,10) )<br>
<br>
Since all Transforms know their inverse function, you can compute an<br>
inverse transformation by calling inverse_positions or inverse_scale<br>
<br>
t = <a href="#Transform">Transform</a>( <a href="#Bound1D">Bound1D</a>(0,1), <a href="#Bound1D">Bound1D</a>(-10,10) )<br>
val = t.inverse_positions(5) # maps [-10,10] to [0,1]<br>
<br>
The difference between 'positions' and 'scale' is that the positions<br>
func is appropriate for locations (eg, x,y) and the scale func is<br>
appropriate for lengths (eg, width, height).<br>
<br>
The <a href="#Bound1D">Bound1D</a> methods provide a number of utility functions: the<br>
interval max-min, determining if a point is in the open or closed<br>
interval, constraining the bound to be positive (useful for log<br>
transforms), and so on. These are useful for storing view, data and<br>
display limits of a given axis.<br>
<br>
The <a href="#Bound2D">Bound2D</a> is a straight-forward generalization of <a href="#Bound1D">Bound1D</a>, and<br>
stores 2 <a href="#Bound1D">Bound1D</a> instances 'x' and 'y' to represent a 2D Bound (useful<br>
for Axes bounding boxes, clipping etc). All Artists are responsible<br>
for returning their extent in display coords as a <a href="#Bound2D">Bound2D</a> instance,<br>
which is useful for determining whether 2 Artists overlap. Some<br>
utility functions, eg, bound2d_all, return the <a href="#Bound2D">Bound2D</a> instance that<br>
bounds all the <a href="#Bound2D">Bound2D</a> instances passed as args. This helps in text<br>
layout, eg, in positioning the axis labels to not overlap the tick<br>
labels.<br>
<br>
The <a href="#Bound1D">Bound1D</a> instances store their max and min values as RWVals<br>
(read/write references). These are mutable scalars that can be shared<br>
among all the figure components. When a figure clas resizes and thus<br>
changes the display limits of an Axes, the Axes and all its components<br>
know about the changes because they store a reference to the<br>
displaylim, not the scalar value of the display lim. Likewise for<br>
DPI.<br>
<br>
Also, it is possible to do simple arithmetic in RRefs via the derived<br>
<a href="#BinOp">BinOp</a> class, which stores both sides of a binary arithmetic operation,<br>
as well as the binary function to return the result of the binop<br>
applied to the dereferenced scalars. This allows you to place artists<br>
with locations like '3 centimenters below the x axis'<br>
<br>
Here are some concepts and how to apply them via the transform<br>
architecture<br>
<br>
* Map view limits to display limits via a linear tranformation<br>
<br>
# viewlim and displaylim are <a href="#Bound1D">Bound1D</a> instances<br>
tx = <a href="#Transform">Transform</a>( axes.xaxis.viewlim, axes.xaxis.displaylim )<br>
ty = <a href="#Transform">Transform</a>( axes.yaxis.viewlim, axes.yaxis.displaylim )<br>
l = Line2D(dpi, bbox, xdata, ydata, transx=tx, transy=ty)<br>
<br>
* Map relative axes coords ( 0,0 is lower left and 1,1 is upper<br>
right ) to display coords. This example puts text in the middle<br>
of the axes (0.5, 0.5)<br>
<br>
tx = <a href="#Transform">Transform</a>( <a href="#Bound1D">Bound1D</a>(0,1), axes.xaxis.displaylim )<br>
ty = <a href="#Transform">Transform</a>( <a href="#Bound1D">Bound1D</a>(0,1), axes.yaxis.displaylim )<br>
text = AxisText(dpi, bbox, 0.5, 0.5, transx=tx, transy=ty)<br>
<br>
* Map x view limits to display limits via a log transformation and y<br>
view limits via linear transform. The funcs pair is the<br>
transform/inverse pair<br>
<br>
funcs = logwarn, pow10<br>
tx = <a href="#Transform">Transform</a>( axes.xaxis.viewlim, axes.xaxis.displaylim, funcs )<br>
ty = <a href="#Transform">Transform</a>( axes.yaxis.viewlim, axes.yaxis.displaylim )<br>
l = Line2D(dpi, bbox, xdata, ydata, transx=tx, transy=ty)<br>
<br>
* You can also do transformation from one physical scale (inches, cm,<br>
points, ...) to another. You need to specify an offset in output<br>
coords.<br>
<br>
offset = 100 # dots<br>
cm = <a href="#Centimeter">Centimeter</a>( self.<strong>dpi</strong>)<br>
dots = <a href="#Dots">Dots</a>( self.<strong>dpi</strong>)<br>
t = <a href="#TransformSize">TransformSize</a>(cm, dots, offset)<br>
<br>
If you don't know the offset in output coords, you can supply an<br>
optional transform to transform the offset to output coords. Eg,<br>
if you want to offset by x in data coords, and the output is<br>
display coords, you can do<br>
<br>
offset = 0.2 # x data coords<br>
cm = <a href="#Centimeter">Centimeter</a>( self.<strong>dpi</strong>)<br>
dots = <a href="#Dots">Dots</a>( self.<strong>dpi</strong>)<br>
t = <a href="#TransformSize">TransformSize</a>(cm, dots, offset, axes.xaxis.transData)<br>
<br>
* Combining the above, we can specify that a text instance is at an x<br>
location in data coords and a y location in points relative to an<br>
axis. Eg. the transformation below indicates that the x value of<br>
an xticklabel position is in data coordinates and the y value is 3<br>
points below the x axis, top justified<br>
<br>
# the top of the x ticklabel text is the bottom of the y axis<br>
# minus 3 points. Note the code below uses the overloading of<br>
# __sub__ and __mul__ to return a <a href="#BinOp">BinOp</a>. Changes in the<br>
# position of bbox.y or dpi, eg, on a resize event, are<br>
# automagically reflected in the tick label position.<br>
# dpi*3/72 converts 3 points to dots.<br>
<br>
top = self.<strong>bbox</strong>.y.get_refmin() - self.<strong>dpi</strong>*<a href="#RRef">RRef</a>(3/72.0)<br>
text = backends.AxisText(dpi, bbox, x=xdata, y=top, <br>
verticalalignment='top',<br>
horizontalalignment='center',<br>
transx = self.<strong>axes</strong>.xaxis.transData,<br>
# transy is default, identity transform)<br>
<br>
The unittest code for the transforms module is unit/transforms_unit.py</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.transforms.html#Bound1D">Bound1D</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Bound2D">Bound2D</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#RRef">RRef</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#BinOp">BinOp</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#RWRef">RWRef</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Size">Size</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Centimeter">Centimeter</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Dots">Dots</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Inches">Inches</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Millimeter">Millimeter</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Points">Points</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#Transform">Transform</a>
</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.transforms.html#TransformSize">TransformSize</a>
</font></dt></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="BinOp">class <strong>BinOp</strong></a>(<a href="matplotlib.transforms.html#RRef">RRef</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A read only ref that handles binary ops of refs<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="BinOp-__init__"><strong>__init__</strong></a>(self, ref1, ref2, func<font color="#909090">=<function binadd></font>)</dt></dl>
<dl><dt><a name="BinOp-get"><strong>get</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.transforms.html#RRef">RRef</a>:<br>
<dl><dt><a name="BinOp-__add__"><strong>__add__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="BinOp-__mul__"><strong>__mul__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="BinOp-__rmul__"><strong>__rmul__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="BinOp-__sub__"><strong>__sub__</strong></a>(self, other)</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="Bound1D">class <strong>Bound1D</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Store and update information about a 1D bound<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Bound1D-__init__"><strong>__init__</strong></a>(self, minval<font color="#909090">=None</font>, maxval<font color="#909090">=None</font>, isPos<font color="#909090">=False</font>)</dt></dl>
<dl><dt><a name="Bound1D-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Bound1D-bounds"><strong>bounds</strong></a>(self)</dt><dd><tt>Return the min, max of the bounds</tt></dd></dl>
<dl><dt><a name="Bound1D-defined"><strong>defined</strong></a>(self)</dt><dd><tt>return true if both endpoints defined</tt></dd></dl>
<dl><dt><a name="Bound1D-get_refmax"><strong>get_refmax</strong></a>(self)</dt></dl>
<dl><dt><a name="Bound1D-get_refmin"><strong>get_refmin</strong></a>(self)</dt></dl>
<dl><dt><a name="Bound1D-in_interval"><strong>in_interval</strong></a>(self, val)</dt><dd><tt>Return true if val is in [min,max]</tt></dd></dl>
<dl><dt><a name="Bound1D-in_open_interval"><strong>in_open_interval</strong></a>(self, val)</dt><dd><tt>Return true if val is in (min,max)</tt></dd></dl>
<dl><dt><a name="Bound1D-interval"><strong>interval</strong></a>(self)</dt><dd><tt>return max - min if defined, else None</tt></dd></dl>
<dl><dt><a name="Bound1D-is_positive"><strong>is_positive</strong></a>(self, b)</dt><dd><tt>If true, bound will only return positive endpoints.</tt></dd></dl>
<dl><dt><a name="Bound1D-max"><strong>max</strong></a>(self)</dt><dd><tt>return the max of the bounds</tt></dd></dl>
<dl><dt><a name="Bound1D-min"><strong>min</strong></a>(self)</dt><dd><tt>return the min of the bounds</tt></dd></dl>
<dl><dt><a name="Bound1D-overlap"><strong>overlap</strong></a>(self, bound)</dt><dd><tt>Return true if bound overlaps with self.<br>
<br>
Return False if either bound undefined</tt></dd></dl>
<dl><dt><a name="Bound1D-scale"><strong>scale</strong></a>(self, s)</dt><dd><tt>scale the min and max by ratio s and return a reference to self</tt></dd></dl>
<dl><dt><a name="Bound1D-set_bounds"><strong>set_bounds</strong></a>(self, vmin, vmax)</dt><dd><tt>set the min and max to vmin, vmax</tt></dd></dl>
<dl><dt><a name="Bound1D-set_max"><strong>set_max</strong></a>(self, vmax)</dt><dd><tt>set the max to vmax</tt></dd></dl>
<dl><dt><a name="Bound1D-set_min"><strong>set_min</strong></a>(self, vmin)</dt></dl>
<dl><dt><a name="Bound1D-shift"><strong>shift</strong></a>(self, val)</dt><dd><tt>Shift min and max by val and return a reference to self</tt></dd></dl>
<dl><dt><a name="Bound1D-update"><strong>update</strong></a>(self, x)</dt><dd><tt>Update the min and max with values in x. Eg, only update min<br>
if <a href="#Bound1D-min">min</a>(x)<<a href="#Bound1D-min">min</a>(). Return a reference to self</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="Bound2D">class <strong>Bound2D</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Store and update 2D bounding box information<br>
<br>
Publicly accessible attributes<br>
<br>
x the x <a href="#Bound1D">Bound1D</a> instance<br>
y the y <a href="#Bound2D">Bound2D</a> instance<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Bound2D-__init__"><strong>__init__</strong></a>(self, left, bottom, width, height)</dt></dl>
<dl><dt><a name="Bound2D-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Bound2D-copy"><strong>copy</strong></a>(self)</dt><dd><tt>Return a deep copy of self</tt></dd></dl>
<dl><dt><a name="Bound2D-defined"><strong>defined</strong></a>(self)</dt></dl>
<dl><dt><a name="Bound2D-get_bounds"><strong>get_bounds</strong></a>(self)</dt></dl>
<dl><dt><a name="Bound2D-overlap"><strong>overlap</strong></a>(self, bound)</dt><dd><tt>Return true if bound overlaps with self.<br>
<br>
Return False if either bound undefined</tt></dd></dl>
<dl><dt><a name="Bound2D-set_bounds"><strong>set_bounds</strong></a>(self, left, bottom, width, height)</dt><dd><tt>Reset the bounds</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="Centimeter">class <strong>Centimeter</strong></a>(<a href="matplotlib.transforms.html#Size">Size</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Centimeter-to_inches"><strong>to_inches</strong></a>(self)</dt></dl>
<dl><dt><a name="Centimeter-units"><strong>units</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.transforms.html#Size">Size</a>:<br>
<dl><dt><a name="Centimeter-__init__"><strong>__init__</strong></a>(self, dpi, val<font color="#909090">=1</font>)</dt></dl>
<dl><dt><a name="Centimeter-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Centimeter-get"><strong>get</strong></a>(self)</dt></dl>
<dl><dt><a name="Centimeter-set_val"><strong>set_val</strong></a>(self, val)</dt></dl>
<dl><dt><a name="Centimeter-to_dots"><strong>to_dots</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="Dots">class <strong>Dots</strong></a>(<a href="matplotlib.transforms.html#Size">Size</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Dots-to_dots"><strong>to_dots</strong></a>(self)</dt></dl>
<dl><dt><a name="Dots-to_inches"><strong>to_inches</strong></a>(self)</dt></dl>
<dl><dt><a name="Dots-units"><strong>units</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.transforms.html#Size">Size</a>:<br>
<dl><dt><a name="Dots-__init__"><strong>__init__</strong></a>(self, dpi, val<font color="#909090">=1</font>)</dt></dl>
<dl><dt><a name="Dots-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Dots-get"><strong>get</strong></a>(self)</dt></dl>
<dl><dt><a name="Dots-set_val"><strong>set_val</strong></a>(self, val)</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="Inches">class <strong>Inches</strong></a>(<a href="matplotlib.transforms.html#Size">Size</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Inches-to_inches"><strong>to_inches</strong></a>(self)</dt></dl>
<dl><dt><a name="Inches-units"><strong>units</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.transforms.html#Size">Size</a>:<br>
<dl><dt><a name="Inches-__init__"><strong>__init__</strong></a>(self, dpi, val<font color="#909090">=1</font>)</dt></dl>
<dl><dt><a name="Inches-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Inches-get"><strong>get</strong></a>(self)</dt></dl>
<dl><dt><a name="Inches-set_val"><strong>set_val</strong></a>(self, val)</dt></dl>
<dl><dt><a name="Inches-to_dots"><strong>to_dots</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="Millimeter">class <strong>Millimeter</strong></a>(<a href="matplotlib.transforms.html#Size">Size</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Millimeter-to_inches"><strong>to_inches</strong></a>(self)</dt></dl>
<dl><dt><a name="Millimeter-units"><strong>units</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.transforms.html#Size">Size</a>:<br>
<dl><dt><a name="Millimeter-__init__"><strong>__init__</strong></a>(self, dpi, val<font color="#909090">=1</font>)</dt></dl>
<dl><dt><a name="Millimeter-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Millimeter-get"><strong>get</strong></a>(self)</dt></dl>
<dl><dt><a name="Millimeter-set_val"><strong>set_val</strong></a>(self, val)</dt></dl>
<dl><dt><a name="Millimeter-to_dots"><strong>to_dots</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="Points">class <strong>Points</strong></a>(<a href="matplotlib.transforms.html#Size">Size</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Points-to_inches"><strong>to_inches</strong></a>(self)</dt></dl>
<dl><dt><a name="Points-units"><strong>units</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.transforms.html#Size">Size</a>:<br>
<dl><dt><a name="Points-__init__"><strong>__init__</strong></a>(self, dpi, val<font color="#909090">=1</font>)</dt></dl>
<dl><dt><a name="Points-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Points-get"><strong>get</strong></a>(self)</dt></dl>
<dl><dt><a name="Points-set_val"><strong>set_val</strong></a>(self, val)</dt></dl>
<dl><dt><a name="Points-to_dots"><strong>to_dots</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="RRef">class <strong>RRef</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A read only ref<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="RRef-__add__"><strong>__add__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RRef-__init__"><strong>__init__</strong></a>(self, val)</dt></dl>
<dl><dt><a name="RRef-__mul__"><strong>__mul__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RRef-__rmul__"><strong>__rmul__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RRef-__sub__"><strong>__sub__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RRef-get"><strong>get</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="RWRef">class <strong>RWRef</strong></a>(<a href="matplotlib.transforms.html#RRef">RRef</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A readable and writable ref<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="RWRef-set"><strong>set</strong></a>(self, val)</dt></dl>
<hr>
Methods inherited from <a href="matplotlib.transforms.html#RRef">RRef</a>:<br>
<dl><dt><a name="RWRef-__add__"><strong>__add__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RWRef-__init__"><strong>__init__</strong></a>(self, val)</dt></dl>
<dl><dt><a name="RWRef-__mul__"><strong>__mul__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RWRef-__rmul__"><strong>__rmul__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RWRef-__sub__"><strong>__sub__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="RWRef-get"><strong>get</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="Size">class <strong>Size</strong></a></font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Size-__init__"><strong>__init__</strong></a>(self, dpi, val<font color="#909090">=1</font>)</dt></dl>
<dl><dt><a name="Size-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Size-get"><strong>get</strong></a>(self)</dt></dl>
<dl><dt><a name="Size-set_val"><strong>set_val</strong></a>(self, val)</dt></dl>
<dl><dt><a name="Size-to_dots"><strong>to_dots</strong></a>(self)</dt></dl>
<dl><dt><a name="Size-to_inches"><strong>to_inches</strong></a>(self)</dt></dl>
<dl><dt><a name="Size-units"><strong>units</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="Transform">class <strong>Transform</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Abstract base class for transforming data<br>
<br>
Publicly accessible attributes are<br>
func : the transform func<br>
ifunc : the inverse tranform func<br>
<br>
A tranform from in->out is defined by<br>
<br>
scale = (maxout-maxin)/( func(maxin)-func(minin) )<br>
out = scale * ( func(in)-func(minin) ) + minout<br>
<br>
funcs are paired with inverses, allowing Transforms to return<br>
their inverse<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Transform-__init__"><strong>__init__</strong></a>(self, boundin<font color="#909090">=Bound1D: 0 1</font>, boundout<font color="#909090">=Bound1D: 0 1</font>, funcs<font color="#909090">=(<function identity>, <function identity>)</font>)</dt><dd><tt>The default transform is identity.<br>
<br>
To do a linear transform, replace the bounds with the<br>
coodinate bounds of the input and output spaces<br>
<br>
To do a log transform, use funcs=(log10, pow10)</tt></dd></dl>
<dl><dt><a name="Transform-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="Transform-inverse_positions"><strong>inverse_positions</strong></a>(self, x)</dt><dd><tt>Return the inverse transform of x</tt></dd></dl>
<dl><dt><a name="Transform-inverse_scale"><strong>inverse_scale</strong></a>(self, x)</dt><dd><tt>Return the inverse transform of scale x</tt></dd></dl>
<dl><dt><a name="Transform-position_scale"><strong>position_scale</strong></a>(self, pos, scale, isScalarOrArray<font color="#909090">=False</font>)</dt><dd><tt><a href="#Transform">Transform</a> scalar position and scale<br>
<br>
Doing both together reduces duplication of function calls, eg,<br>
for a x position and width if both use same transform<br>
<br>
set isScalarOrArray to True if you know x is a scalar or array<br>
for performace</tt></dd></dl>
<dl><dt><a name="Transform-positions"><strong>positions</strong></a>(self, x, isScalarOrArray<font color="#909090">=False</font>)</dt><dd><tt><a href="#Transform">Transform</a> the positions in x.<br>
<br>
set isScalarOrArray to True if you know x is a scalar or array<br>
for performace</tt></dd></dl>
<dl><dt><a name="Transform-scale"><strong>scale</strong></a>(self, s, isScalarOrArray<font color="#909090">=False</font>)</dt><dd><tt><a href="#Transform">Transform</a> the scale in s<br>
<br>
set isScalarOrArray to True if you know x is a scalar or array<br>
for performace</tt></dd></dl>
<dl><dt><a name="Transform-set_funcs"><strong>set_funcs</strong></a>(self, funcs)</dt><dd><tt>Set the func, ifunc to funcs</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="TransformSize">class <strong>TransformSize</strong></a></font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="TransformSize-__init__"><strong>__init__</strong></a>(self, sin, sout, offset, transOffset<font color="#909090">=Transform: Bound1D: 0 1 to Bound1D: 0 1</font>)</dt><dd><tt>transform size in <a href="#Size">Size</a> instance sin to <a href="#Size">Size</a> instance sout,<br>
offsetting by <a href="#Bound1D">Bound1D</a> instance <a href="#RRef">RRef</a> instance offset.<br>
transOffset is used to transform the offset if not None</tt></dd></dl>
<dl><dt><a name="TransformSize-inverse_positions"><strong>inverse_positions</strong></a>(self, x)</dt></dl>
<dl><dt><a name="TransformSize-inverse_scale"><strong>inverse_scale</strong></a>(self, x)</dt></dl>
<dl><dt><a name="TransformSize-positions"><strong>positions</strong></a>(self, x)</dt></dl>
<dl><dt><a name="TransformSize-scale"><strong>scale</strong></a>(self, x)</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="-binadd"><strong>binadd</strong></a>(x, y)</dt></dl>
<dl><dt><a name="-binsub"><strong>binsub</strong></a>(x, y)</dt></dl>
<dl><dt><a name="-bintimes"><strong>bintimes</strong></a>(x, y)</dt></dl>
<dl><dt><a name="-bound1d_all"><strong>bound1d_all</strong></a>(bounds)</dt><dd><tt>Return a <a href="#Bound1D">Bound1D</a> instance that bounds all the <a href="#Bound1D">Bound1D</a> instances in<br>
sequence bounds.<br>
<br>
If the min or max val for any of the bounds is None, the<br>
respective value for the returned bbox will also be None</tt></dd></dl>
<dl><dt><a name="-bound2d_all"><strong>bound2d_all</strong></a>(bounds)</dt><dd><tt>Return a <a href="#Bound2D">Bound2D</a> instance that bounds all the <a href="#Bound2D">Bound2D</a> instances in<br>
sequence bounds.<br>
<br>
If the min or max val for any of the bounds is None, the<br>
respective value for the returned bbox will also be None</tt></dd></dl>
<dl><dt><a name="-identity"><strong>identity</strong></a>(x)</dt><dd><tt>The identity function</tt></dd></dl>
<dl><dt><a name="-inverse_transform_bound1d"><strong>inverse_transform_bound1d</strong></a>(bound, trans)</dt><dd><tt>Inverse transform a <a href="#Bound1D">Bound1D</a> instance using trans.inverse()</tt></dd></dl>
<dl><dt><a name="-inverse_transform_bound2d"><strong>inverse_transform_bound2d</strong></a>(bbox, transx, transy)</dt><dd><tt>Inverse transform a <a href="#Bound2D">Bound2D</a> instance using transforms transx, transy</tt></dd></dl>
<dl><dt><a name="-iterable_to_array"><strong>iterable_to_array</strong></a>(x)</dt></dl>
<dl><dt><a name="-logwarn"><strong>logwarn</strong></a>(x)</dt><dd><tt>Return log10 for positive x</tt></dd></dl>
<dl><dt><a name="-pow10"><strong>pow10</strong></a>(x)</dt><dd><tt>the inverse of log10; 10**x</tt></dd></dl>
<dl><dt><a name="-transform_bound1d"><strong>transform_bound1d</strong></a>(bound, trans)</dt><dd><tt><a href="#Transform">Transform</a> a <a href="#Bound1D">Bound1D</a> instance using transforms trans</tt></dd></dl>
<dl><dt><a name="-transform_bound2d"><strong>transform_bound2d</strong></a>(bbox, transx, transy)</dt><dd><tt><a href="#Transform">Transform</a> a <a href="#Bound2D">Bound2D</a> instance using transforms transx, transy</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)<br>
<strong>log10</strong> = <UFunc: 'log10'></td></tr></table>
@footer@