Re: [matplotlib-devel] Units issue

2009-05-21 Thread James Evans
There seems to be some confusion as to how the mpl unit system works, I hope the following will help to clarify that and keep this thread focused on the issue. Currently mpl provides an API via the 'ConversionInterface' class in 'matplotlb.units' that allows a user to define how to translate th

Re: [matplotlib-devel] Units issue

2009-05-21 Thread John Hunter
On Thu, May 21, 2009 at 2:20 PM, Christopher Barker wrote: > John Hunter wrote: >> wrote: >>> If it's going to be done, I think it really shouldn't be too MPL >>> specific -- it should be built on a good (and hopefully eventually >>> widely used) unit-array system, perhaps like Darren Dale's Quan

Re: [matplotlib-devel] Units issue

2009-05-21 Thread Robert Kern
On 2009-05-21 14:55, Pierre GM wrote: > Anyway, the zoom-level dependent ticks we implemented might be a good > starting point for implementing a "locator/formatter that decides > whether to display cm or km"... Well, if we're pushing products, Chaco has a subsystem for doing exactly this in a g

Re: [matplotlib-devel] Units issue

2009-05-21 Thread Pierre GM
Er... Anybody has tried the plotting capacities of scikits.timeseries (pytseries.sourceforge.net)? In short, the package provides some extensions to matplotlib to plot timeseries. One of these extensions changes the ticks depending on the zoom level: start over a few decades and ticks will

Re: [matplotlib-devel] Units issue

2009-05-21 Thread Christopher Barker
John Hunter wrote: > wrote: >> If it's going to be done, I think it really shouldn't be too MPL >> specific -- it should be built on a good (and hopefully eventually >> widely used) unit-array system, perhaps like Darren Dale's Quantities >> package (there are quite a few other that should be look

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Darren Dale
On Wed, May 20, 2009 at 2:11 PM, Ryan May wrote: > > > On Wed, May 20, 2009 at 1:10 PM, Christopher Barker > wrote: > >> > Darren Dale was working on a full-fledged package for adding units to >> > numpy arrays called quantities >> > (http://packages.python.org/quantities/user/tutorial.html), >>

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Darren Dale
On Wed, May 20, 2009 at 1:01 PM, Ryan May wrote: > On Wed, May 20, 2009 at 11:54 AM, Christopher Barker < > chris.bar...@noaa.gov> wrote: > >> Ryan May wrote: >> > use the units in basic_units.py (in the examples/units directory). >> >> This looks like pretty cool stuff. However, I can't seem to

Re: [matplotlib-devel] Units issue

2009-05-20 Thread John Hunter
On Wed, May 20, 2009 at 4:02 PM, Christopher Barker wrote: > John Hunter wrote: >> The use case (and we can debate whether this is worth the extra overhead) >> >> ax.plot(inches) >> ax.set_xlim(cms) > > I'll put my two cents into that debate: > > My first thought is: wow! that is putting WAY t

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Christopher Barker
John Hunter wrote: > The use case (and we can debate whether this is worth the extra overhead) > > ax.plot(inches) > ax.set_xlim(cms) I'll put my two cents into that debate: My first thought is: wow! that is putting WAY too much into a plotting routine! My second thought is: on the other h

Re: [matplotlib-devel] Units issue

2009-05-20 Thread John Hunter
On Wed, May 20, 2009 at 2:36 PM, Eric Firing wrote: > I'm not sure I understand the use case for unit *changes*, as opposed to > initial unit specification. The use case (and we can debate whether this is worth the extra overhead) ax.plot(inches) ax.set_xlim(cms) And the plot will automagi

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Eric Firing
John Hunter wrote: > The fundamental problem here is that some artists (Line2D) have > support for storing original unitized data (_xorig, _yorig) and > handling the conversion on unit change internally with the callback, > and some artists (eg Patches) do not . axes._process_plot_var_arg > sub

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Ryan May
On Wed, May 20, 2009 at 1:10 PM, Christopher Barker wrote: > > Darren Dale was working on a full-fledged package for adding units to > > numpy arrays called quantities > > (http://packages.python.org/quantities/user/tutorial.html), > > thanks for the reminder -- that does look like a really nice p

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Christopher Barker
Ryan May wrote: > It's another one of those modules > whose docs hasn't been converted to sphinx yet, but it does have doc > strings. Couldn't/shouldn't sphinx just use the docs strings so that there is SOMETHING there? I really love the sphinx docs, but it is frustrating got have a module sim

Re: [matplotlib-devel] Units issue

2009-05-20 Thread John Hunter
On Wed, May 20, 2009 at 11:55 AM, Ryan May wrote: > On Wed, May 20, 2009 at 11:38 AM, Ryan May 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

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Ryan May
On Wed, May 20, 2009 at 11:54 AM, Christopher Barker wrote: > Ryan May wrote: > > use the units in basic_units.py (in the examples/units directory). > > This looks like pretty cool stuff. However, I can't seem to find > matplotlib.units or basic_units.py in the online Sphinx docs. Is this a > doc

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Ryan May
On Wed, May 20, 2009 at 11:38 AM, Ryan May 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 > scr

Re: [matplotlib-devel] Units issue

2009-05-20 Thread Christopher Barker
Ryan May wrote: > use the units in basic_units.py (in the examples/units directory). This looks like pretty cool stuff. However, I can't seem to find matplotlib.units or basic_units.py in the online Sphinx docs. Is this a doc bug, or intentional? There are units examples in the docs. -Chris