dates fail after upgrade

I upgraded to matplotlib-0.87.4 Now I receive an error like the following every time I try to use matplotlib.dates. The following error messages were generated when I tried to run matplotlib-0.87.4/examples/date_demo1.py

Any Idea on how I can get dates working again?
(I am running the 2.6.17.6 kernel on a 64-bit linux system)

Example:

matplotlib-0.87.4/examples]$ python date_demo1.py
Traceback (most recent call last):
File “/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_gtk.py”, line 284, in expose_event
self._render_figure(self._pixmap, w, h)
File “/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py”, line 73, in _render_figure
FigureCanvasAgg.draw(self)
File “/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_agg.py”, line 391, in draw
self.figure.draw(renderer)
File
“/usr/lib64/python2.4/site-packages/matplotlib/figure.py”, line 532, in draw
for a in self.axes: a.draw(renderer)
File “/usr/lib64/python2.4/site-packages/matplotlib/axes.py”, line 1045, in draw
a.draw(renderer)
File “/usr/lib64/python2.4/site-packages/matplotlib/axis.py”, line 548, in draw
majorLabels = [self.major.formatter(val, i) for i, val in enumerate(majorLocs)]
File “/usr/lib64/python2.4/site-packages/matplotlib/dates.py”, line 247, in call
dt = num2date(x, self.tz)
File “/usr/lib64/python2.4/site-packages/matplotlib/dates.py”, line 205, in num2date
if not iterable(x): return _from_ordinalf(x, tz)
File “/usr/lib64/python2.4/site-packages/matplotlib/dates.py”, line 156, in _from_ordinalf
hour, remainder = divmod(24*remainder, 1)
ValueError: need more than 0 values to
unpack
Traceback (most recent call last):

Richard

Richard,
in matplotlib/dates.py, change line 155 from
remainder = x - ix
to
remainder = float(x) - ix

The problem is that matplotlib uses numpy arrays for the xaxis. As you have a
64b system, the arrays are in float64scalars, that divmod doesn't know how to
process (unless you have a very recent of numpy). The trick above forces a
downcasting of float64scalar to float32scalar, divmod can now work.

···

On Friday 28 July 2006 17:19, Richard Ruth wrote:

I upgraded to matplotlib-0.87.4 Now I receive an error like the following
every time I try to use matplotlib.dates. The following error messages
were generated when I tried to run matplotlib-0.87.4/examples/date_demo1.py

Any Idea on how I can get dates working again?
(I am running the 2.6.17.6 kernel on a 64-bit linux system)