From: <md...@us...> - 2007-12-05 15:39:46
|
Revision: 4616 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4616&view=rev Author: mdboom Date: 2007-12-05 07:39:39 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Merged revisions 4562-4615 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4571 | jdh2358 | 2007-12-03 21:06:52 -0500 (Mon, 03 Dec 2007) | 1 line applied barrys cocoaagg patch ........ r4572 | jdh2358 | 2007-12-03 22:18:39 -0500 (Mon, 03 Dec 2007) | 1 line colormapped histogram ........ r4576 | jdh2358 | 2007-12-04 09:38:48 -0500 (Tue, 04 Dec 2007) | 2 lines added additional lines to MANIFEST.in ........ r4586 | mdboom | 2007-12-04 14:34:11 -0500 (Tue, 04 Dec 2007) | 2 lines Support '|' as a symbol in mathtext. ........ r4606 | jdh2358 | 2007-12-04 21:47:07 -0500 (Tue, 04 Dec 2007) | 1 line updated install doc ........ r4613 | dsdale | 2007-12-05 09:45:56 -0500 (Wed, 05 Dec 2007) | 2 lines removed .cvsignore files, they are not needed ........ r4614 | jdh2358 | 2007-12-05 10:16:48 -0500 (Wed, 05 Dec 2007) | 2 lines exposed default color cycle ........ Modified Paths: -------------- branches/transforms/API_CHANGES branches/transforms/CODING_GUIDE branches/transforms/INSTALL branches/transforms/MANIFEST.in branches/transforms/examples/poly_editor.py branches/transforms/lib/matplotlib/__init__.py branches/transforms/lib/matplotlib/_mathtext_data.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/backends/backend_cocoaagg.py branches/transforms/lib/matplotlib/image.py branches/transforms/lib/matplotlib/mathtext.py branches/transforms/matplotlibrc.template Added Paths: ----------- branches/transforms/examples/hist_colormapped.py Removed Paths: ------------- branches/transforms/.cvsignore branches/transforms/examples/.cvsignore branches/transforms/lib/matplotlib/.cvsignore branches/transforms/lib/matplotlib/backends/.cvsignore branches/transforms/lib/matplotlib/numerix/.cvsignore branches/transforms/lib/matplotlib/numerix/mlab/.cvsignore Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4561 + /trunk/matplotlib:1-4615 Deleted: branches/transforms/.cvsignore =================================================================== --- branches/transforms/.cvsignore 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/.cvsignore 2007-12-05 15:39:39 UTC (rev 4616) @@ -1,6 +0,0 @@ -build -dist -docs -*.pyc -.project -matplotlibrc Modified: branches/transforms/API_CHANGES =================================================================== --- branches/transforms/API_CHANGES 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/API_CHANGES 2007-12-05 15:39:39 UTC (rev 4616) @@ -169,6 +169,8 @@ END OF TRANSFORMS REFACTORING + Removed, dead/experimental ExampleInfo, Namespace and Importer + code from matplotlib/__init__.py 0.91.1 Released 0.91.0 Released Modified: branches/transforms/CODING_GUIDE =================================================================== --- branches/transforms/CODING_GUIDE 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/CODING_GUIDE 2007-12-05 15:39:39 UTC (rev 4616) @@ -39,8 +39,11 @@ * If you have altered extension code, do you pass unit/memleak_hawaii.py? + * if you have added new files or directories, or reorganized + existing ones, are the new files included in the match patterns in + MANIFEST.in. This file determines what goes into the src + distribution of the mpl build. - == Importing and name spaces == For numpy, use: Modified: branches/transforms/INSTALL =================================================================== --- branches/transforms/INSTALL 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/INSTALL 2007-12-05 15:39:39 UTC (rev 4616) @@ -1,42 +1,42 @@ + INTRODUCTION - matplotlib requires at a minimum python 2.2+, Numeric or numarray - and freetype. To get the most out of matplotlib, you will want to - build some of the optional GUI and image extensions, discussed - below. Matplotlib is known to work on linux, unix, win32 and OS X + matplotlib requires at a minimum python 2.3, numpy, libpng and + freetype. To get the most out of matplotlib, you will want to build + some of the optional GUI and image extensions, discussed below. + Matplotlib is known to work on linux, unix, win32 and OS X platforms. There are two kinds of matplotlib backends: vector based and raster - based. The vector based backends, SVG and PS, produce ASCII text - output files *.svg and *.ps. The core raster based renderer is the - http://antigrain.com (agg) backend. This is a high quality 2D - library that supports fast antialiasing, alpha blending and much - more. If you want to produce PNGs or GUI images that support all of - matplotlib's features, you should compile matplotlib with agg - support and use one of the GUI agg backends: GTKAgg, WXAgg, TkAgg or - FLTKAgg. + based. The vector based backends, SVG, PDF and PS, produce ASCII + text output files *.svg, *.pdf and *.ps. The core raster based + renderer is the http://antigrain.com (agg) backend. This is a high + quality 2D library that supports fast antialiasing, alpha blending + and much more. If you want to produce PNGs or GUI images that + support all of matplotlib's features, you should compile matplotlib + with agg support and use one of the GUI agg backends: GTKAgg, WXAgg, + TkAgg or FLTKAgg. COMPILING - You will need to have recent versions of freetype (>= 2.1.7), libpng - and zlib installed on your system. If you are using a package - manager, also make sure the devel versions of these packages are - also installed (eg freetype-devel). + You will need to have recent versions of freetype, libpng and zlib + installed on your system. If you are using a package manager, also + make sure the devel versions of these packages are also installed + (eg freetype-devel). - The top of setup.py contains some flags controlling which backends - will be built. If you want to use a GUI backend, you will need - either Tkinter, pygtk or wxpython installed on your system, from src - or from a package manager including the devel packages. You can - choose which backends to enable by setting the flags in setup.py, - but the 'auto' flags will work in most cases, as matplotlib tries to - find a GUI and build the backend acccordingly. If you know you - don't want a particular backend or extension, you can set that flag - to False. + matplotlib ships with a setup.cfg.template which you can use to + customize the build process. Copy it to setup.cfg if you need to + customize something. See that files for details of the parameters + you can set. - As discussed above, most users will want to set 'BUILD_AGG = 1' and - one or more of the GUI backends to True. Exceptions to this are if - you know you don't need a GUI (eg a web server) or you only want to - produce vector graphics. + If you want to use a GUI backend, you will need either Tkinter, + pygtk or wxpython installed on your system, from src or from a + package manager including the devel packages. You can choose which + backends to enable by setting the flags in setup.py, but the default + is to automatically detect your installed GUIs and build support for + them. If you later find that you did not have a GUI toolkit like + pygtk installed when you built matplotlib, but now want it, you will + need to install the toolkit and rebuild matplotlib. If you have installed prerequisites to nonstandard places and need to inform matplotlib where they are, edit setupext.py an add the @@ -45,13 +45,6 @@ /some/path/include/somheader.h, put /some/path in the basedir list for your platform. - matplotlib works with with Numeric or numarray. At compile time, - setup.py will look for both packages and compile the appropriate - extensions into matplotlib. At runtime, the correct extension code - will be chosen based on your numerix setting in matplotlibrc. If - you want to be able to use either Numeric or numarray efficiently - with matplotlib, it is important that you have *both* present and in - your PYTHONPATH when you compile matplotlib. Once you have everything above set to your liking, just do the usual thing @@ -62,20 +55,19 @@ WINDOWS If you don't already have python installed, you may want to consider - using the enthought edition of python, which has (old) scipy, Numeric, and + using the enthought edition of python, which has scipy, numpy, and wxpython, plus a lot of other goodies, preinstalled - http://www.enthought.com/python . With the enthought edition of python + matplotlib installer, the following backends should work - out of the box: agg, wx, wxagg, tkagg, ps and svg. + out of the box: agg, wx, wxagg, tkagg, ps, pdf and svg. For standard python installations, you will also need to install - either numpy, Numeric or numarray in addition to the matplotlib installer. - With a standard python + Numeric/numarray + matplotlib, the - following backends should work on windows: agg, tkagg, ps, svg. If - you want others, eg a wx, wxagg, gtk or gtkagg, you'll need to - install the requisite GUI toolkits. This is fairly easy, as both - wxpython and pygtk come with windows friendly installers. The - latter includes an additional requirement of the GTK runtime. + either numpy, in addition to the matplotlib installer. On some + systems you will also need to download msvcp71.dll library, which + you can download from + http://www.dll-files.com/dllindex/dll-files.shtml?msvcp71 or other + sites. You will need to unzip the archive and drag the dll into + c:\windows\system32 All of the GUI backends run on windows, but TkAgg is probably the best for interactive use from the standard python shell or ipython. @@ -113,18 +105,9 @@ DEBIAN - Vittorio Palmisano <re...@em...> maintails the debian - packages at http://mentors.debian.net + matplotlib is part of debian (and ubuntu) so you shoule be able to + apt-get install it. - - * add this lines to your /etc/apt/sources.list: - deb http://anakonda.altervista.org/debian packages/ - deb-src http://anakonda.altervista.org/debian sources/ - - * then run: - # apt-get update - # apt-get install python-matplotlib python-matplotlib-doc - FREEBSD http://www.freshports.org/math/py-matplotlib/ Modified: branches/transforms/MANIFEST.in =================================================================== --- branches/transforms/MANIFEST.in 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/MANIFEST.in 2007-12-05 15:39:39 UTC (rev 4616) @@ -5,8 +5,13 @@ include __init__.py setupext.py setup.py setupegg.py makeswig.py include examples/data/* include lib/matplotlib/toolkits +include lib/matplotlib/mpl-data/matplotlib.conf +include lib/matplotlib/mpl-data/matplotlib.conf.template +include lib/matplotlib/mpl-data/lineprops.glade +include lib/matplotlib/mpl-data/matplotlibrc include lib/matplotlib/mpl-data/images/* include lib/matplotlib/mpl-data/fonts/ttf/* +include lib/matplotlib/mpl-data/fonts/pdfcorefonts/* include lib/matplotlib/mpl-data/fonts/afm/* recursive-include license LICENSE* recursive-include examples README *.py Deleted: branches/transforms/examples/.cvsignore =================================================================== --- branches/transforms/examples/.cvsignore 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/examples/.cvsignore 2007-12-05 15:39:39 UTC (rev 4616) @@ -1,8 +0,0 @@ -*.eps -*.jpeg -*.jpg -*.pdf -*.png -*.ps -*.pyc -*.svg Copied: branches/transforms/examples/hist_colormapped.py (from rev 4614, trunk/matplotlib/examples/hist_colormapped.py) =================================================================== --- branches/transforms/examples/hist_colormapped.py (rev 0) +++ branches/transforms/examples/hist_colormapped.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -0,0 +1,24 @@ +import numpy as n +from pylab import figure, show +import matplotlib.cm as cm +import matplotlib.colors as colors + +fig = figure() +ax = fig.add_subplot(111) +Ntotal = 1000 +N, bins, patches = ax.hist(n.random.rand(Ntotal), 20) + +#I'll color code by height, but you could use any scalar + + +# we need to normalize the data to 0..1 for the full +# range of the colormap +fracs = N.astype(float)/N.max() +norm = colors.normalize(fracs.min(), fracs.max()) + +for thisfrac, thispatch in zip(fracs, patches): + color = cm.jet(norm(thisfrac)) + thispatch.set_facecolor(color) + + +show() Modified: branches/transforms/examples/poly_editor.py =================================================================== --- branches/transforms/examples/poly_editor.py 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/examples/poly_editor.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -9,8 +9,6 @@ from matplotlib.mlab import dist_point_to_segment - - class PolygonInteractor: """ An polygon editor. @@ -74,7 +72,7 @@ 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))) + indseq = nonzero(equal(d, amin(d)))[0] ind = indseq[0] if d[ind]>=self.epsilon: @@ -129,6 +127,7 @@ if event.inaxes is None: return if event.button != 1: return x,y = event.xdata, event.ydata + self.poly.xy[self._ind] = x,y self.line.set_data(zip(*self.poly.xy)) @@ -161,7 +160,7 @@ ax.add_patch(poly) p = PolygonInteractor( ax, poly) -ax.add_line(p.line) +#ax.add_line(p.line) ax.set_title('Click and drag a point to move it') ax.set_xlim((-2,2)) ax.set_ylim((-2,2)) Deleted: branches/transforms/lib/matplotlib/.cvsignore =================================================================== --- branches/transforms/lib/matplotlib/.cvsignore 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/.cvsignore 2007-12-05 15:39:39 UTC (rev 4616) @@ -1,2 +0,0 @@ -*.pyc -.cvsignore \ No newline at end of file Modified: branches/transforms/lib/matplotlib/__init__.py =================================================================== --- branches/transforms/lib/matplotlib/__init__.py 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/__init__.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -55,7 +55,7 @@ """ from __future__ import generators -__version__ = '0.91.1' +__version__ = '0.91.2svn' __revision__ = '$Revision$' __date__ = '$Date$' @@ -784,60 +784,3 @@ verbose.report('platform is %s'%sys.platform) verbose.report('loaded modules: %s'%sys.modules.keys(), 'debug') -class ExampleInfo: - pass - -class ExampleManager: - baseurl = 'http://matplotlib.sf.net' - urls = ['%s/%s'%(baseurl, subdir) for subdir in - ( 'examples', 'examples/widgets')] - - def get_examples(self): - import urllib, re - rgx = re.compile('.*<A HREF="([^.]+\.py)">.*') - examples = [] - for url in urls: - lines = urllib.urlopen(url).readlines() - for line in lines: - m = rgx.match(line) - if m is not None: - examples.append('%s/%s'%(url, m.group(1))) - return examples - - def get_info(self, s): - """ - return an ExampleInfo instance from s, the string content of - an example - """ - pass - -class Namespace: - """ - A class which takes a list of modules and creates an object with - the module naems at attrs - """ - def __init__(self, namespace): - for k,v in namespace.items(): - modname = getattr(v, '__name__', None) - if modname is None: continue - if modname.startswith('matplotlib.'): - self.__dict__[modname.replace('matplotlib.', '')] = v - - -class Importer: - def __init__(self, modstr): - """ - import a bunch of matplotlib modules listed in modstr into a - single namespace. Eg, - - mpl = Importer('artist, cbook, lines, patches') - print mpl.cbook.iterable(1) - """ - for name in modstr.split(','): - name = name.strip() - wholename = '.'.join(['matplotlib', name]) - basemod = __import__(wholename) - mod = getattr(basemod, name) - setattr(self, name, mod) - - Modified: branches/transforms/lib/matplotlib/_mathtext_data.py =================================================================== --- branches/transforms/lib/matplotlib/_mathtext_data.py 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/_mathtext_data.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -88,7 +88,8 @@ r'\phi' : ('cmmi10', 42), r'\chi' : ('cmmi10', 17), r'\psi' : ('cmmi10', 31), - + r'|' : ('cmsy10', 47), + r'\|' : ('cmsy10', 47), r'(' : ('cmr10', 119), r'\leftparen' : ('cmr10', 119), r'\rightparen' : ('cmr10', 68), @@ -1771,6 +1772,7 @@ 'succnsim': 8937, 'gimel': 8503, 'vert': 124, +'|': 124, 'varrho': 1009, 'P': 182, 'approxident': 8779, Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/axes.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -150,13 +150,14 @@ an arbitrary number of x, y, fmt are allowed """ + defaultColors = ['b','g','r','c','m','y','k'] def __init__(self, axes, command='plot'): self.axes = axes self.command = command self._clear_color_cycle() def _clear_color_cycle(self): - self.colors = ['b','g','r','c','m','y','k'] + self.colors = _process_plot_var_args.defaultColors[:] # if the default line color is a color format string, move it up # in the que try: ind = self.colors.index(rcParams['lines.color']) Deleted: branches/transforms/lib/matplotlib/backends/.cvsignore =================================================================== --- branches/transforms/lib/matplotlib/backends/.cvsignore 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/backends/.cvsignore 2007-12-05 15:39:39 UTC (rev 4616) @@ -1,2 +0,0 @@ -*.pyc -.cvsignore \ No newline at end of file Modified: branches/transforms/lib/matplotlib/backends/backend_cocoaagg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_cocoaagg.py 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/backends/backend_cocoaagg.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -78,8 +78,8 @@ self.plotWindow.setDelegate_(self)#.plotView) self.plotView.setImageFrameStyle_(NSImageFrameGroove) - self.plotView.image = NSImage.alloc().initWithSize_((0,0)) - self.plotView.setImage_(self.plotView.image) + self.plotView.image_ = NSImage.alloc().initWithSize_((0,0)) + self.plotView.setImage_(self.plotView.image_) # Make imageview first responder for key events self.plotWindow.makeFirstResponder_(self.plotView) @@ -112,10 +112,10 @@ w,h = self.canvas.get_width_height() # Remove all previous images - for i in xrange(self.image.representations().count()): - self.image.removeRepresentation_(self.image.representations().objectAtIndex_(i)) + for i in xrange(self.image_.representations().count()): + self.image_.removeRepresentation_(self.image_.representations().objectAtIndex_(i)) - self.image.setSize_((w,h)) + self.image_.setSize_((w,h)) brep = NSBitmapImageRep.alloc().initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel_( (self.canvas.buffer_rgba(0,0),'','','',''), # Image data @@ -129,7 +129,7 @@ w*4, # row bytes 32) # bits per pixel - self.image.addRepresentation_(brep) + self.image_.addRepresentation_(brep) self.setNeedsDisplay_(True) def windowDidResize_(self, sender): Modified: branches/transforms/lib/matplotlib/image.py =================================================================== --- branches/transforms/lib/matplotlib/image.py 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/image.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -239,6 +239,8 @@ self.set_data(A) + + def set_extent(self, extent): """extent is data axes (left, right, bottom, top) for making image plots """ Modified: branches/transforms/lib/matplotlib/mathtext.py =================================================================== --- branches/transforms/lib/matplotlib/mathtext.py 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/mathtext.py 2007-12-05 15:39:39 UTC (rev 4616) @@ -2019,7 +2019,7 @@ ).setParseAction(self.customspace).setName('customspace') unicode_range = u"\U00000080-\U0001ffff" - symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()%s])|(\\[%%${}\[\]_])" % unicode_range) + symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()|%s])|(\\[%%${}\[\]_|])" % unicode_range) | Combine( bslash + oneOf(tex2uni.keys()) Deleted: branches/transforms/lib/matplotlib/numerix/.cvsignore =================================================================== --- branches/transforms/lib/matplotlib/numerix/.cvsignore 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/numerix/.cvsignore 2007-12-05 15:39:39 UTC (rev 4616) @@ -1,2 +0,0 @@ -*.pyc -.cvsignore \ No newline at end of file Deleted: branches/transforms/lib/matplotlib/numerix/mlab/.cvsignore =================================================================== --- branches/transforms/lib/matplotlib/numerix/mlab/.cvsignore 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/lib/matplotlib/numerix/mlab/.cvsignore 2007-12-05 15:39:39 UTC (rev 4616) @@ -1 +0,0 @@ -*.pyc Modified: branches/transforms/matplotlibrc.template =================================================================== --- branches/transforms/matplotlibrc.template 2007-12-05 15:36:48 UTC (rev 4615) +++ branches/transforms/matplotlibrc.template 2007-12-05 15:39:39 UTC (rev 4616) @@ -25,7 +25,7 @@ #### CONFIGURATION BEGINS HERE # the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg -# Agg Cairo GD GDK Paint PS PDF SVG Template +# WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template backend : %(backend)s numerix : %(numerix)s # numpy, Numeric or numarray #maskedarray : False # True to use external maskedarray module This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |