|
From: <ry...@us...> - 2008-10-29 03:36:33
|
Revision: 6344
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6344&view=rev
Author: ryanmay
Date: 2008-10-29 03:36:27 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
Fix DraggableRectangle event handling example to no longer use the (now removed) Rectangle.xy property.
Modified Paths:
--------------
trunk/matplotlib/doc/users/event_handling.rst
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst 2008-10-28 19:36:07 UTC (rev 6343)
+++ trunk/matplotlib/doc/users/event_handling.rst 2008-10-29 03:36:27 UTC (rev 6344)
@@ -182,8 +182,8 @@
contains, attrd = self.rect.contains(event)
if not contains: return
- print 'event contains', self.rect.xy
- x0, y0 = self.rect.xy
+ x0, y0 = self.rect.get_x(), self.rect.get_y()
+ print 'event contains', x0, y0
self.press = x0, y0, event.xdata, event.ydata
def on_motion(self, event):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-10-29 20:28:59
|
Revision: 6352
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6352&view=rev
Author: ryanmay
Date: 2008-10-29 20:28:57 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
Fix 'extra credit' DraggableRectangle to no longer use Rectangle.xy. (Thanks to Neil Crighton for finding the original problem.)
Modified Paths:
--------------
trunk/matplotlib/doc/users/event_handling.rst
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst 2008-10-29 19:45:18 UTC (rev 6351)
+++ trunk/matplotlib/doc/users/event_handling.rst 2008-10-29 20:28:57 UTC (rev 6352)
@@ -257,8 +257,8 @@
if DraggableRectangle.lock is not None: return
contains, attrd = self.rect.contains(event)
if not contains: return
- print 'event contains', self.rect.xy
- x0, y0 = self.rect.xy
+ x0, y0 = self.rect.get_x(), self.rect.get_y()
+ print 'event contains', x0, y0
self.press = x0, y0, event.xdata, event.ydata
DraggableRectangle.lock = self
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-11-05 17:12:09
|
Revision: 6367
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6367&view=rev
Author: ryanmay
Date: 2008-11-05 17:12:03 +0000 (Wed, 05 Nov 2008)
Log Message:
-----------
Revert the DraggableRectangle exercise solution to use the Rectangle.xy attribute now that it exists. This agrees with the exercise description.
Modified Paths:
--------------
trunk/matplotlib/doc/users/event_handling.rst
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst 2008-11-05 17:09:55 UTC (rev 6366)
+++ trunk/matplotlib/doc/users/event_handling.rst 2008-11-05 17:12:03 UTC (rev 6367)
@@ -182,8 +182,8 @@
contains, attrd = self.rect.contains(event)
if not contains: return
- x0, y0 = self.rect.get_x(), self.rect.get_y()
- print 'event contains', x0, y0
+ print 'event contains', self.rect.xy
+ x0, y0 = self.rect.xy
self.press = x0, y0, event.xdata, event.ydata
def on_motion(self, event):
@@ -257,8 +257,8 @@
if DraggableRectangle.lock is not None: return
contains, attrd = self.rect.contains(event)
if not contains: return
- x0, y0 = self.rect.get_x(), self.rect.get_y()
- print 'event contains', x0, y0
+ print 'event contains', self.rect.xy
+ x0, y0 = self.rect.xy
self.press = x0, y0, event.xdata, event.ydata
DraggableRectangle.lock = self
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-03-10 14:15:01
|
Revision: 8187
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8187&view=rev
Author: mdboom
Date: 2010-03-10 14:14:52 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Make LineBuilder example more complete as a stand-alone script (suggested by David Arnold)
Modified Paths:
--------------
trunk/matplotlib/doc/users/event_handling.rst
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst 2010-03-09 21:09:51 UTC (rev 8186)
+++ trunk/matplotlib/doc/users/event_handling.rst 2010-03-10 14:14:52 UTC (rev 8187)
@@ -111,6 +111,8 @@
Let's look a simple example of a canvas, where a simple line segment
is created every time a mouse is pressed::
+ from matplotlib import pyplot as plt
+
class LineBuilder:
def __init__(self, line):
self.line = line
@@ -132,6 +134,7 @@
line, = ax.plot([0], [0]) # empty line
linebuilder = LineBuilder(line)
+ plt.show()
The :class:`~matplotlib.backend_bases.MouseEvent` that we just used is a
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|