image_demo.py raises AttributeError: set_resample

I apologize if this doesn’t belong in the developers mailing list:

When I run image_demo.py in examples/pylab (using mpl r, I get AttributeError: set_resample.

This error seems to have been introduced in revision 5433 with the agg resample patch (i.e. image_demo.py works fine with r5432).

-Tony

Here’s the full traceback:

Exception in Tkinter callback
Traceback (most recent call last):
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py”, line 1403, in call
return self.func(*args)
File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py”, line 188, in resize
self.show()
File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py”, line 191, in draw
FigureCanvasAgg.draw(self)
File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/backends/backend_agg.py”, line 255, in draw
self.figure.draw(self.renderer)
File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/figure.py”, line 825, in draw
for a in self.axes: a.draw(renderer)
File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/axes.py”, line 1455, in draw
im.draw(renderer)
File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/image.py”, line 232, in draw
im = self.make_image(renderer.get_image_magnification())
File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/image.py”, line 205, in make_image
im.set_resample(self._resample)
AttributeError: set_resample

I apologize if this doesn't belong in the developers mailing list:
When I run image_demo.py in examples/pylab (using mpl r, I
get AttributeError: set_resample.
This error seems to have been introduced in revision 5433 with the agg
resample patch (i.e. image_demo.py works fine with r5432).

I think you may be getting your mpl versions mixed up -- svn trunk
does not have examples/pylab/image_demo.py. The directory has been
renamed examples/pylab_examples to avoid code breakage for people
importing pylab and running in the examples dir. The image_demo
example is running for me on the trunk.

Try doing a svn up on the trunk, and a clean rebuild

rm -rf build

> rm -rf /path/to/site-packages/matplotlib*

Before reinstalling.

JDH

···

On Wed, Jun 11, 2008 at 10:13 AM, Tony Yu <tsyu80@...149...> wrote:

One other thing -- any svn problem is fine on the dev list. In fact,
it *should* be on the dev list.

JDH

···

On Wed, Jun 11, 2008 at 10:13 AM, Tony Yu <tsyu80@...149...> wrote:

I apologize if this doesn't belong in the developers mailing list:

Actually I mistyped earlier; I was using image_demo from pylab_examples. In any case, an svn up fixed the problem.

Strangely enough, reverting back to the revision that was originally raising errors didn't bring the errors back. I must have been running a cached version of one of the files.

Thanks for your help.
-Tony

···

On Jun 11, 2008, at 11:47 AM, John Hunter wrote:

On Wed, Jun 11, 2008 at 10:13 AM, Tony Yu <tsyu80@...149...> wrote:

I apologize if this doesn't belong in the developers mailing list:
When I run image_demo.py in examples/pylab (using mpl r, I
get AttributeError: set_resample.
This error seems to have been introduced in revision 5433 with the agg
resample patch (i.e. image_demo.py works fine with r5432).

I think you may be getting your mpl versions mixed up -- svn trunk
does not have examples/pylab/image_demo.py. The directory has been
renamed examples/pylab_examples to avoid code breakage for people
importing pylab and running in the examples dir. The image_demo
example is running for me on the trunk.