On Wed, May 20, 2009 at 11:38 AM, Ryan May <rma...@gmail.com> wrote:

> Hi,
>
> In looking over a test failure, I'm seeing some behavior that doesn't make
> sense to me.  It looks like data passed to a line object is being improperly
> converted when units are involved. Here's a version of the code in the test
> script, but modified to use the units in basic_units.py (in the
> examples/units directory).  You should be able to just drop this script into
> the examples/units directory and run it:


It looks like revision 7020 broke this in the process of adding units
support for fill().

If I change the following lines (in the _xy_from_xy() function):

            if bx:
                x = self.axes.convert_xunits(x)
            if by:
                y = self.axes.convert_yunits(y)

back to:

            if bx or by: return x, y, False

the example I posted works and the test failure I was seeing is gone.  Of
course, this breaks fill() with unit-ed quantities.  I'm getting a little
over my head here in terms of tracing the flow of units, so I'd love to hear
opinions on how to actually fix this.  IMHO, we *really* need to standardize
on how units are handled.  In some cases the axes method handles converting
units, but in this case, the Line2D object also registers for changes to
axis units so it can update itself.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to