Revision: 3998
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3998&view=rev
Author: mdboom
Date: 2007-10-24 12:42:49 -0700 (Wed, 24 Oct 2007)
Log Message:
-----------
More examples working.
Modified Paths:
--------------
branches/transforms/examples/poly_editor.py
branches/transforms/examples/wxcursor_demo.py
branches/transforms/lib/matplotlib/backends/backend_wx.py
branches/transforms/lib/matplotlib/patches.py
branches/transforms/lib/matplotlib/transforms.py
Modified: branches/transforms/examples/poly_editor.py
===================================================================
--- branches/transforms/examples/poly_editor.py 2007-10-24 19:22:00 UTC (rev
3997)
+++ branches/transforms/examples/poly_editor.py 2007-10-24 19:42:49 UTC (rev
3998)
@@ -68,10 +68,11 @@
def get_ind_under_point(self, event):
'get the index of the vertex under point if within epsilon tolerance'
- x, y = zip(*self.poly.xy)
# display coords
- xt, yt = self.poly.get_transform().numerix_x_y(x, y)
+ xy = npy.asarray(self.poly.xy)
+ xyt = self.poly.get_transform().transform(xy)
+ xt, yt = xyt[:, 0], xyt[:, 1]
d = sqrt((xt-event.x)**2 + (yt-event.y)**2)
indseq = nonzero(equal(d, amin(d)))
ind = indseq[0]
@@ -130,7 +131,7 @@
x,y = event.xdata, event.ydata
self.poly.xy[self._ind] = x,y
self.line.set_data(zip(*self.poly.xy))
-
+
self.canvas.restore_region(self.background)
self.ax.draw_artist(self.poly)
self.ax.draw_artist(self.line)
Modified: branches/transforms/examples/wxcursor_demo.py
===================================================================
--- branches/transforms/examples/wxcursor_demo.py 2007-10-24 19:22:00 UTC
(rev 3997)
+++ branches/transforms/examples/wxcursor_demo.py 2007-10-24 19:42:49 UTC
(rev 3998)
@@ -3,6 +3,8 @@
"""
import matplotlib
+matplotlib.use('WXAgg')
+
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
@@ -65,6 +67,5 @@
return True
if __name__=='__main__':
- matplotlib.use('WXAgg')
app = App(0)
app.MainLoop()
Modified: branches/transforms/lib/matplotlib/backends/backend_wx.py
===================================================================
--- branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-10-24
19:22:00 UTC (rev 3997)
+++ branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-10-24
19:42:49 UTC (rev 3998)
@@ -2043,7 +2043,7 @@
vscale = float(ppw) / fig_dpi
# set figure resolution,bg color for printer
- self.canvas.figure.dpi.set(ppw)
+ self.canvas.figure.dpi = ppw
self.canvas.figure.set_facecolor('#FFFFFF')
renderer = RendererWx(self.canvas.bitmap, self.canvas.figure.dpi)
Modified: branches/transforms/lib/matplotlib/patches.py
===================================================================
--- branches/transforms/lib/matplotlib/patches.py 2007-10-24 19:22:00 UTC
(rev 3997)
+++ branches/transforms/lib/matplotlib/patches.py 2007-10-24 19:42:49 UTC
(rev 3998)
@@ -506,8 +506,8 @@
See Patch documentation for additional kwargs
"""
Patch.__init__(self, **kwargs)
- self.xy = xy
self._path = Path(xy, closed=True)
+ self.xy = self._path.vertices
__init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
def get_path(self):
Modified: branches/transforms/lib/matplotlib/transforms.py
===================================================================
--- branches/transforms/lib/matplotlib/transforms.py 2007-10-24 19:22:00 UTC
(rev 3997)
+++ branches/transforms/lib/matplotlib/transforms.py 2007-10-24 19:42:49 UTC
(rev 3998)
@@ -927,6 +927,7 @@
The transformed point is returned as a sequence of length
self.output_dims.
"""
+ assert len(point) == 2
return self.transform(npy.asarray([point]))[0]
def transform_path(self, path):
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins