You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(4) |
2
|
3
(8) |
4
(16) |
5
(40) |
6
(16) |
7
(9) |
8
(15) |
9
(6) |
10
(4) |
11
(28) |
12
(6) |
13
(2) |
14
(7) |
15
(8) |
16
|
17
|
18
(9) |
19
(2) |
20
(7) |
21
(3) |
22
(6) |
23
(25) |
24
(16) |
25
(8) |
26
(7) |
27
(3) |
28
(1) |
29
(4) |
30
(21) |
31
(15) |
|
|
|
|
|
Revision: 7373 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7373&view=rev Author: jdh2358 Date: 2009年08月05日 15:37:08 +0000 (2009年8月05日) Log Message: ----------- make all-in-one sample data server class cbook.ViewVCCachedServer so it can be reused by other projects Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2009年08月05日 15:26:30 UTC (rev 7372) +++ trunk/matplotlib/CHANGELOG 2009年08月05日 15:37:08 UTC (rev 7373) @@ -1,4 +1,5 @@ -2009年08月04日 Made cbook.get_mpl_data make use of the ETag and Last-Modified + +2009年08月04日 Made cbook.get_sample_data make use of the ETag and Last-Modified headers of mod_dav_svn. - JKS 2009年08月03日 Add PathCollection; modify contourf to use complex @@ -6,9 +7,9 @@ 2009年08月03日 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS -2009年07月31日 Added cbook.get_mpl_data for urllib enabled fetching and +2009年07月31日 Added cbook.get_sample_data for urllib enabled fetching and cacheing of data needed for examples. See - examples/misc/mpl_data_demo.py - JDH + examples/misc/sample_data_demo.py - JDH ====================================================================== Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 15:26:30 UTC (rev 7372) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 15:37:08 UTC (rev 7373) @@ -344,7 +344,7 @@ def is_scalar_or_string(val): return is_string_like(val) or not iterable(val) -class _CacheProcessor(urllib2.BaseHandler): +class ViewVCCachedServer(urllib2.BaseHandler): """ Urllib2 handler that takes care of caching files. The file cache.pck holds the directory of files to be cached. @@ -354,6 +354,7 @@ self.baseurl = baseurl self.read_cache() self.remove_stale_files() + self.opener = urllib2.build_opener(self) def in_cache_dir(self, fn): # make sure the datadir exists @@ -394,7 +395,7 @@ if path not in listed and path != 'cache.pck': thisfile = os.path.join(self.cache_dir, path) if not os.path.isdir(thisfile): - matplotlib.verbose.report('_CacheProcessor:remove_stale_files: removing %s'%thisfile, + matplotlib.verbose.report('ViewVCCachedServer:remove_stale_files: removing %s'%thisfile, level='debug') os.remove(thisfile) @@ -451,7 +452,7 @@ url = req.get_full_url() fn, _, _ = self.cache[url] cachefile = self.in_cache_dir(fn) - matplotlib.verbose.report('_CacheProcessor: reading data file from cache file "%s"'%cachefile) + matplotlib.verbose.report('ViewVCCachedServer: reading data file from cache file "%s"'%cachefile) file = open(cachefile, 'rb') handle = urllib2.addinfourl(file, hdrs, url) handle.code = 304 @@ -473,9 +474,41 @@ result.msg = response.msg return result + def get_sample_data(self, fname, asfileobj=True): + """ + Check the cachedirectory for a sample_data file. If it does + not exist, fetch it with urllib from the svn repo and + store it in the cachedir. + + If asfileobj is True, a file object will be returned. Else the + path to the file as a string will be returned + + """ + + + # quote is not in python2.4, so check for it and get it from + # urllib if it is not available + quote = getattr(urllib2, 'quote', None) + if quote is None: + import urllib + quote = urllib.quote + + url = self.baseurl + quote(fname) + response = self.opener.open(url) + + + relpath = self.cache[url][0] + fname = self.in_cache_dir(relpath) + + if asfileobj: + return file(fname) + else: + return fname + + def get_sample_data(fname, asfileobj=True): """ - Check the cachedirectory ~/.matplotlib/sample_data for an sample_data + Check the cachedirectory ~/.matplotlib/sample_data for a sample_data file. If it does not exist, fetch it with urllib from the mpl svn repo http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/ @@ -488,42 +521,22 @@ To add a datafile to this directory, you need to check out sample_data from matplotlib svn:: - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data + svn co http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data and svn add the data file you want to support. This is primarily intended for use in mpl examples that need custom data """ - baseurl ='http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/' - if not hasattr(get_sample_data, 'opener'): + myserver = get_sample_data.myserver + if myserver is None: configdir = matplotlib.get_configdir() cachedir = os.path.join(configdir, 'sample_data') - if not os.path.exists(cachedir): - os.mkdir(cachedir) - # Store the cache processor and url opener as attributes of this function - get_sample_data.processor = _CacheProcessor(cachedir, baseurl) - get_sample_data.opener = urllib2.build_opener(get_sample_data.processor) + baseurl = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/' + myserver = get_sample_data.myserver = ViewVCCachedServer(cachedir, baseurl) + return myserver.get_sample_data(fname, asfileobj=asfileobj) - # quote is not in python2.4, so check for it and get it from - # urllib if it is not available - quote = getattr(urllib2, 'quote', None) - if quote is None: - import urllib - quote = urllib.quote - - url = baseurl + quote(fname) - response = get_sample_data.opener.open(url) - - p = get_sample_data.processor - relpath = p.cache[url][0] - fname = p.in_cache_dir(relpath) - - if asfileobj: - return file(fname) - else: - return fname - +get_sample_data.myserver = None def flatten(seq, scalarp=is_scalar_or_string): """ this generator flattens nested containers such as This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7372 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7372&view=rev Author: evilguru Date: 2009年08月05日 15:26:30 +0000 (2009年8月05日) Log Message: ----------- Enable caching for mathtex expressions. This delivers a big performance boost when panning/zooming. Modified Paths: -------------- branches/mathtex/lib/matplotlib/backends/backend_agg.py branches/mathtex/lib/matplotlib/backends/backend_cairo.py branches/mathtex/lib/matplotlib/backends/backend_gdk.py branches/mathtex/lib/matplotlib/backends/backend_macosx.py branches/mathtex/lib/matplotlib/backends/backend_pdf.py branches/mathtex/lib/matplotlib/backends/backend_ps.py Modified: branches/mathtex/lib/matplotlib/backends/backend_agg.py =================================================================== --- branches/mathtex/lib/matplotlib/backends/backend_agg.py 2009年08月05日 15:14:35 UTC (rev 7371) +++ branches/mathtex/lib/matplotlib/backends/backend_agg.py 2009年08月05日 15:26:30 UTC (rev 7372) @@ -111,7 +111,7 @@ 'debug-annoying') if HAVE_MATHTEX: m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - self.dpi, rcParams['mathtext.default']) + self.dpi, rcParams['mathtext.default'], cache=True) b = MathtexBackendImage() m.render_to_backend(b) @@ -166,7 +166,7 @@ return 0.0, 0.0, 0.0 else: m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - self.dpi, rcParams['mathtext.default']) + self.dpi, rcParams['mathtext.default'], cache=True) return m.width, m.height, m.depth font = self._get_agg_font(prop) font.set_text(s, 0.0, flags=LOAD_FORCE_AUTOHINT) # the width and height of unrotated string Modified: branches/mathtex/lib/matplotlib/backends/backend_cairo.py =================================================================== --- branches/mathtex/lib/matplotlib/backends/backend_cairo.py 2009年08月05日 15:14:35 UTC (rev 7371) +++ branches/mathtex/lib/matplotlib/backends/backend_cairo.py 2009年08月05日 15:26:30 UTC (rev 7372) @@ -211,7 +211,7 @@ ctx = gc.ctx m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - self.dpi, rcParams['mathtext.default']) + self.dpi, rcParams['mathtext.default'], cache=True) b = MathtexBackendCairo() m.render_to_backend(b) @@ -242,7 +242,7 @@ if ismath: if HAVE_MATHTEX: m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - self.dpi, rcParams['mathtext.default']) + self.dpi, rcParams['mathtext.default'], cache=True) return m.width, m.height, m.depth else: warnings.warn('matplotlib was compiled without mathtex support. ' + Modified: branches/mathtex/lib/matplotlib/backends/backend_gdk.py =================================================================== --- branches/mathtex/lib/matplotlib/backends/backend_gdk.py 2009年08月05日 15:14:35 UTC (rev 7371) +++ branches/mathtex/lib/matplotlib/backends/backend_gdk.py 2009年08月05日 15:26:30 UTC (rev 7372) @@ -167,7 +167,8 @@ return m = Mathtex(s, matplotlib.rcParams['mathtext.fontset'], - prop.get_size_in_points(), self.dpi, rcParams['mathtext.default']) + prop.get_size_in_points(), self.dpi, rcParams['mathtext.default'], + cache=True) b = MathtexBackendImage() m.render_to_backend(b) @@ -318,7 +319,8 @@ return 0.0, 0.0, 0.0 else: m = Mathtex(s, matplotlib.rcParams['mathtext.fontset'], - prop.get_size_in_points(), self.dpi, rcParams['mathtext.default']) + prop.get_size_in_points(), self.dpi, rcParams['mathtext.default'], + cache=True) return m.width, m.height, m.depth layout, inkRect, logicalRect = self._get_pango_layout(s, prop) Modified: branches/mathtex/lib/matplotlib/backends/backend_macosx.py =================================================================== --- branches/mathtex/lib/matplotlib/backends/backend_macosx.py 2009年08月05日 15:14:35 UTC (rev 7371) +++ branches/mathtex/lib/matplotlib/backends/backend_macosx.py 2009年08月05日 15:26:30 UTC (rev 7372) @@ -98,7 +98,7 @@ return m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - self.dpi, rcParams['mathtext.default']) + self.dpi, rcParams['mathtext.default'], cache=True) b = MathtexBackendImage() m.render_to_backend(b) @@ -126,7 +126,8 @@ if ismath: if HAVE_MATHTEX: m = Mathtex(s, rcParams['mathtext.fontset'], - prop.get_size_in_points(), self.dpi, rcParams['mathtext.default']) + prop.get_size_in_points(), self.dpi, rcParams['mathtext.default'], + cache=True) return m.width, m.height, m.depth else: warnings.warn('matplotlib was compiled without mathtex support. ' + Modified: branches/mathtex/lib/matplotlib/backends/backend_pdf.py =================================================================== --- branches/mathtex/lib/matplotlib/backends/backend_pdf.py 2009年08月05日 15:14:35 UTC (rev 7371) +++ branches/mathtex/lib/matplotlib/backends/backend_pdf.py 2009年08月05日 15:26:30 UTC (rev 7372) @@ -1352,7 +1352,7 @@ return m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - 72.0, rcParams['mathtext.default']) + 72.0, rcParams['mathtext.default'], cache=True) # Generate the dict of used characters used_characters = {} @@ -1669,7 +1669,8 @@ w, h, d = 0.0, 0.0, 0.0 else: m = Mathtex(s, rcParams['mathtext.fontset'], - prop.get_size_in_points(), 72.0, rcParams['mathtext.default']) + prop.get_size_in_points(), 72.0, rcParams['mathtext.default'], + cache=True) w, h, d = m.width, m.height, m.depth elif rcParams['pdf.use14corefonts']: Modified: branches/mathtex/lib/matplotlib/backends/backend_ps.py =================================================================== --- branches/mathtex/lib/matplotlib/backends/backend_ps.py 2009年08月05日 15:14:35 UTC (rev 7371) +++ branches/mathtex/lib/matplotlib/backends/backend_ps.py 2009年08月05日 15:26:30 UTC (rev 7372) @@ -283,7 +283,7 @@ if ismath: if HAVE_MATHTEX: m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - 72.0, rcParams['mathtext.default']) + 72.0, rcParams['mathtext.default'], cache=True) return m.width, m.height, m.depth else: warnings.warn('matplotlib was compiled without mathtex support. ' + @@ -752,7 +752,7 @@ return m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(), - 72.0, rcParams['mathtext.default']) + 72.0, rcParams['mathtext.default'], cache=True) # Generate the dict of used characters used_characters = {} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7371 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7371&view=rev Author: jdh2358 Date: 2009年08月05日 15:14:35 +0000 (2009年8月05日) Log Message: ----------- use proper file handle to the sample data Modified Paths: -------------- trunk/matplotlib/examples/misc/sample_data_test.py trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/examples/misc/sample_data_test.py =================================================================== --- trunk/matplotlib/examples/misc/sample_data_test.py 2009年08月05日 15:07:41 UTC (rev 7370) +++ trunk/matplotlib/examples/misc/sample_data_test.py 2009年08月05日 15:14:35 UTC (rev 7371) @@ -8,6 +8,19 @@ svn version will be cached in ~/.matplotlib/sample_data) """ +import matplotlib.mlab as mlab import matplotlib.cbook as cbook -fh = cbook.get_sample_data('testdir/subdir/testsub.csv') + +# get the file handle to the cached data and print the contents +datafile = 'testdir/subdir/testsub.csv' +fh = cbook.get_sample_data(datafile) print fh.read() + +# make sure we can read it using csv2rec +fh.seek(0) +r = mlab.csv2rec(fh) + +print mlab.rec2txt(r) + +fh.close() + Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 15:07:41 UTC (rev 7370) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 15:14:35 UTC (rev 7371) @@ -418,8 +418,8 @@ #while os.path.exists(self.in_cache_dir(fn)): # fn = rightmost + '.' + str(random.randint(0,9999999)) - - + + f = open(self.in_cache_dir(fn), 'wb') f.write(data) f.close() @@ -514,12 +514,15 @@ url = baseurl + quote(fname) response = get_sample_data.opener.open(url) + + p = get_sample_data.processor + relpath = p.cache[url][0] + fname = p.in_cache_dir(relpath) + if asfileobj: - return response + return file(fname) else: - response.close() - p = get_sample_data.processor - return p.in_cache_dir(p.cache[url][0]) + return fname def flatten(seq, scalarp=is_scalar_or_string): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7370 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7370&view=rev Author: jdh2358 Date: 2009年08月05日 15:07:41 +0000 (2009年8月05日) Log Message: ----------- add support for nested dirs in sample_data Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 15:02:12 UTC (rev 7369) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 15:07:41 UTC (rev 7370) @@ -356,8 +356,14 @@ self.remove_stale_files() def in_cache_dir(self, fn): - return os.path.join(self.cache_dir, fn) + # make sure the datadir exists + reldir, filename = os.path.split(fn) + datadir = os.path.join(self.cache_dir, reldir) + if not os.path.exists(datadir): + os.makedirs(datadir) + return os.path.join(datadir, filename) + def read_cache(self): """ Read the cache file from the cache directory. @@ -386,7 +392,11 @@ listed = set([fn for (_, (fn, _, _)) in self.cache.items()]) for path in os.listdir(self.cache_dir): if path not in listed and path != 'cache.pck': - os.remove(os.path.join(self.cache_dir, path)) + thisfile = os.path.join(self.cache_dir, path) + if not os.path.isdir(thisfile): + matplotlib.verbose.report('_CacheProcessor:remove_stale_files: removing %s'%thisfile, + level='debug') + os.remove(thisfile) def write_cache(self): """ @@ -402,12 +412,14 @@ Store a received file in the cache directory. """ # Pick a filename - rightmost = url.rstrip('/').split('/')[-1] - fn = rightmost - while os.path.exists(self.in_cache_dir(fn)): - fn = rightmost + '.' + str(random.randint(0,9999999)) + fn = url[len(self.baseurl):] + fullpath = self.in_cache_dir(fn) - # Write out the data + #while os.path.exists(self.in_cache_dir(fn)): + # fn = rightmost + '.' + str(random.randint(0,9999999)) + + + f = open(self.in_cache_dir(fn), 'wb') f.write(data) f.close() @@ -438,7 +450,9 @@ """ url = req.get_full_url() fn, _, _ = self.cache[url] - file = open(self.in_cache_dir(fn), 'rb') + cachefile = self.in_cache_dir(fn) + matplotlib.verbose.report('_CacheProcessor: reading data file from cache file "%s"'%cachefile) + file = open(cachefile, 'rb') handle = urllib2.addinfourl(file, hdrs, url) handle.code = 304 return handle @@ -480,13 +494,14 @@ intended for use in mpl examples that need custom data """ + baseurl ='http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/' if not hasattr(get_sample_data, 'opener'): configdir = matplotlib.get_configdir() cachedir = os.path.join(configdir, 'sample_data') if not os.path.exists(cachedir): os.mkdir(cachedir) # Store the cache processor and url opener as attributes of this function - get_sample_data.processor = _CacheProcessor(cachedir) + get_sample_data.processor = _CacheProcessor(cachedir, baseurl) get_sample_data.opener = urllib2.build_opener(get_sample_data.processor) @@ -497,8 +512,7 @@ import urllib quote = urllib.quote - url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/' + \ - quote(fname) + url = baseurl + quote(fname) response = get_sample_data.opener.open(url) if asfileobj: return response This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7369 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7369&view=rev Author: jdh2358 Date: 2009年08月05日 15:02:12 +0000 (2009年8月05日) Log Message: ----------- add support for nested dirs in sample_data Modified Paths: -------------- trunk/matplotlib/examples/misc/sample_data_test.py trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/examples/misc/sample_data_test.py =================================================================== --- trunk/matplotlib/examples/misc/sample_data_test.py 2009年08月05日 14:54:01 UTC (rev 7368) +++ trunk/matplotlib/examples/misc/sample_data_test.py 2009年08月05日 15:02:12 UTC (rev 7369) @@ -9,5 +9,5 @@ """ import matplotlib.cbook as cbook -fh = cbook.get_sample_data("testdata.csv") +fh = cbook.get_sample_data('testdir/subdir/testsub.csv') print fh.read() Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 14:54:01 UTC (rev 7368) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 15:02:12 UTC (rev 7369) @@ -349,8 +349,9 @@ Urllib2 handler that takes care of caching files. The file cache.pck holds the directory of files to be cached. """ - def __init__(self, cache_dir): + def __init__(self, cache_dir, baseurl): self.cache_dir = cache_dir + self.baseurl = baseurl self.read_cache() self.remove_stale_files() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7368 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7368&view=rev Author: jdh2358 Date: 2009年08月05日 14:54:01 +0000 (2009年8月05日) Log Message: ----------- make a nested subdir for testing Added Paths: ----------- trunk/sample_data/testdir/ trunk/sample_data/testdir/subdir/ trunk/sample_data/testdir/subdir/testsub.csv Added: trunk/sample_data/testdir/subdir/testsub.csv =================================================================== --- trunk/sample_data/testdir/subdir/testsub.csv (rev 0) +++ trunk/sample_data/testdir/subdir/testsub.csv 2009年08月05日 14:54:01 UTC (rev 7368) @@ -0,0 +1,5 @@ +name,age +john,41 +miriam,38 +rahel,11 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7367 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7367&view=rev Author: jdh2358 Date: 2009年08月05日 14:44:18 +0000 (2009年8月05日) Log Message: ----------- make urllib quote python2.4 compliant Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 14:39:36 UTC (rev 7366) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 14:44:18 UTC (rev 7367) @@ -488,8 +488,16 @@ get_sample_data.processor = _CacheProcessor(cachedir) get_sample_data.opener = urllib2.build_opener(get_sample_data.processor) + + # quote is not in python2.4, so check for it and get it from + # urllib if it is not available + quote = getattr(urllib2, 'quote', None) + if quote is None: + import urllib + quote = urllib.quote + url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/' + \ - urllib2.quote(fname) + quote(fname) response = get_sample_data.opener.open(url) if asfileobj: return response This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7366 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7366&view=rev Author: jdh2358 Date: 2009年08月05日 14:39:36 +0000 (2009年8月05日) Log Message: ----------- rename mpl_data to sample_data to avoid ambiguity with lib/matplotlib/mpl-data Added Paths: ----------- trunk/matplotlib/examples/misc/sample_data_demo.py trunk/matplotlib/examples/misc/sample_data_test.py Removed Paths: ------------- trunk/matplotlib/examples/misc/mpl_data_demo.py trunk/matplotlib/examples/misc/mpl_data_test.py Deleted: trunk/matplotlib/examples/misc/mpl_data_demo.py =================================================================== --- trunk/matplotlib/examples/misc/mpl_data_demo.py 2009年08月05日 14:38:44 UTC (rev 7365) +++ trunk/matplotlib/examples/misc/mpl_data_demo.py 2009年08月05日 14:39:36 UTC (rev 7366) @@ -1,12 +0,0 @@ -""" -Grab mpl data from the ~/.matplotlib/sample_data cache if it exists, else -fetch it from svn and cache it -""" -import matplotlib.cbook as cbook -import matplotlib.pyplot as plt -fname = cbook.get_sample_data('lena.png', asfileobj=False) - -print 'fname', fname -im = plt.imread(fname) -plt.imshow(im) -plt.show() Deleted: trunk/matplotlib/examples/misc/mpl_data_test.py =================================================================== --- trunk/matplotlib/examples/misc/mpl_data_test.py 2009年08月05日 14:38:44 UTC (rev 7365) +++ trunk/matplotlib/examples/misc/mpl_data_test.py 2009年08月05日 14:39:36 UTC (rev 7366) @@ -1,13 +0,0 @@ -""" -Demonstrate how get_sample_data works with svn revisions in the data. - - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data - -and edit testdata.csv to add a new row. After committing the changes, -when you rerun this script you will get the updated data (and the new -svn version will be cached in ~/.matplotlib/sample_data) -""" - -import matplotlib.cbook as cbook -fh = cbook.get_sample_data("testdata.csv") -print fh.read() Copied: trunk/matplotlib/examples/misc/sample_data_demo.py (from rev 7365, trunk/matplotlib/examples/misc/mpl_data_demo.py) =================================================================== --- trunk/matplotlib/examples/misc/sample_data_demo.py (rev 0) +++ trunk/matplotlib/examples/misc/sample_data_demo.py 2009年08月05日 14:39:36 UTC (rev 7366) @@ -0,0 +1,12 @@ +""" +Grab mpl data from the ~/.matplotlib/sample_data cache if it exists, else +fetch it from svn and cache it +""" +import matplotlib.cbook as cbook +import matplotlib.pyplot as plt +fname = cbook.get_sample_data('lena.png', asfileobj=False) + +print 'fname', fname +im = plt.imread(fname) +plt.imshow(im) +plt.show() Copied: trunk/matplotlib/examples/misc/sample_data_test.py (from rev 7365, trunk/matplotlib/examples/misc/mpl_data_test.py) =================================================================== --- trunk/matplotlib/examples/misc/sample_data_test.py (rev 0) +++ trunk/matplotlib/examples/misc/sample_data_test.py 2009年08月05日 14:39:36 UTC (rev 7366) @@ -0,0 +1,13 @@ +""" +Demonstrate how get_sample_data works with svn revisions in the data. + + svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data + +and edit testdata.csv to add a new row. After committing the changes, +when you rerun this script you will get the updated data (and the new +svn version will be cached in ~/.matplotlib/sample_data) +""" + +import matplotlib.cbook as cbook +fh = cbook.get_sample_data("testdata.csv") +print fh.read() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7365 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7365&view=rev Author: jdh2358 Date: 2009年08月05日 14:38:44 +0000 (2009年8月05日) Log Message: ----------- rename mpl_data to sample_data to avoid ambiguity with lib/matplotlib/mpl-data Modified Paths: -------------- trunk/matplotlib/examples/misc/mpl_data_demo.py trunk/matplotlib/examples/misc/mpl_data_test.py trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/examples/misc/mpl_data_demo.py =================================================================== --- trunk/matplotlib/examples/misc/mpl_data_demo.py 2009年08月05日 14:36:27 UTC (rev 7364) +++ trunk/matplotlib/examples/misc/mpl_data_demo.py 2009年08月05日 14:38:44 UTC (rev 7365) @@ -1,10 +1,10 @@ """ -Grab mpl data from the ~/.matplotlib/mpl_data cache if it exists, else +Grab mpl data from the ~/.matplotlib/sample_data cache if it exists, else fetch it from svn and cache it """ import matplotlib.cbook as cbook import matplotlib.pyplot as plt -fname = cbook.get_mpl_data('lena.png', asfileobj=False) +fname = cbook.get_sample_data('lena.png', asfileobj=False) print 'fname', fname im = plt.imread(fname) Modified: trunk/matplotlib/examples/misc/mpl_data_test.py =================================================================== --- trunk/matplotlib/examples/misc/mpl_data_test.py 2009年08月05日 14:36:27 UTC (rev 7364) +++ trunk/matplotlib/examples/misc/mpl_data_test.py 2009年08月05日 14:38:44 UTC (rev 7365) @@ -1,13 +1,13 @@ """ -Demonstrate how get_mpl_data works with svn revisions in the data. +Demonstrate how get_sample_data works with svn revisions in the data. - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/mpl_data + svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data and edit testdata.csv to add a new row. After committing the changes, when you rerun this script you will get the updated data (and the new -svn version will be cached in ~/.matplotlib/mpl_data) +svn version will be cached in ~/.matplotlib/sample_data) """ import matplotlib.cbook as cbook -fh = cbook.get_mpl_data("testdata.csv") +fh = cbook.get_sample_data("testdata.csv") print fh.read() Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 14:36:27 UTC (rev 7364) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 14:38:44 UTC (rev 7365) @@ -458,12 +458,12 @@ result.msg = response.msg return result -def get_mpl_data(fname, asfileobj=True): +def get_sample_data(fname, asfileobj=True): """ - Check the cachedirectory ~/.matplotlib/mpl_data for an mpl_data + Check the cachedirectory ~/.matplotlib/sample_data for an sample_data file. If it does not exist, fetch it with urllib from the mpl svn repo - http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/ + http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/ and store it in the cachedir. @@ -471,31 +471,31 @@ path to the file as a string will be returned To add a datafile to this directory, you need to check out - mpl_data from matplotlib svn:: + sample_data from matplotlib svn:: - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/mpl_data + svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data and svn add the data file you want to support. This is primarily intended for use in mpl examples that need custom data """ - if not hasattr(get_mpl_data, 'opener'): + if not hasattr(get_sample_data, 'opener'): configdir = matplotlib.get_configdir() - cachedir = os.path.join(configdir, 'mpl_data') + cachedir = os.path.join(configdir, 'sample_data') if not os.path.exists(cachedir): os.mkdir(cachedir) # Store the cache processor and url opener as attributes of this function - get_mpl_data.processor = _CacheProcessor(cachedir) - get_mpl_data.opener = urllib2.build_opener(get_mpl_data.processor) + get_sample_data.processor = _CacheProcessor(cachedir) + get_sample_data.opener = urllib2.build_opener(get_sample_data.processor) - url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/' + \ + url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/sample_data/' + \ urllib2.quote(fname) - response = get_mpl_data.opener.open(url) + response = get_sample_data.opener.open(url) if asfileobj: return response else: response.close() - p = get_mpl_data.processor + p = get_sample_data.processor return p.in_cache_dir(p.cache[url][0]) def flatten(seq, scalarp=is_scalar_or_string): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7364 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7364&view=rev Author: jdh2358 Date: 2009年08月05日 14:36:27 +0000 (2009年8月05日) Log Message: ----------- rename mpl_data sample_data Added Paths: ----------- trunk/sample_data/ Removed Paths: ------------- trunk/mpl_data/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7363 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7363&view=rev Author: jdh2358 Date: 2009年08月05日 14:35:06 +0000 (2009年8月05日) Log Message: ----------- Merged revisions 7353,7358-7359 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint ........ r7353 | jdh2358 | 2009年08月04日 13:46:41 -0500 (2009年8月04日) | 1 line attach gtk events to mpl events -- fixes sf bug 2816580 ........ r7358 | jdh2358 | 2009年08月04日 21:29:12 -0500 (2009年8月04日) | 1 line some fixes for osx builds on rc2 ........ r7359 | jdh2358 | 2009年08月05日 06:06:13 -0500 (2009年8月05日) | 1 line remove dup gui event in enter/leave events in gtk ........ Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py trunk/matplotlib/release/osx/Makefile trunk/matplotlib/release/osx/README.txt Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7345 + /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7362 Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2009年08月05日 12:04:36 UTC (rev 7362) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2009年08月05日 14:35:06 UTC (rev 7363) @@ -4,7 +4,7 @@ <p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a> to support matplotlib development.</p> -<p>A release candidate rc1 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a> +<p>A release candidate rc2 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a> </p> <p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>. Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2009年08月05日 12:04:36 UTC (rev 7362) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2009年08月05日 14:35:06 UTC (rev 7363) @@ -197,7 +197,7 @@ step = 1 else: step = -1 - FigureCanvasBase.scroll_event(self, x, y, step) + FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event) return False # finish event propagation? def button_press_event(self, widget, event): @@ -205,7 +205,7 @@ x = event.x # flipy so y=0 is bottom of canvas y = self.allocation.height - event.y - FigureCanvasBase.button_press_event(self, x, y, event.button) + FigureCanvasBase.button_press_event(self, x, y, event.button, guiEvent=event) return False # finish event propagation? def button_release_event(self, widget, event): @@ -213,21 +213,21 @@ x = event.x # flipy so y=0 is bottom of canvas y = self.allocation.height - event.y - FigureCanvasBase.button_release_event(self, x, y, event.button) + FigureCanvasBase.button_release_event(self, x, y, event.button, guiEvent=event) return False # finish event propagation? def key_press_event(self, widget, event): if _debug: print 'FigureCanvasGTK.%s' % fn_name() key = self._get_key(event) if _debug: print "hit", key - FigureCanvasBase.key_press_event(self, key) + FigureCanvasBase.key_press_event(self, key, guiEvent=event) return False # finish event propagation? def key_release_event(self, widget, event): if _debug: print 'FigureCanvasGTK.%s' % fn_name() key = self._get_key(event) if _debug: print "release", key - FigureCanvasBase.key_release_event(self, key) + FigureCanvasBase.key_release_event(self, key, guiEvent=event) return False # finish event propagation? def motion_notify_event(self, widget, event): @@ -239,7 +239,7 @@ # flipy so y=0 is bottom of canvas y = self.allocation.height - y - FigureCanvasBase.motion_notify_event(self, x, y) + FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event) return False # finish event propagation? def leave_notify_event(self, widget, event): Modified: trunk/matplotlib/release/osx/Makefile =================================================================== --- trunk/matplotlib/release/osx/Makefile 2009年08月05日 12:04:36 UTC (rev 7362) +++ trunk/matplotlib/release/osx/Makefile 2009年08月05日 14:35:06 UTC (rev 7363) @@ -1,10 +1,10 @@ -PYVERSION=2.6 +PYVERSION=2.5 PYTHON=python${PYVERSION} SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 FREETYPEVERSION=2.3.7 -MPLVERSION=0.99.0.rc1 +MPLVERSION=0.99.0.rc2 BDISTMPKGVERSION=0.4.4 MPLSRC=matplotlib-${MPLVERSION} MACOSX_DEPLOYMENT_TARGET=10.4 @@ -88,7 +88,7 @@ cp ../data/setup.cfg . &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ - bdist_mpkg &&\ + /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg &&\ ${PYTHON} setupegg.py bdist_egg &&\ cd dist && \ zip -ro matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5_mpkg.zip matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg Modified: trunk/matplotlib/release/osx/README.txt =================================================================== --- trunk/matplotlib/release/osx/README.txt 2009年08月05日 12:04:36 UTC (rev 7362) +++ trunk/matplotlib/release/osx/README.txt 2009年08月05日 14:35:06 UTC (rev 7363) @@ -7,7 +7,7 @@ ------------- * :file:`bdist_mkpg` - the distutils.extension to build Installer.app - mpkg installers. + mpkg installers. * :file:`data` - some config files and patches needed for the build @@ -19,16 +19,22 @@ How to build -------------- -* You need a python framework build , numpy and wxpython to build the +* You need a python framework build, numpy and wxpython to build the mpl installers (wx requires this and we need wx to build the wxagg - extension). You can get the three required dependencies as - Installer apps, eg: + extension). I recommend building python from src as a framework build:: + ./configure --enable-universalsdk --enable-framework + sudo make install - http://www.python.org/ftp/python/2.6.2/python-2.6.2-macosx2009-04-16.dmg - http://downloads.sourceforge.net/project/numpy/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg?use_mirror=voxel - http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel + and build numpy from src too since the 2.5 numpy installer doesn't work + with a python built from src:: + sudo python setup.py install + + you can use the pre-built installer for wx:: + + http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel + * You need to make sure to unset PKG_CONFIG_PATH to make sure the static linking below is respected. Otherwise the mpl build script will dynamically link using the libs from pkgconfig if you have this This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7362 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7362&view=rev Author: jdh2358 Date: 2009年08月05日 12:04:36 +0000 (2009年8月05日) Log Message: ----------- added a new mpl data example script to test svn commits on the data Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/cbook.py Added Paths: ----------- trunk/matplotlib/examples/misc/mpl_data_test.py Added: trunk/matplotlib/examples/misc/mpl_data_test.py =================================================================== --- trunk/matplotlib/examples/misc/mpl_data_test.py (rev 0) +++ trunk/matplotlib/examples/misc/mpl_data_test.py 2009年08月05日 12:04:36 UTC (rev 7362) @@ -0,0 +1,13 @@ +""" +Demonstrate how get_mpl_data works with svn revisions in the data. + + svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/mpl_data + +and edit testdata.csv to add a new row. After committing the changes, +when you rerun this script you will get the updated data (and the new +svn version will be cached in ~/.matplotlib/mpl_data) +""" + +import matplotlib.cbook as cbook +fh = cbook.get_mpl_data("testdata.csv") +print fh.read() Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2009年08月05日 11:39:37 UTC (rev 7361) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2009年08月05日 12:04:36 UTC (rev 7362) @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.0.rc1' +__version__ = '1.0.svn' __revision__ = '$Revision$' __date__ = '$Date$' Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 11:39:37 UTC (rev 7361) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月05日 12:04:36 UTC (rev 7362) @@ -356,7 +356,7 @@ def in_cache_dir(self, fn): return os.path.join(self.cache_dir, fn) - + def read_cache(self): """ Read the cache file from the cache directory. @@ -386,7 +386,7 @@ for path in os.listdir(self.cache_dir): if path not in listed and path != 'cache.pck': os.remove(os.path.join(self.cache_dir, path)) - + def write_cache(self): """ Write the cache data structure into the cache directory. @@ -419,7 +419,7 @@ # http_request for preprocessing requests # http_error_304 for handling 304 Not Modified responses # http_response for postprocessing requests - + def http_request(self, req): """ Make the request conditional if we have a cached file. @@ -441,7 +441,7 @@ handle = urllib2.addinfourl(file, hdrs, url) handle.code = 304 return handle - + def http_response(self, req, response): """ Update the cache with the returned file. @@ -473,7 +473,7 @@ To add a datafile to this directory, you need to check out mpl_data from matplotlib svn:: - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/mpl_data + svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/mpl_data and svn add the data file you want to support. This is primarily intended for use in mpl examples that need custom data @@ -497,7 +497,7 @@ response.close() p = get_mpl_data.processor return p.in_cache_dir(p.cache[url][0]) - + def flatten(seq, scalarp=is_scalar_or_string): """ this generator flattens nested containers such as This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7361 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7361&view=rev Author: jdh2358 Date: 2009年08月05日 11:39:37 +0000 (2009年8月05日) Log Message: ----------- updated test data Modified Paths: -------------- trunk/mpl_data/testdata.csv Modified: trunk/mpl_data/testdata.csv =================================================================== --- trunk/mpl_data/testdata.csv 2009年08月05日 11:34:43 UTC (rev 7360) +++ trunk/mpl_data/testdata.csv 2009年08月05日 11:39:37 UTC (rev 7361) @@ -1,3 +1,5 @@ name,age john,41 -miriam,38 \ No newline at end of file +miriam,38 +rahel,11 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7360 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7360&view=rev Author: jdh2358 Date: 2009年08月05日 11:34:43 +0000 (2009年8月05日) Log Message: ----------- added testdata.csv Added Paths: ----------- trunk/mpl_data/testdata.csv Added: trunk/mpl_data/testdata.csv =================================================================== --- trunk/mpl_data/testdata.csv (rev 0) +++ trunk/mpl_data/testdata.csv 2009年08月05日 11:34:43 UTC (rev 7360) @@ -0,0 +1,3 @@ +name,age +john,41 +miriam,38 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7359 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7359&view=rev Author: jdh2358 Date: 2009年08月05日 11:06:13 +0000 (2009年8月05日) Log Message: ----------- remove dup gui event in enter/leave events in gtk Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009年08月05日 02:29:12 UTC (rev 7358) +++ branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009年08月05日 11:06:13 UTC (rev 7359) @@ -243,10 +243,10 @@ return False # finish event propagation? def leave_notify_event(self, widget, event): - FigureCanvasBase.leave_notify_event(self, event, guiEvent=event) + FigureCanvasBase.leave_notify_event(self, event) def enter_notify_event(self, widget, event): - FigureCanvasBase.enter_notify_event(self, event, guiEvent=event) + FigureCanvasBase.enter_notify_event(self, event) def _get_key(self, event): if event.keyval in self.keyvald: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7358 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7358&view=rev Author: jdh2358 Date: 2009年08月05日 02:29:12 +0000 (2009年8月05日) Log Message: ----------- some fixes for osx builds on rc2 Modified Paths: -------------- branches/v0_99_maint/doc/_templates/indexsidebar.html branches/v0_99_maint/lib/matplotlib/__init__.py branches/v0_99_maint/release/osx/Makefile branches/v0_99_maint/release/osx/README.txt Modified: branches/v0_99_maint/doc/_templates/indexsidebar.html =================================================================== --- branches/v0_99_maint/doc/_templates/indexsidebar.html 2009年08月05日 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/doc/_templates/indexsidebar.html 2009年08月05日 02:29:12 UTC (rev 7358) @@ -3,7 +3,7 @@ <p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a> to support matplotlib development.</p> -<p>A release candidate rc1 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a> +<p>A release candidate rc2 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a> </p> <p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>. Modified: branches/v0_99_maint/lib/matplotlib/__init__.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/__init__.py 2009年08月05日 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/lib/matplotlib/__init__.py 2009年08月05日 02:29:12 UTC (rev 7358) @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.0.rc1' +__version__ = '0.99.0.rc2' __revision__ = '$Revision$' __date__ = '$Date$' Modified: branches/v0_99_maint/release/osx/Makefile =================================================================== --- branches/v0_99_maint/release/osx/Makefile 2009年08月05日 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/release/osx/Makefile 2009年08月05日 02:29:12 UTC (rev 7358) @@ -1,10 +1,10 @@ -PYVERSION=2.6 +PYVERSION=2.5 PYTHON=python${PYVERSION} SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 FREETYPEVERSION=2.3.7 -MPLVERSION=0.99.0.rc1 +MPLVERSION=0.99.0.rc2 BDISTMPKGVERSION=0.4.4 MPLSRC=matplotlib-${MPLVERSION} MACOSX_DEPLOYMENT_TARGET=10.4 @@ -88,7 +88,7 @@ cp ../data/setup.cfg . &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ - bdist_mpkg &&\ + /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg &&\ ${PYTHON} setupegg.py bdist_egg &&\ cd dist && \ zip -ro matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5_mpkg.zip matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg Modified: branches/v0_99_maint/release/osx/README.txt =================================================================== --- branches/v0_99_maint/release/osx/README.txt 2009年08月05日 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/release/osx/README.txt 2009年08月05日 02:29:12 UTC (rev 7358) @@ -7,7 +7,7 @@ ------------- * :file:`bdist_mkpg` - the distutils.extension to build Installer.app - mpkg installers. + mpkg installers. * :file:`data` - some config files and patches needed for the build @@ -19,16 +19,22 @@ How to build -------------- -* You need a python framework build , numpy and wxpython to build the +* You need a python framework build, numpy and wxpython to build the mpl installers (wx requires this and we need wx to build the wxagg - extension). You can get the three required dependencies as - Installer apps, eg: + extension). I recommend building python from src as a framework build:: + ./configure --enable-universalsdk --enable-framework + sudo make install - http://www.python.org/ftp/python/2.6.2/python-2.6.2-macosx2009-04-16.dmg - http://downloads.sourceforge.net/project/numpy/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg?use_mirror=voxel - http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel + and build numpy from src too since the 2.5 numpy installer doesn't work + with a python built from src:: + sudo python setup.py install + + you can use the pre-built installer for wx:: + + http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel + * You need to make sure to unset PKG_CONFIG_PATH to make sure the static linking below is respected. Otherwise the mpl build script will dynamically link using the libs from pkgconfig if you have this This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7357 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7357&view=rev Author: efiring Date: 2009年08月05日 00:11:42 +0000 (2009年8月05日) Log Message: ----------- Remove unused argument from data_init in cntr.c Modified Paths: -------------- trunk/matplotlib/src/cntr.c Modified: trunk/matplotlib/src/cntr.c =================================================================== --- trunk/matplotlib/src/cntr.c 2009年08月05日 00:05:37 UTC (rev 7356) +++ trunk/matplotlib/src/cntr.c 2009年08月05日 00:11:42 UTC (rev 7357) @@ -291,7 +291,7 @@ static long curve_tracer (Csite * site, int pass2); /* this initializes the data array for curve_tracer */ -static void data_init (Csite * site, int region, long nchunk); +static void data_init (Csite * site, long nchunk); /* ------------------------------------------------------------------------ */ @@ -974,13 +974,8 @@ /* ------------------------------------------------------------------------ */ -/* The sole function of the "region" argument is to specify the - value in Csite.reg that denotes a missing zone. We always - use zero. -*/ - static void -data_init (Csite * site, int region, long nchunk) +data_init (Csite * site, long nchunk) { Cdata * data = site->data; long imax = site->imax; @@ -1050,8 +1045,7 @@ data[ij + imax + 1] = 0; if (reg) { - if (region ? (reg[ij + imax + 1] == region) - : (reg[ij + imax + 1] != 0)) + if (reg[ij + imax + 1] != 0) data[ij + imax + 1] = ZONE_EX; } else @@ -1403,7 +1397,7 @@ site->zlevel[1] = levels[1]; } site->n = site->count = 0; - data_init (site, 0, nchunk); + data_init (site, nchunk); /* make first pass to compute required sizes for second pass */ for (;;) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7356 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7356&view=rev Author: efiring Date: 2009年08月05日 00:05:37 +0000 (2009年8月05日) Log Message: ----------- Elimination of contourf cut strokes: second try Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/contour.py trunk/matplotlib/src/cntr.c Modified: trunk/matplotlib/lib/matplotlib/contour.py =================================================================== --- trunk/matplotlib/lib/matplotlib/contour.py 2009年08月04日 19:51:08 UTC (rev 7355) +++ trunk/matplotlib/lib/matplotlib/contour.py 2009年08月05日 00:05:37 UTC (rev 7356) @@ -606,7 +606,6 @@ segs = nlist[:nseg] kinds = nlist[nseg:] - paths = self._make_paths(segs, kinds) col = collections.PathCollection(paths, @@ -652,8 +651,10 @@ codes = np.zeros(kind.shape, dtype=mpath.Path.code_type) codes.fill(mpath.Path.LINETO) codes[0] = mpath.Path.MOVETO - # Attempted slit removal is disabled until we get it right. - #codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO + # points that begin a slit or are in it: + in_slit = kind[:-1] >= _cntr._slitkind + # use moveto for any point *following* such a point + codes[1:][in_slit] = mpath.Path.MOVETO paths.append(mpath.Path(seg, codes)) return paths Modified: trunk/matplotlib/src/cntr.c =================================================================== --- trunk/matplotlib/src/cntr.c 2009年08月04日 19:51:08 UTC (rev 7355) +++ trunk/matplotlib/src/cntr.c 2009年08月05日 00:05:37 UTC (rev 7356) @@ -1326,7 +1326,7 @@ /* Build a list of XY 2-D arrays, shape (N,2), to which a list of K arrays - is concatenated concatenated. */ + is concatenated. */ static PyObject * build_cntr_list_v2(long *np, double *xp, double *yp, short *kp, int nparts, long ntotal) @@ -1653,6 +1653,29 @@ return cntr_trace(self->site, levels, nlevels, nchunk); } +/* The following will not normally be called. It is experimental, + and intended for future debugging. It may go away at any time. +*/ +static PyObject * +Cntr_get_cdata(Cntr *self) +{ + PyArrayObject *Cdata; + npy_intp dims[2]; + int i, j; + int ni, nj; + + dims[0] = ni = self->site->imax; + dims[1] = nj = self->site->jmax; + + Cdata = (PyArrayObject *) PyArray_SimpleNew(2, dims, PyArray_SHORT); + for (j=0; j<nj; j++) + for (i=0; i<ni; i++) + Cdata->data[j + i*nj] = self->site->data[i + j*ni]; + /* output is C-order, input is F-order */ + /* for now we are ignoring the last ni+1 values */ + return (PyObject *)Cdata; +} + static PyMethodDef Cntr_methods[] = { {"trace", (PyCFunction)Cntr_trace, METH_VARARGS | METH_KEYWORDS, "Return a list of contour line segments or polygons.\n\n" @@ -1665,6 +1688,12 @@ " Optional argument: nchunk; approximate number of grid points\n" " per chunk. 0 (default) for no chunking.\n" }, + {"get_cdata", (PyCFunction)Cntr_get_cdata, METH_NOARGS, + "Returns a copy of the mesh array with contour calculation codes.\n\n" + "Experimental and incomplete; we are not returning quite all of\n" + "the array.\n" + "Don't call this unless you are exploring the dark recesses of cntr.c\n" + }, {0, 0, 0, 0} /* Sentinel */ }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7355 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7355&view=rev Author: jouni Date: 2009年08月04日 19:51:08 +0000 (2009年8月04日) Log Message: ----------- Fix indentation error in mpl_data_demo.py - thanks to G?195円?182円khan Sever Modified Paths: -------------- trunk/matplotlib/examples/misc/mpl_data_demo.py Modified: trunk/matplotlib/examples/misc/mpl_data_demo.py =================================================================== --- trunk/matplotlib/examples/misc/mpl_data_demo.py 2009年08月04日 19:35:13 UTC (rev 7354) +++ trunk/matplotlib/examples/misc/mpl_data_demo.py 2009年08月04日 19:51:08 UTC (rev 7355) @@ -1,7 +1,7 @@ - """ - Grab mpl data from the ~/.matplotlib/mpl_data cache if it exists, else - fetch it from svn and cache it - """ +""" +Grab mpl data from the ~/.matplotlib/mpl_data cache if it exists, else +fetch it from svn and cache it +""" import matplotlib.cbook as cbook import matplotlib.pyplot as plt fname = cbook.get_mpl_data('lena.png', asfileobj=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7354 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7354&view=rev Author: jouni Date: 2009年08月04日 19:35:13 +0000 (2009年8月04日) Log Message: ----------- Made cbook.get_mpl_data make use of the ETag and Last-Modified headers of mod_dav_svn. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2009年08月04日 18:46:41 UTC (rev 7353) +++ trunk/matplotlib/CHANGELOG 2009年08月04日 19:35:13 UTC (rev 7354) @@ -1,3 +1,5 @@ +2009年08月04日 Made cbook.get_mpl_data make use of the ETag and Last-Modified + headers of mod_dav_svn. - JKS 2009年08月03日 Add PathCollection; modify contourf to use complex paths instead of simple paths with cuts. - EF Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月04日 18:46:41 UTC (rev 7353) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009年08月04日 19:35:13 UTC (rev 7354) @@ -9,6 +9,10 @@ import numpy as np import numpy.ma as ma from weakref import ref +import cPickle +import os.path +import random +import urllib2 import matplotlib @@ -340,8 +344,120 @@ def is_scalar_or_string(val): return is_string_like(val) or not iterable(val) +class _CacheProcessor(urllib2.BaseHandler): + """ + Urllib2 handler that takes care of caching files. + The file cache.pck holds the directory of files to be cached. + """ + def __init__(self, cache_dir): + self.cache_dir = cache_dir + self.read_cache() + self.remove_stale_files() + def in_cache_dir(self, fn): + return os.path.join(self.cache_dir, fn) + + def read_cache(self): + """ + Read the cache file from the cache directory. + """ + fn = self.in_cache_dir('cache.pck') + if not os.path.exists(fn): + self.cache = {} + return + f = open(fn, 'rb') + cache = cPickle.load(f) + f.close() + + # If any files are deleted, drop them from the cache + for url, (fn, _, _) in cache.items(): + if not os.path.exists(self.in_cache_dir(fn)): + del cache[url] + + self.cache = cache + + def remove_stale_files(self): + """ + Remove files from the cache directory that are not listed in + cache.pck. + """ + listed = set([fn for (_, (fn, _, _)) in self.cache.items()]) + for path in os.listdir(self.cache_dir): + if path not in listed and path != 'cache.pck': + os.remove(os.path.join(self.cache_dir, path)) + + def write_cache(self): + """ + Write the cache data structure into the cache directory. + """ + fn = self.in_cache_dir('cache.pck') + f = open(fn, 'wb') + cPickle.dump(self.cache, f, -1) + f.close() + + def cache_file(self, url, data, headers): + """ + Store a received file in the cache directory. + """ + # Pick a filename + rightmost = url.rstrip('/').split('/')[-1] + fn = rightmost + while os.path.exists(self.in_cache_dir(fn)): + fn = rightmost + '.' + str(random.randint(0,9999999)) + + # Write out the data + f = open(self.in_cache_dir(fn), 'wb') + f.write(data) + f.close() + + # Update the cache + self.cache[url] = (fn, headers.get('ETag'), headers.get('Last-Modified')) + self.write_cache() + + # These urllib2 entry points are used: + # http_request for preprocessing requests + # http_error_304 for handling 304 Not Modified responses + # http_response for postprocessing requests + + def http_request(self, req): + """ + Make the request conditional if we have a cached file. + """ + url = req.get_full_url() + if url in self.cache: + _, etag, lastmod = self.cache[url] + req.add_header("If-None-Match", etag) + req.add_header("If-Modified-Since", lastmod) + return req + + def http_error_304(self, req, fp, code, msg, hdrs): + """ + Read the file from the cache since the server has no newer version. + """ + url = req.get_full_url() + fn, _, _ = self.cache[url] + file = open(self.in_cache_dir(fn), 'rb') + handle = urllib2.addinfourl(file, hdrs, url) + handle.code = 304 + return handle + + def http_response(self, req, response): + """ + Update the cache with the returned file. + """ + if response.code != 200: + return response + else: + data = response.read() + self.cache_file(req.get_full_url(), data, response.headers) + result = urllib2.addinfourl(StringIO.StringIO(data), + response.headers, + req.get_full_url()) + result.code = response.code + result.msg = response.msg + return result + def get_mpl_data(fname, asfileobj=True): """ Check the cachedirectory ~/.matplotlib/mpl_data for an mpl_data @@ -363,32 +479,25 @@ intended for use in mpl examples that need custom data """ - # TODO: how to handle stale data in the cache that has been - # updated from svn -- is there a clean http way to get the current - # revision number that will not leave us at the mercy of html - # changes at sf? + if not hasattr(get_mpl_data, 'opener'): + configdir = matplotlib.get_configdir() + cachedir = os.path.join(configdir, 'mpl_data') + if not os.path.exists(cachedir): + os.mkdir(cachedir) + # Store the cache processor and url opener as attributes of this function + get_mpl_data.processor = _CacheProcessor(cachedir) + get_mpl_data.opener = urllib2.build_opener(get_mpl_data.processor) - - configdir = matplotlib.get_configdir() - cachedir = os.path.join(configdir, 'mpl_data') - if not os.path.exists(cachedir): - os.mkdir(cachedir) - - cachefile = os.path.join(cachedir, fname) - - if not os.path.exists(cachefile): - import urllib - url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/%s'%urllib.quote(fname) - matplotlib.verbose.report('Attempting to download %s to %s'%(url, cachefile)) - urllib.urlretrieve(url, filename=cachefile) - else: - matplotlib.verbose.report('Aleady have mpl_data %s'%fname) - + url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/' + \ + urllib2.quote(fname) + response = get_mpl_data.opener.open(url) if asfileobj: - return to_filehandle(cachefile) + return response else: - return cachefile - + response.close() + p = get_mpl_data.processor + return p.in_cache_dir(p.cache[url][0]) + def flatten(seq, scalarp=is_scalar_or_string): """ this generator flattens nested containers such as This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7353 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7353&view=rev Author: jdh2358 Date: 2009年08月04日 18:46:41 +0000 (2009年8月04日) Log Message: ----------- attach gtk events to mpl events -- fixes sf bug 2816580 Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009年08月04日 18:40:10 UTC (rev 7352) +++ branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009年08月04日 18:46:41 UTC (rev 7353) @@ -197,7 +197,7 @@ step = 1 else: step = -1 - FigureCanvasBase.scroll_event(self, x, y, step) + FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event) return False # finish event propagation? def button_press_event(self, widget, event): @@ -205,7 +205,7 @@ x = event.x # flipy so y=0 is bottom of canvas y = self.allocation.height - event.y - FigureCanvasBase.button_press_event(self, x, y, event.button) + FigureCanvasBase.button_press_event(self, x, y, event.button, guiEvent=event) return False # finish event propagation? def button_release_event(self, widget, event): @@ -213,21 +213,21 @@ x = event.x # flipy so y=0 is bottom of canvas y = self.allocation.height - event.y - FigureCanvasBase.button_release_event(self, x, y, event.button) + FigureCanvasBase.button_release_event(self, x, y, event.button, guiEvent=event) return False # finish event propagation? def key_press_event(self, widget, event): if _debug: print 'FigureCanvasGTK.%s' % fn_name() key = self._get_key(event) if _debug: print "hit", key - FigureCanvasBase.key_press_event(self, key) + FigureCanvasBase.key_press_event(self, key, guiEvent=event) return False # finish event propagation? def key_release_event(self, widget, event): if _debug: print 'FigureCanvasGTK.%s' % fn_name() key = self._get_key(event) if _debug: print "release", key - FigureCanvasBase.key_release_event(self, key) + FigureCanvasBase.key_release_event(self, key, guiEvent=event) return False # finish event propagation? def motion_notify_event(self, widget, event): @@ -239,14 +239,14 @@ # flipy so y=0 is bottom of canvas y = self.allocation.height - y - FigureCanvasBase.motion_notify_event(self, x, y) + FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event) return False # finish event propagation? def leave_notify_event(self, widget, event): - FigureCanvasBase.leave_notify_event(self, event) + FigureCanvasBase.leave_notify_event(self, event, guiEvent=event) def enter_notify_event(self, widget, event): - FigureCanvasBase.enter_notify_event(self, event) + FigureCanvasBase.enter_notify_event(self, event, guiEvent=event) def _get_key(self, event): if event.keyval in self.keyvald: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7352 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7352&view=rev Author: efiring Date: 2009年08月04日 18:40:10 +0000 (2009年8月04日) Log Message: ----------- Disable contourf slit line removal until problems are fixed. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/contour.py trunk/matplotlib/src/cntr.c Modified: trunk/matplotlib/lib/matplotlib/contour.py =================================================================== --- trunk/matplotlib/lib/matplotlib/contour.py 2009年08月04日 18:21:59 UTC (rev 7351) +++ trunk/matplotlib/lib/matplotlib/contour.py 2009年08月04日 18:40:10 UTC (rev 7352) @@ -652,7 +652,8 @@ codes = np.zeros(kind.shape, dtype=mpath.Path.code_type) codes.fill(mpath.Path.LINETO) codes[0] = mpath.Path.MOVETO - codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO + # Attempted slit removal is disabled until we get it right. + #codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO paths.append(mpath.Path(seg, codes)) return paths Modified: trunk/matplotlib/src/cntr.c =================================================================== --- trunk/matplotlib/src/cntr.c 2009年08月04日 18:21:59 UTC (rev 7351) +++ trunk/matplotlib/src/cntr.c 2009年08月04日 18:40:10 UTC (rev 7352) @@ -326,12 +326,14 @@ int z0, z1, z2, z3; int keep_left = 0; /* flag to try to minimize curvature in saddles */ int done = 0; + int n_kind; if (level) level = 2; for (;;) { + n_kind = 0; /* set edge endpoints */ p0 = POINT0 (edge, fwd); p1 = POINT1 (edge, fwd); @@ -344,6 +346,7 @@ xcp[n] = zcp * (x[p1] - x[p0]) + x[p0]; ycp[n] = zcp * (y[p1] - y[p0]) + y[p0]; kcp[n] = kind_zone; + n_kind = n; } if (!done && !jedge) { @@ -497,9 +500,9 @@ { return done; } - if (pass2 && n > 0) + if (pass2 && n_kind) { - kcp[n-1] += kind_start_slit; + kcp[n_kind] += kind_start_slit; } return slit_cutter (site, done - 5, pass2); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7351 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7351&view=rev Author: jdh2358 Date: 2009年08月04日 18:21:59 +0000 (2009年8月04日) Log Message: ----------- minor tweak to legend picking example Modified Paths: -------------- trunk/matplotlib/examples/event_handling/legend_picking.py Modified: trunk/matplotlib/examples/event_handling/legend_picking.py =================================================================== --- trunk/matplotlib/examples/event_handling/legend_picking.py 2009年08月04日 18:09:38 UTC (rev 7350) +++ trunk/matplotlib/examples/event_handling/legend_picking.py 2009年08月04日 18:21:59 UTC (rev 7351) @@ -31,11 +31,11 @@ # legend proxy line, and toggle the visibilit legline = event.artist origline = lined[legline] - vis = origline.get_visible() - origline.set_visible(not vis) + vis = not origline.get_visible() + origline.set_visible(vis) # Change the alpha on the line in the legend so we can see what lines # have been toggled - if not vis: + if vis: legline.set_alpha(1.0) else: legline.set_alpha(0.2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7350 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7350&view=rev Author: efiring Date: 2009年08月04日 18:09:38 +0000 (2009年8月04日) Log Message: ----------- Fix typo in recent change to contour.py. (There are still bugs to be found in the change to cntr.c.) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/contour.py Modified: trunk/matplotlib/lib/matplotlib/contour.py =================================================================== --- trunk/matplotlib/lib/matplotlib/contour.py 2009年08月04日 17:59:44 UTC (rev 7349) +++ trunk/matplotlib/lib/matplotlib/contour.py 2009年08月04日 18:09:38 UTC (rev 7350) @@ -652,7 +652,7 @@ codes = np.zeros(kind.shape, dtype=mpath.Path.code_type) codes.fill(mpath.Path.LINETO) codes[0] = mpath.Path.MOVETO - codes[kinds >= _cntr._slitkind] = mpath.Path.MOVETO + codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO paths.append(mpath.Path(seg, codes)) return paths This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7349 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7349&view=rev Author: ryanmay Date: 2009年08月04日 17:59:44 +0000 (2009年8月04日) Log Message: ----------- Tweak legend_picking.py demo to change alpha of lines in legend. Modified Paths: -------------- trunk/matplotlib/examples/event_handling/legend_picking.py Modified: trunk/matplotlib/examples/event_handling/legend_picking.py =================================================================== --- trunk/matplotlib/examples/event_handling/legend_picking.py 2009年08月04日 17:18:03 UTC (rev 7348) +++ trunk/matplotlib/examples/event_handling/legend_picking.py 2009年08月04日 17:59:44 UTC (rev 7349) @@ -33,6 +33,12 @@ origline = lined[legline] vis = origline.get_visible() origline.set_visible(not vis) + # Change the alpha on the line in the legend so we can see what lines + # have been toggled + if not vis: + legline.set_alpha(1.0) + else: + legline.set_alpha(0.2) fig.canvas.draw() fig.canvas.mpl_connect('pick_event', onpick) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.