SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Neil C. <nei...@gm...> - 2008年10月27日 15:10:27
I noticed on the event handling doc page:
mat...@li...
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
Neil
From: Ryan M. <rm...@gm...> - 2008年10月29日 03:50:19
Neil Crighton wrote:
> I noticed on the event handling doc page:
> 
> mat...@li...
> 
> 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
> 
Good catch. I checked in a slightly different version of the fix.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Ryan M. <rm...@gm...> - 2008年10月29日 21:00:00
> Neil Crighton wrote:
>> I noticed on the event handling doc page:
>>
>> mat...@li...
>>
>> 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
From: John H. <jd...@gm...> - 2008年10月29日 21:16:15
On Wed, Oct 29, 2008 at 4:00 PM, Ryan May <rm...@gm...> wrote:
> 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.
I have no problem with you adding it back in as a convenience
property. Can't see the harm.
JDH
From: Michael D. <md...@st...> - 2008年10月30日 12:38:11
Agreed. I think it is missing only be accident.
Mike
John Hunter wrote:
> On Wed, Oct 29, 2008 at 4:00 PM, Ryan May <rm...@gm...> wrote:
>
> 
>> 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.
>> 
>
> I have no problem with you adding it back in as a convenience
> property. Can't see the harm.
>
> JDH
>
> -------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Ryan M. <rm...@gm...> - 2008年11月05日 17:14:46
John Hunter wrote:
> On Wed, Oct 29, 2008 at 4:00 PM, Ryan May <rm...@gm...> wrote:
> 
>> 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.
> 
> I have no problem with you adding it back in as a convenience
> property. Can't see the harm.
Done in r6366. Also reverted the changes to the exercise, as the
description still mentioned using the xy attribute.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Neil C. <nei...@gm...> - 2008年11月03日 11:58:43
Thanks - sorry for posting the mailing list address instead of the the
event handling page(!). That'll teach me to email before
proof-reading...
2008年10月29日 Ryan May <rm...@gm...>:
> Neil Crighton wrote:
>> I noticed on the event handling doc page:
>>
>> mat...@li...
>>
>> 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
>>
>
> Good catch. I checked in a slightly different version of the fix.
>
> Ryan
>
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
>
From: Neil C. <nei...@gm...> - 2008年11月03日 12:00:56
*re-reads email*
Apparently it won't teach me.
Sorry for the spam.
2008年11月3日 Neil Crighton <nei...@gm...>:
> Thanks - sorry for posting the mailing list address instead of the the
> event handling page(!). That'll teach me to email before
> proof-reading...
>
> 2008年10月29日 Ryan May <rm...@gm...>:
>> Neil Crighton wrote:
>>> I noticed on the event handling doc page:
>>>
>>> mat...@li...
>>>
>>> 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
>>>
>>
>> Good catch. I checked in a slightly different version of the fix.
>>
>> Ryan
>>
>> --
>> Ryan May
>> Graduate Research Assistant
>> School of Meteorology
>> University of Oklahoma
>>
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /