windrose OO

Hi all,
find with this message a modified version of windrose to be OO compliant.
It uses inheritance from PolarAxes to create a WindroseAxes, with 4 methods
(contour, contourf, bar and box). BTW it's now possible to control it like
any other axes, with the limitation of subploting (subplot is to closer to
simple axe and polaraxe). There's also a extra argument 'blowto' which
reverse the plot (used in pollutantrose), and scipy is not required (just
numpy).
Hope someone find it usefull
Cordialy

windrose_oo.py (20.3 KB)

···

--
Lionel Roubeyrie - lroubeyrie@...1068...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr

Thanks for the update.

Cheers,
Alan Isaac

···

On Wed, 26 Mar 2008, Lionel Roubeyrie apparently wrote:

[Attachment: windrose_oo.py : APPLICATION/X-PYTHON, 28502 bytes]

Lionel Roubeyrie wrote:

find with this message a modified version of windrose to be OO compliant.

Lionel,

I've had this message of yours (from March), and finally had a chance to use it.

Unfortunately, it seems to use the old Transforms mechanism, so won't work with the latest MPL.

have you ported it over yet? Can anyone else help out with a port?

Thanks,

-Chris

windrose_oo.py (19.8 KB)

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Christopher Barker wrote:

have you ported it over yet? Can anyone else help out with a port?

Note: it looks pretty easy, if yu know what you are doing:

from matplotlib.transforms import Interval, Value

Then in the code, I inly see Interval and Value used here:

         self.rintv = Interval(Value(0), Value(1))
         self.rintd = Interval(Value(0), Value(1))

Is there a guide to translating code from the old to new Transforms structure?

-CHB

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Christopher Barker wrote:

Is there a guide to translating code from the old to new Transforms structure?
  
Yes, in the API_CHANGES file, in the source distribution. (I'd link to SVN, but it seems Sourceforge's SVN browser is down.)

Cheers,
Mike

We keep a copy of this file at http://matplotlib.sf.net/API_CHANGES
that is updated with every release See also
http://matplotlib.sourceforge.net/MIGRATION.txt

JDH

···

On Mon, Aug 11, 2008 at 3:51 PM, Michael Droettboom <mdroe@...86...> wrote:

Christopher Barker wrote:

Is there a guide to translating code from the old to new Transforms
structure?

Yes, in the API_CHANGES file, in the source distribution. (I'd link to
SVN, but it seems Sourceforge's SVN browser is down.)

We keep a copy of this file at http://matplotlib.sf.net/API_CHANGES
that is updated with every release See also
http://matplotlib.sourceforge.net/MIGRATION.txt

JDH

···

On Mon, Aug 11, 2008 at 3:51 PM, Michael Droettboom <mdroe@...86...> wrote:

Christopher Barker wrote:

Is there a guide to translating code from the old to new Transforms
structure?

Yes, in the API_CHANGES file, in the source distribution. (I'd link to
SVN, but it seems Sourceforge's SVN browser is down.)

Hi,
sorry for the latency, holidays just finished :frowning:
Find with this message a modified version of windrose_oo, but I'm not very familiar with the new projections facilities, and then the code is buggy :

windrose_oo.py (18.3 KB)

···

##############################
Traceback (most recent call last):
  File "windrose_oo.py", line 464, in <module>
    ax = WindroseAxes(fig, rect, axisbg='w')
  File "windrose_oo.py", line 33, in __init__
    PolarAxes.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/matplotlib/projections/polar.py", line 171, in __init__
    Axes.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 529, in __init__
    self.cla()
  File "windrose_oo.py", line 47, in cla
    PolarAxes.cla(self)
  File "/usr/lib/python2.5/site-packages/matplotlib/projections/polar.py", line 177, in cla
    Axes.cla(self)
  File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 771, in cla
    self.xaxis.cla()
AttributeError: 'NoneType' object has no attribute 'cla'
#############################

I don't understand why this problem occurs, if someone can the mistake, I'll appreciate :slight_smile:
Thanks

Christopher Barker a écrit :

Lionel Roubeyrie wrote:

find with this message a modified version of windrose to be OO compliant.

Lionel,

I've had this message of yours (from March), and finally had a chance to use it.

Unfortunately, it seems to use the old Transforms mechanism, so won't work with the latest MPL.

have you ported it over yet? Can anyone else help out with a port?

Thanks,

-Chris

--
Lionel Roubeyrie - lroubeyrie@...1068...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr