From: <jd...@us...> - 2008-02-13 13:50:33
|
Revision: 4959 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4959&view=rev Author: jdh2358 Date: 2008-02-13 05:50:29 -0800 (Wed, 13 Feb 2008) Log Message: ----------- Applied Erik's right-click backend_bases fix Modified Paths: -------------- trunk/matplotlib/examples/ginput_demo.py trunk/matplotlib/examples/lasso_demo.py trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/examples/ginput_demo.py =================================================================== --- trunk/matplotlib/examples/ginput_demo.py 2008-02-13 08:34:53 UTC (rev 4958) +++ trunk/matplotlib/examples/ginput_demo.py 2008-02-13 13:50:29 UTC (rev 4959) @@ -2,5 +2,5 @@ t = arange(10) plot(t, sin(t)) print "Please click" -ginput(3, verbose=True) +x = ginput(3, verbose=True) show() Modified: trunk/matplotlib/examples/lasso_demo.py =================================================================== --- trunk/matplotlib/examples/lasso_demo.py 2008-02-13 08:34:53 UTC (rev 4958) +++ trunk/matplotlib/examples/lasso_demo.py 2008-02-13 13:50:29 UTC (rev 4959) @@ -37,7 +37,7 @@ facecolors = [d.color for d in data] self.xys = [(d.x, d.y) for d in data] - + fig = ax.figure self.collection = RegularPolyCollection( fig.dpi, 6, sizes=(100,), facecolors=facecolors, @@ -47,6 +47,7 @@ ax.add_collection(self.collection) self.cid = self.canvas.mpl_connect('button_press_event', self.onpress) + self.ind = None def callback(self, verts): facecolors = self.collection.get_facecolors() @@ -60,7 +61,7 @@ self.canvas.draw_idle() self.canvas.widgetlock.release(self.lasso) del self.lasso - + self.ind = ind def onpress(self, event): if self.canvas.widgetlock.locked(): return if event.inaxes is None: return @@ -68,10 +69,12 @@ # acquire a lock on the widget drawing self.canvas.widgetlock(self.lasso) -data = [Datum(*xy) for xy in rand(100, 2)] +if 0: -fig = figure() -ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False) -lman = LassoManager(ax, data) + data = [Datum(*xy) for xy in rand(100, 2)] -show() + fig = figure() + ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False) + lman = LassoManager(ax, data) + + show() Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-02-13 08:34:53 UTC (rev 4958) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-02-13 13:50:29 UTC (rev 4959) @@ -1556,11 +1556,11 @@ if a.get_xscale()=='log': alpha=npy.log(Xmax/Xmin)/npy.log(x1/x0) rx1=pow(Xmin/x0,alpha)*Xmin - x2=pow(Xmax/x0,alpha)*Xmin + rx2=pow(Xmax/x0,alpha)*Xmin else: alpha=(Xmax-Xmin)/(x1-x0) rx1=alpha*(Xmin-x0)+Xmin - x2=alpha*(Xmax-x0)+Xmin + rx2=alpha*(Xmax-x0)+Xmin if a.get_yscale()=='log': alpha=npy.log(Ymax/Ymin)/npy.log(y1/y0) ry1=pow(Ymin/y0,alpha)*Ymin Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-13 08:34:53 UTC (rev 4958) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-13 13:50:29 UTC (rev 4959) @@ -1943,7 +1943,13 @@ except NotImplementedError: return False else: return b +def safe_isinf(x): + 'isnan for arbitrary types' + try: b = npy.isinf(x) + except NotImplementedError: return False + else: return b + def rec_append_field(rec, name, arr, dtype=None): 'return a new record array with field name populated with data from array arr' arr = npy.asarray(arr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |