From: <md...@us...> - 2007-11-12 13:53:41
|
Revision: 4220 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4220&view=rev Author: mdboom Date: 2007-11-12 05:53:38 -0800 (Mon, 12 Nov 2007) Log Message: ----------- Merged revisions 4191-4219 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4191 | efiring | 2007-11-09 14:37:15 -0500 (Fri, 09 Nov 2007) | 2 lines Remove numerix as nx from pylab ........ r4194 | mdboom | 2007-11-09 15:14:29 -0500 (Fri, 09 Nov 2007) | 2 lines Fix exception plotting an errorbar graph with only two data points. ........ r4195 | mdboom | 2007-11-09 15:15:52 -0500 (Fri, 09 Nov 2007) | 2 lines Bugfix: [ 1808189 ] lw kwarg broken in errorbar (Thanks Joe Monaco). ........ r4196 | dsdale | 2007-11-09 15:37:57 -0500 (Fri, 09 Nov 2007) | 2 lines minor formatting change to dependency report ........ r4197 | mdboom | 2007-11-09 15:59:47 -0500 (Fri, 09 Nov 2007) | 5 lines Bugfix: [ 1757315 ] ValueError: Cannot set nonpositive limits with log transform. The axes scales were not getting set back to "linear" when cla() is called, so autoscale_limits gets confused on the next call to plot(). ........ r4198 | mdboom | 2007-11-09 16:09:04 -0500 (Fri, 09 Nov 2007) | 5 lines Bugfix: [ 1745650 ] patch for mlab.py's comment handling Comment handling had the potential to lose the last character of a line. Slightly different from user submitted patch -- uses split() instead of three lines of Python code. ........ r4199 | mdboom | 2007-11-09 16:27:30 -0500 (Fri, 09 Nov 2007) | 3 lines Bugfix: [ 1732274 ] No antialiasing with pie on wxpython Reducing the sampling of the curve on the wedge looks much better. ........ r4200 | mdboom | 2007-11-09 16:28:58 -0500 (Fri, 09 Nov 2007) | 2 lines Oops in last commit. ........ r4214 | dsdale | 2007-11-10 18:08:19 -0500 (Sat, 10 Nov 2007) | 3 lines added flags in setup.cfg to disable providing external packages like pytz and datetime ........ r4215 | dsdale | 2007-11-10 18:10:15 -0500 (Sat, 10 Nov 2007) | 2 lines added a comment in setup.cfg, will rename to setup.cfg.template ........ r4216 | dsdale | 2007-11-10 18:20:44 -0500 (Sat, 10 Nov 2007) | 2 lines dont use spaces in setup.cfg section names ........ r4217 | dsdale | 2007-11-10 18:21:38 -0500 (Sat, 10 Nov 2007) | 3 lines moved setup.cfg to setup.cfg.template, so local modifications can be made without affecting the trunk ........ r4218 | dsdale | 2007-11-10 18:26:36 -0500 (Sat, 10 Nov 2007) | 2 lines expand comments in build report ........ Modified Paths: -------------- branches/transforms/examples/animation_blit_fltk.py branches/transforms/examples/annotation_demo.py branches/transforms/examples/barcode_demo.py branches/transforms/examples/broken_barh.py branches/transforms/examples/clippath_test.py branches/transforms/examples/custom_figure_class.py branches/transforms/examples/date_demo_convert.py branches/transforms/examples/dynamic_collection.py branches/transforms/examples/fill_demo2.py branches/transforms/examples/gradient_bar.py branches/transforms/examples/interp_demo.py branches/transforms/examples/lasso_demo.py branches/transforms/examples/pick_event_demo.py branches/transforms/examples/scatter_custom_symbol.py branches/transforms/examples/scatter_star_poly.py branches/transforms/examples/spy_demos.py branches/transforms/examples/xcorr_demo.py branches/transforms/examples/zoom_window.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/collections.py branches/transforms/lib/matplotlib/mlab.py branches/transforms/lib/matplotlib/pylab.py branches/transforms/setup.py branches/transforms/setupext.py Added Paths: ----------- branches/transforms/setup.cfg.template Removed Paths: ------------- branches/transforms/setup.cfg Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4190 + /trunk/matplotlib:1-4219 Modified: branches/transforms/examples/animation_blit_fltk.py =================================================================== --- branches/transforms/examples/animation_blit_fltk.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/animation_blit_fltk.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -3,7 +3,7 @@ import matplotlib matplotlib.use('FltkAgg') import pylab as p -import numpy as nx +import numpy as npy import time @@ -29,7 +29,7 @@ self.background = self.canvas.copy_from_bbox(self.ax.bbox) self.canvas.restore_region(self.background) # update the data - line.set_ydata(nx.sin(x+self.cnt/10.0)) + line.set_ydata(npy.sin(x+self.cnt/10.0)) # just draw the animated artist self.ax.draw_artist(line) # just redraw the axes rectangle @@ -45,8 +45,8 @@ p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs p.grid() # to ensure proper background restore # create the initial line -x = nx.arange(0,2*nx.pi,0.01) -line, = p.plot(x, nx.sin(x), animated=True) +x = npy.arange(0,2*npy.pi,0.01) +line, = p.plot(x, npy.sin(x), animated=True) p.draw() anim=animator(ax) Modified: branches/transforms/examples/annotation_demo.py =================================================================== --- branches/transforms/examples/annotation_demo.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/annotation_demo.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -32,17 +32,19 @@ """ -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show from matplotlib.patches import Ellipse +import numpy as npy + if 1: # if only one location is given, the text and xypoint being # annotated are assumed to be the same fig = figure() ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), ylim=(-3,5)) - t = nx.arange(0.0, 5.0, 0.01) - s = nx.cos(2*nx.pi*t) + t = npy.arange(0.0, 5.0, 0.01) + s = npy.cos(2*npy.pi*t) line, = ax.plot(t, s, lw=3, color='purple') ax.annotate('axes center', xy=(.5, .5), xycoords='axes fraction', @@ -85,8 +87,8 @@ # respected fig = figure() ax = fig.add_subplot(111, polar=True) - r = nx.arange(0,1,0.001) - theta = 2*2*nx.pi*r + r = npy.arange(0,1,0.001) + theta = 2*2*npy.pi*r line, = ax.plot(theta, r, color='#ee8d18', lw=3) ind = 800 @@ -115,8 +117,8 @@ ax.add_artist(el) el.set_clip_box(ax.bbox) ax.annotate('the top', - xy=(nx.pi/2., 10.), # theta, radius - xytext=(nx.pi/3, 20.), # theta, radius + xy=(npy.pi/2., 10.), # theta, radius + xytext=(npy.pi/3, 20.), # theta, radius xycoords='polar', textcoords='polar', arrowprops=dict(facecolor='black', shrink=0.05), Modified: branches/transforms/examples/barcode_demo.py =================================================================== --- branches/transforms/examples/barcode_demo.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/barcode_demo.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,14 +1,16 @@ -from pylab import figure, show, cm, nx +from matplotlib.pyplot import figure, show, cm +from numpy import where +from numpy.random import rand # the bar -x = nx.where(nx.mlab.rand(500)>0.7, 1.0, 0.0) +x = where(rand(500)>0.7, 1.0, 0.0) axprops = dict(xticks=[], yticks=[]) barprops = dict(aspect='auto', cmap=cm.binary, interpolation='nearest') fig = figure() -# a vertical barcode +# a vertical barcode -- this is broken at present x.shape = len(x), 1 ax = fig.add_axes([0.1, 0.3, 0.1, 0.6], **axprops) ax.imshow(x, **barprops) Modified: branches/transforms/examples/broken_barh.py =================================================================== --- branches/transforms/examples/broken_barh.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/broken_barh.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -2,7 +2,7 @@ """ Make a "broken" horizontal bar plot, ie one with gaps """ -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show fig = figure() ax = fig.add_subplot(111) Modified: branches/transforms/examples/clippath_test.py =================================================================== --- branches/transforms/examples/clippath_test.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/clippath_test.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,9 +1,10 @@ -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show import matplotlib.transforms as transforms from matplotlib.patches import RegularPolygon import matplotlib.agg as agg +from numpy import arange, sin, pi +from numpy.random import rand - class ClipWindow: def __init__(self, ax, line): self.ax = ax @@ -47,9 +48,9 @@ fig = figure(figsize=(8,8)) ax = fig.add_subplot(111) -t = nx.arange(0.0, 4.0, 0.01) -s = 2*nx.sin(2*nx.pi*8*t) +t = arange(0.0, 4.0, 0.01) +s = 2*sin(2*pi*8*t) -line, = ax.plot(t, 2*(nx.mlab.rand(len(t))-0.5), 'b-') +line, = ax.plot(t, 2*(rand(len(t))-0.5), 'b-') clipwin = ClipWindow(ax, line) show() Modified: branches/transforms/examples/custom_figure_class.py =================================================================== --- branches/transforms/examples/custom_figure_class.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/custom_figure_class.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,7 +1,7 @@ """ You can pass a custom Figure constructor to figure if youy want to derive from the default Figure. This simple example creates a figure with a figure title """ -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show from matplotlib.figure import Figure class MyFigure(Figure): Modified: branches/transforms/examples/date_demo_convert.py =================================================================== --- branches/transforms/examples/date_demo_convert.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/date_demo_convert.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,16 +1,16 @@ #!/usr/bin/env python import datetime -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show from matplotlib.dates import DayLocator, HourLocator, DateFormatter, drange +from numpy import arange - date1 = datetime.datetime( 2000, 3, 2) date2 = datetime.datetime( 2000, 3, 6) delta = datetime.timedelta(hours=6) dates = drange(date1, date2, delta) -y = nx.arange( len(dates)*1.0) +y = arange( len(dates)*1.0) fig = figure() ax = fig.add_subplot(111) @@ -25,7 +25,7 @@ # tick, not the base multiple ax.xaxis.set_major_locator( DayLocator() ) -ax.xaxis.set_minor_locator( HourLocator(nx.arange(0,25,6)) ) +ax.xaxis.set_minor_locator( HourLocator(arange(0,25,6)) ) ax.xaxis.set_major_formatter( DateFormatter('%Y-%m-%d') ) ax.fmt_xdata = DateFormatter('%Y-%m-%d %H:%M:%S') Modified: branches/transforms/examples/dynamic_collection.py =================================================================== --- branches/transforms/examples/dynamic_collection.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/dynamic_collection.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,7 +1,8 @@ import random from matplotlib.collections import RegularPolyCollection import matplotlib.cm as cm -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show +from numpy.random import rand fig = figure() ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False) @@ -29,8 +30,8 @@ press 'a' to add a random point from the collection, 'd' to delete one """ if event.key=='a': - x,y = nx.mlab.rand(2) - color = cm.jet(nx.mlab.rand()) + x,y = rand(2) + color = cm.jet(rand()) offsets.append((x,y)) facecolors.append(color) fig.canvas.draw() Modified: branches/transforms/examples/fill_demo2.py =================================================================== --- branches/transforms/examples/fill_demo2.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/fill_demo2.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,8 +1,10 @@ -from pylab import figure, nx, show +from matplotlib.pyplot import figure, show +from numpy import arange, sin, pi + fig = figure() ax = fig.add_subplot(111) -t = nx.arange(0.0,3.01,0.01) -s = nx.sin(2*nx.pi*t) -c = nx.sin(4*nx.pi*t) +t = arange(0.0,3.01,0.01) +s = sin(2*pi*t) +c = sin(4*pi*t) ax.fill(t, s, 'b', t, c, 'g', alpha=0.2) show() Modified: branches/transforms/examples/gradient_bar.py =================================================================== --- branches/transforms/examples/gradient_bar.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/gradient_bar.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,4 +1,6 @@ -from pylab import figure, show, nx, cm +from matplotlib.pyplot import figure, show, cm +from numpy import arange +from numpy.random import rand def gbar(ax, x, y, width=0.5, bottom=0): X = [[.6, .6],[.7,.7]] @@ -19,8 +21,8 @@ extent=(xmin, xmax, ymin, ymax), alpha=1) N = 10 -x = nx.arange(N)+0.25 -y = nx.mlab.rand(N) +x = arange(N)+0.25 +y = rand(N) gbar(ax, x, y, width=0.7) ax.set_aspect('normal') show() Modified: branches/transforms/examples/interp_demo.py =================================================================== --- branches/transforms/examples/interp_demo.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/interp_demo.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,6 +1,9 @@ -from pylab import figure, show, nx, linspace, stineman_interp -x = linspace(0,2*nx.pi,20); -y = nx.sin(x); yp = None +from matplotlib.pyplot import figure, show +from numpy import pi, sin, linspace +from matplotlib.mlab import stineman_interp + +x = linspace(0,2*pi,20); +y = sin(x); yp = None xi = linspace(x[0],x[-1],100); yi = stineman_interp(xi,x,y,yp); Modified: branches/transforms/examples/lasso_demo.py =================================================================== --- branches/transforms/examples/lasso_demo.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/lasso_demo.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -13,7 +13,9 @@ from matplotlib.colors import colorConverter from matplotlib.collections import RegularPolyCollection -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show +from numpy import nonzero +from numpy.random import rand class Datum: colorin = colorConverter.to_rgba('red') @@ -47,9 +49,7 @@ self.cid = self.canvas.mpl_connect('button_press_event', self.onpress) def callback(self, verts): - #print 'all done', verts - #ind = matplotlib.mlab._inside_poly_deprecated(self.xys, verts) - ind = nx.nonzero(points_inside_poly(self.xys, verts)) + ind = nonzero(points_inside_poly(self.xys, verts))[0] for i in range(self.Nxy): if i in ind: self.facecolors[i] = Datum.colorin @@ -66,7 +66,7 @@ # acquire a lock on the widget drawing self.canvas.widgetlock(self.lasso) -data = [Datum(*xy) for xy in nx.mlab.rand(100, 2)] +data = [Datum(*xy) for xy in rand(100, 2)] fig = figure() ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False) Modified: branches/transforms/examples/pick_event_demo.py =================================================================== --- branches/transforms/examples/pick_event_demo.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/pick_event_demo.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -63,23 +63,25 @@ The examples below illustrate each of these methods. """ -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show from matplotlib.lines import Line2D from matplotlib.patches import Patch, Rectangle from matplotlib.text import Text from matplotlib.image import AxesImage +import numpy as npy +from numpy.random import rand if 1: # simple picking, lines, rectangles and text fig = figure() ax1 = fig.add_subplot(211) ax1.set_title('click on points, rectangles or text', picker=True) ax1.set_ylabel('ylabel', picker=True, bbox=dict(facecolor='red')) - line, = ax1.plot(nx.mlab.rand(100), 'o', picker=5) # 5 points tolerance + line, = ax1.plot(rand(100), 'o', picker=5) # 5 points tolerance # pick the rectangle ax2 = fig.add_subplot(212) - bars = ax2.bar(range(10), nx.mlab.rand(10), picker=True) + bars = ax2.bar(range(10), rand(10), picker=True) for label in ax2.get_xticklabels(): # make the xtick labels pickable label.set_picker(True) @@ -90,7 +92,7 @@ xdata = thisline.get_xdata() ydata = thisline.get_ydata() ind = event.ind - print 'onpick1 line:', zip(nx.take(xdata, ind), nx.take(ydata, ind)) + print 'onpick1 line:', zip(npy.take(xdata, ind), npy.take(ydata, ind)) elif isinstance(event.artist, Rectangle): patch = event.artist print 'onpick1 patch:', patch.get_path() @@ -122,12 +124,12 @@ xdata = line.get_xdata() ydata = line.get_ydata() maxd = 0.05 - d = nx.sqrt((xdata-mouseevent.xdata)**2. + (ydata-mouseevent.ydata)**2.) + d = npy.sqrt((xdata-mouseevent.xdata)**2. + (ydata-mouseevent.ydata)**2.) - ind = nx.nonzero(nx.less_equal(d, maxd)) + ind = npy.nonzero(npy.less_equal(d, maxd)) if len(ind): - pickx = nx.take(xdata, ind) - picky = nx.take(ydata, ind) + pickx = npy.take(xdata, ind) + picky = npy.take(ydata, ind) props = dict(ind=ind, pickx=pickx, picky=picky) return True, props else: @@ -139,16 +141,16 @@ fig = figure() ax1 = fig.add_subplot(111) ax1.set_title('custom picker for line data') - line, = ax1.plot(nx.mlab.rand(100), nx.mlab.rand(100), 'o', picker=line_picker) + line, = ax1.plot(rand(100), rand(100), 'o', picker=line_picker) fig.canvas.mpl_connect('pick_event', onpick2) if 1: # picking on a scatter plot (matplotlib.collections.RegularPolyCollection) - x, y, c, s = nx.mlab.rand(4, 100) + x, y, c, s = rand(4, 100) def onpick3(event): ind = event.ind - print 'onpick3 scatter:', ind, nx.take(x, ind), nx.take(y, ind) + print 'onpick3 scatter:', ind, npy.take(x, ind), npy.take(y, ind) fig = figure() ax1 = fig.add_subplot(111) @@ -159,10 +161,10 @@ if 1: # picking images (matplotlib.image.AxesImage) fig = figure() ax1 = fig.add_subplot(111) - im1 = ax1.imshow(nx.rand(10,5), extent=(1,2,1,2), picker=True) - im2 = ax1.imshow(nx.rand(5,10), extent=(3,4,1,2), picker=True) - im3 = ax1.imshow(nx.rand(20,25), extent=(1,2,3,4), picker=True) - im4 = ax1.imshow(nx.rand(30,12), extent=(3,4,3,4), picker=True) + im1 = ax1.imshow(rand(10,5), extent=(1,2,1,2), picker=True) + im2 = ax1.imshow(rand(5,10), extent=(3,4,1,2), picker=True) + im3 = ax1.imshow(rand(20,25), extent=(1,2,3,4), picker=True) + im4 = ax1.imshow(rand(30,12), extent=(3,4,3,4), picker=True) ax1.axis([0,5,0,5]) def onpick4(event): Modified: branches/transforms/examples/scatter_custom_symbol.py =================================================================== --- branches/transforms/examples/scatter_custom_symbol.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/scatter_custom_symbol.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,12 +1,14 @@ -from pylab import figure, nx, show +from matplotlib.pyplot import figure, show +from numpy import arange, pi, cos, sin, pi +from numpy.random import rand # unit area ellipse rx, ry = 3., 1. -area = rx * ry * nx.pi -theta = nx.arange(0, 2*nx.pi+0.01, 0.1) -verts = zip(rx/area*nx.cos(theta), ry/area*nx.sin(theta)) +area = rx * ry * pi +theta = arange(0, 2*pi+0.01, 0.1) +verts = zip(rx/area*cos(theta), ry/area*sin(theta)) -x,y,s,c = nx.mlab.rand(4, 30) +x,y,s,c = rand(4, 30) s*= 10**2. fig = figure() Modified: branches/transforms/examples/scatter_star_poly.py =================================================================== --- branches/transforms/examples/scatter_star_poly.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/scatter_star_poly.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,7 +1,7 @@ import pylab -x = pylab.nx.mlab.rand(10) -y = pylab.nx.mlab.rand(10) +x = pylab.rand(10) +y = pylab.rand(10) pylab.subplot(321) pylab.scatter(x,y,s=80,marker=">") Modified: branches/transforms/examples/spy_demos.py =================================================================== --- branches/transforms/examples/spy_demos.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/spy_demos.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -2,7 +2,8 @@ Plot the sparsity pattern of arrays """ -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show +import numpy fig = figure() ax1 = fig.add_subplot(221) @@ -10,7 +11,7 @@ ax3 = fig.add_subplot(223) ax4 = fig.add_subplot(224) -x = nx.mlab.randn(20,20) +x = numpy.random.randn(20,20) x[5] = 0. x[:,12] = 0. Modified: branches/transforms/examples/xcorr_demo.py =================================================================== --- branches/transforms/examples/xcorr_demo.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/xcorr_demo.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,6 +1,7 @@ -from pylab import figure, show, nx +from matplotlib.pylab import figure, show +import numpy -x,y = nx.mlab.randn(2,100) +x,y = numpy.random.randn(2,100) fig = figure() ax1 = fig.add_subplot(211) ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True) @@ -13,3 +14,4 @@ ax2.axhline(0, color='black', lw=2) show() + Modified: branches/transforms/examples/zoom_window.py =================================================================== --- branches/transforms/examples/zoom_window.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/examples/zoom_window.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -9,15 +9,17 @@ Note the diameter of the circles in the scatter are defined in points**2, so their size is independent of the zoom """ -from pylab import figure, show, nx +from matplotlib.pyplot import figure, show +import numpy figsrc = figure() figzoom = figure() axsrc = figsrc.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False) -axzoom = figzoom.add_subplot(111, xlim=(0.45,0.55), ylim=(0.4,.6), autoscale_on=False) +axzoom = figzoom.add_subplot(111, xlim=(0.45,0.55), ylim=(0.4,.6), + autoscale_on=False) axsrc.set_title('Click to zoom') axzoom.set_title('zoom window') -x,y,s,c = nx.mlab.rand(4,200) +x,y,s,c = numpy.random.rand(4,200) s *= 200 Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/lib/matplotlib/axes.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -740,6 +740,8 @@ self.xaxis.cla() self.yaxis.cla() + self.set_xscale('linear') + self.set_yscale('linear') self.ignore_existing_data_limits = True self.callbacks = cbook.CallbackRegistry(('xlim_changed', 'ylim_changed')) @@ -3787,7 +3789,7 @@ plot_kw['mew']=kwargs['mew'] if xerr is not None: - if iterable(xerr) and len(xerr)==2: + if iterable(xerr) and len(xerr)==2 and iterable(xerr[0]) and iterable(xerr[1]): # using list comps rather than arrays to preserve units left = [thisx-thiserr for (thisx, thiserr) in cbook.safezip(x,xerr[0])] right = [thisx+thiserr for (thisx, thiserr) in cbook.safezip(x,xerr[1])] @@ -3821,7 +3823,7 @@ caplines.extend( self.plot(right, y, 'k|', **plot_kw) ) if yerr is not None: - if iterable(yerr) and len(yerr)==2: + if iterable(yerr) and len(yerr)==2 and iterable(yerr[0]) and iterable(yerr[1]): # using list comps rather than arrays to preserve units lower = [thisy-thiserr for (thisy, thiserr) in cbook.safezip(y,yerr[0])] upper = [thisy+thiserr for (thisy, thiserr) in cbook.safezip(y,yerr[1])] Modified: branches/transforms/lib/matplotlib/collections.py =================================================================== --- branches/transforms/lib/matplotlib/collections.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/lib/matplotlib/collections.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -222,7 +222,7 @@ ACCEPTS: float or sequence of floats """ self._linewidths = self._get_value(lw) - set_linewidth = set_linewidths + set_lw = set_linewidth = set_linewidths def set_linestyles(self, ls): """ Modified: branches/transforms/lib/matplotlib/mlab.py =================================================================== --- branches/transforms/lib/matplotlib/mlab.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/lib/matplotlib/mlab.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -1265,7 +1265,7 @@ converterseq = None for i,line in enumerate(fh): if i<skiprows: continue - line = line[:line.find(comments)].strip() + line = line.split(comments, 1)[0].strip() if not len(line): continue if converterseq is None: converterseq = [converters.get(j,float) Modified: branches/transforms/lib/matplotlib/pylab.py =================================================================== --- branches/transforms/lib/matplotlib/pylab.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/lib/matplotlib/pylab.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -202,8 +202,13 @@ from cbook import flatten, is_string_like, exception_to_str, popd, \ silent_list, iterable, enumerate, dedent -import matplotlib.numerix as nx import numpy as npy +# The masked array namespace is brought in as ma; getting +# this from numerix allows one to select either numpy.ma or +# Pierre G-M's maskedarray implementation, which may +# replace the present numpy.ma implementation in a future +# numpy release. +from matplotlib.numerix import npyma as ma from matplotlib import mpl # pulls in most modules Deleted: branches/transforms/setup.cfg =================================================================== --- branches/transforms/setup.cfg 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/setup.cfg 2007-11-12 13:53:38 UTC (rev 4220) @@ -1,7 +0,0 @@ -[egg_info] -tag_svn_revision = 1 - -[status] -# To suppress display of the dependencies and their versions -# at the top of the build log, uncomment the following line: -# suppress = 1 \ No newline at end of file Copied: branches/transforms/setup.cfg.template (from rev 4218, trunk/matplotlib/setup.cfg.template) =================================================================== --- branches/transforms/setup.cfg.template (rev 0) +++ branches/transforms/setup.cfg.template 2007-11-12 13:53:38 UTC (rev 4220) @@ -0,0 +1,24 @@ +# Rename this file to setup.cfg to modify matplotlib's +# build options. + +[egg_info] +tag_svn_revision = 1 + +[status] +# To suppress display of the dependencies and their versions +# at the top of the build log, uncomment the following line: +# +#suppress = True + +[provide_packages] +# by default, matplotlib checks for a few dependencies and +# installs them if missing. This feature can be turned off +# by uncommenting the following lines: +# +## date/timezone support: +#pytz = False +#dateutil = False +# +## experimental config package support: +#enthought.traits = False +#configobj = False Modified: branches/transforms/setup.py =================================================================== --- branches/transforms/setup.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/setup.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -13,10 +13,8 @@ rc = {'backend':'PS', 'numerix':'numpy'} -# build the image support module - requires agg and Numeric or -# numarray. You can build the image module with either Numeric or -# numarray or both. By default, matplotlib will build support for -# whatever array packages you have installed. +# build the image support module - requires agg. By default, matplotlib will +# build support for whatever array packages you have installed. BUILD_IMAGE = 1 # Build the path utilities module. This module depends on some parts @@ -87,9 +85,10 @@ build_subprocess, build_ttconv, print_line, print_status, print_message, \ print_raw, check_for_freetype, check_for_libpng, check_for_gtk, \ check_for_tk, check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, \ - check_for_cairo, check_for_traits, check_for_pytz, check_for_dateutil, \ - check_for_configobj, check_for_dvipng, check_for_ghostscript, \ - check_for_latex, check_for_pdftops, check_for_datetime + check_for_cairo, check_provide_traits, check_provide_pytz, \ + check_provide_dateutil, check_provide_configobj, check_for_dvipng, \ + check_for_ghostscript, check_for_latex, check_for_pdftops, \ + check_for_datetime #import distutils.sysconfig # jdh @@ -248,8 +247,8 @@ print_raw("OPTIONAL DATE/TIMEZONE DEPENDENCIES") hasdatetime = check_for_datetime() -hasdateutil = check_for_dateutil(hasdatetime) -haspytz = check_for_pytz(hasdatetime) +provide_dateutil = check_provide_dateutil(hasdatetime) +provide_pytz = check_provide_pytz(hasdatetime) if hasdatetime: # dates require python23 datetime # only install pytz and dateutil if the user hasn't got them @@ -280,8 +279,8 @@ add_dateutil() else: # only add them if we need them - if not haspytz: add_pytz() - if not hasdateutil: add_dateutil() + if provide_pytz: add_pytz() + if provide_dateutil: add_dateutil() print_raw("") print_raw("OPTIONAL USETEX DEPENDENCIES") @@ -293,8 +292,10 @@ # TODO: comment out for mpl release: print_raw("") print_raw("EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES") -if not check_for_configobj(): py_modules.append('configobj') -if not check_for_traits(): build_traits(ext_modules, packages) +if check_provide_configobj(): + py_modules.append('configobj') +if check_provide_traits(): + build_traits(ext_modules, packages) print_raw("") print_raw("[Edit setup.cfg to suppress the above messages]") Modified: branches/transforms/setupext.py =================================================================== --- branches/transforms/setupext.py 2007-11-11 21:11:35 UTC (rev 4219) +++ branches/transforms/setupext.py 2007-11-12 13:53:38 UTC (rev 4220) @@ -99,16 +99,35 @@ numpy_inc_dirs = [] # Based on the contents of setup.cfg, determine if the status block -# should be displayed +# should be displayed, if missing external packages should be provided display_status = True +provide_pytz = True +provide_dateutil = True +provide_configobj = True +provide_traits = True if os.path.exists("setup.cfg"): config = ConfigParser.SafeConfigParser() config.read("setup.cfg") try: - if config.get("status", "suppress"): - display_status = False + display_status = not config.getboolean("status", "suppress") except: pass + try: + provide_pytz = config.getboolean("provide_packages", "pytz") + except: + pass + try: + provide_dateutil = config.getboolean("provide_packages", "dateutil") + except: + pass + try: + provide_configobj = config.getboolean("provide_packages", "configobj") + except: + pass + try: + provide_traits = config.getboolean("provide_packages", "enthought.traits") + except: + pass if display_status: def print_line(char='='): @@ -300,7 +319,7 @@ print_status("Qt", "no") return False else: - print_status("Qt", "Qt: %s, pyqt: %s" % + print_status("Qt", "Qt: %s, PyQt: %s" % (convert_qt_version(pyqtconfig.Configuration().qt_version), pyqtconfig.Configuration().pyqt_version_str)) return True @@ -312,7 +331,7 @@ print_status("Qt4", "no") return False else: - print_status("Qt4", "Qt: %s, pyqt: %s" % + print_status("Qt4", "Qt: %s, PyQt4: %s" % (convert_qt_version(pyqtconfig.Configuration().qt_version), pyqtconfig.Configuration().pyqt_version_str)) return True @@ -337,57 +356,73 @@ print_status("datetime", "present, version unknown") return True -def check_for_pytz(hasdatetime=True): +def check_provide_pytz(hasdatetime=True): try: import pytz except ImportError: - if hasdatetime: print_status("pytz", "mpl-provided") - else: print_status("pytz", "no") - return False + if hasdatetime and provide_pytz: + print_status("pytz", "matplotlib will provide") + return True + else: + print_status("pytz", "no") + return False else: print_status("pytz", pytz.__version__) - return True + return False -def check_for_dateutil(hasdatetime=True): +def check_provide_dateutil(hasdatetime=True): try: import dateutil except ImportError: - if hasdatetime: print_status("dateutil", "mpl-provided") - else: print_status("dateutil", "no") - return False + if hasdatetime and provide_dateutil: + print_status("dateutil", "matplotlib will provide") + return True + else: + print_status("dateutil", "no") + return False else: try: print_status("dateutil", dateutil.__version__) except AttributeError: print_status("dateutil", "present, version unknown") - return True + return False -def check_for_configobj(): +def check_provide_configobj(): try: import configobj except ImportError: - print_status("configobj", "mpl-provided") - return False + if provide_configobj: + print_status("configobj", "matplotlib will provide") + return True + else: + print_status("configobj", "no") + return False else: print_status("configobj", configobj.__version__) - return True + return False -def check_for_traits(): - gotit = False +def check_provide_traits(): try: from enthought import traits - gotit = True try: from enthought.traits import version except: print_status("enthought.traits", "unknown and incompatible version: < 2.0") - return gotit + return False else: - if version.version.endswith('mpl'): gotit = False - print_status("enthought.traits", version.version) + if version.version.endswith('mpl'): + print_status("enthought.traits", "matplotlib will provide") + return True + else: + print_status("enthought.traits", version.version) + return False except ImportError: - print_status("enthought.traits", "no") - return gotit + if provide_traits: + print_status("enthought.traits", "matplotlib will provide") + return True + else: + print_status("enthought.traits", "no") + return False def check_for_dvipng(): try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |