> Neil Crighton wrote: >> I noticed on the event handling doc page: >> >> matplotlib-devel@lists.sourceforge.net >> >> that the draggable rectangle example doesn't work in version 0.98.3. >> The rectangle class no longer seems to have the xy property. If you >> replace the current on_press() method in the example with the code >> below it seem to work. >> >> def on_press(self, event): >> 'on button press we will see if the mouse is over us and store >> some data' >> if event.inaxes != self.rect.axes: return >> >> contains, attrd = self.rect.contains(event) >> if not contains: return >> xy = self.rect.get_x(),self.rect.get_y() >> print 'event contains', xy >> x0, y0 = xy >> self.press = x0, y0, event.xdata, event.ydata >>
Here's probably a better question to ask than just to fix the example. Was it intended that the Rectangle.xy attribute disappear? I couldn't find it documented in API_CHANGES. It appears that there was just a change at some point in Michael's transforms work. If it's considered desirable to have it back, I'll volunteer to whip up a patch to make it a property. If not, let's just make sure we document this in API_CHANGES. My opinion is that randomly breaking API is always bad, and there's not much effort involved in fixing it here. On the other hand, we've already had 3 with this breakage, and no complaints up until now (and that's from our own docs :P) Thoughts? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel