From f35a719674cd4e269fccd929128e9dec9420035e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 8 Jan 2008 22:10:52 +0000 Subject: [PATCH 001/324] A test commit svn path=/branches/v0_91_maint/; revision=4825 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b4daa9773bdb..a05688c0a26e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-01-08 A dummy changelog entry to check merging of bugfixes + back to the trunk. + =============================================================== 2008-01-06 Released 0.91.2 at revision 4802 From b2ac84d35090f4418739bd69fff44c71b98e9226 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 8 Jan 2008 22:13:08 +0000 Subject: [PATCH 002/324] Undoing last commit. Testing was successful. svn path=/branches/v0_91_maint/; revision=4826 --- CHANGELOG | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a05688c0a26e..b4daa9773bdb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,3 @@ -2008-01-08 A dummy changelog entry to check merging of bugfixes - back to the trunk. - =============================================================== 2008-01-06 Released 0.91.2 at revision 4802 From 5483c2710df92a8c780373d21bf4a9c85e773c0a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 10 Jan 2008 13:28:01 +0000 Subject: [PATCH 003/324] Fix offset labels (so the times symbol is displayed correctly) svn path=/branches/v0_91_maint/; revision=4841 --- lib/matplotlib/ticker.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index e5cb43d24a36..088941b4e3c5 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -329,12 +329,16 @@ def get_offset(self): if self.offset > 0: offsetStr = '+' + offsetStr if self.orderOfMagnitude: if self._usetex or self._useMathText: - sciNotStr = r'{\times}'+self.format_data(10**self.orderOfMagnitude) + sciNotStr = self.format_data(10**self.orderOfMagnitude) else: - sciNotStr = u'\xd7'+'1e%d'% self.orderOfMagnitude + sciNotStr = '1e%d'% self.orderOfMagnitude if self._useMathText: - return ''.join(('$\mathdefault{',sciNotStr,offsetStr,'}$')) + if sciNotStr != '': + sciNotStr = r'\times\mathdefault{%s}' % sciNotStr + return ''.join(('$',sciNotStr,r'\mathdefault{',offsetStr,'}$')) elif self._usetex: + if sciNotStr != '': + sciNotStr = u'\xd7%s' % sciNotStr return ''.join(('$',sciNotStr,offsetStr,'$')) else: return ''.join((sciNotStr,offsetStr)) From 79d336988a46ae98723489313cb6b955ca4497e1 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 10 Jan 2008 13:38:37 +0000 Subject: [PATCH 004/324] Merge Darren's win32 build changes to the maintenance branch (since they'll be handy there also). svn path=/branches/v0_91_maint/; revision=4846 --- CHANGELOG | 7 +++++++ setup.py | 22 +++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b4daa9773bdb..bd7fcca29017 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +2008-01-10 Fix bug when displaying a tick value offset with scientific + notation. (Manifests itself as a warning that the \times + symbol can not be found). - MGD + +2008-01-10 Use setup.cfg to set the default parameters (tkagg, + numpy) when building windows installers - DSD + =============================================================== 2008-01-06 Released 0.91.2 at revision 4802 diff --git a/setup.py b/setup.py index 639db1d40c40..b83462a5456c 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ """ # This dict will be updated as we try to select the best option during -# the build process. However, values in setup.cfg will be used, if +# the build process. However, values in setup.cfg will be used, if # defined. rc = {'backend':'Agg', 'numerix':'numpy'} @@ -36,7 +36,7 @@ if major==2 and minor1<3 or major<2: raise SystemExit("""matplotlib requires Python 2.3 or later.""") - + import glob from distutils.core import setup from setupext import build_agg, build_gtkagg, build_tkagg, build_wxagg,\ @@ -112,7 +112,7 @@ subprocess_dir = os.path.dirname(subprocess.__file__) if subprocess_dir.endswith('.egg/subprocess'): havesubprocess = False - + if not havesubprocess: packages.append('subprocess') if sys.platform == 'win32': @@ -120,7 +120,7 @@ if not check_for_freetype(): sys.exit(1) - + build_ft2font(ext_modules, packages) build_ttconv(ext_modules, packages) build_contour(ext_modules, packages) @@ -145,7 +145,7 @@ build_windowing(ext_modules, packages) # the options can be True, False, or 'auto'. If True, try to build -# regardless of the lack of dependencies. If auto, silently skip +# regardless of the lack of dependencies. If auto, silently skip # when dependencies are missing. if options['build_tkagg']: if check_for_tk() or (options['build_tkagg'] is True): @@ -188,12 +188,12 @@ if hasdatetime: # dates require python23 datetime # only install pytz and dateutil if the user hasn't got them - + def add_pytz(): packages.append('pytz') resources = ['zone.tab', 'locales/pytz.pot'] # install pytz subdirs - for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz', + for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz', 'zoneinfo')): if '.svn' not in dirpath: # remove the 'lib/pytz' part of the path @@ -237,12 +237,8 @@ def add_dateutil(): print_line() # Write the default matplotlibrc file -if sys.platform=='win32': - rc['backend'] = 'TkAgg' - rc['numerix'] = 'numpy' -else: - if options['backend']: rc['backend'] = options['backend'] - if options['numerix']: rc['numerix'] = options['numerix'] +if options['backend']: rc['backend'] = options['backend'] +if options['numerix']: rc['numerix'] = options['numerix'] template = file('matplotlibrc.template').read() file('lib/matplotlib/mpl-data/matplotlibrc', 'w').write(template%rc) From 5a0a3025f97d8eb466ebfea0f0a915674381623f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 10 Jan 2008 16:37:18 +0000 Subject: [PATCH 005/324] Fix display of '[' and ']' in mathtext. svn path=/branches/v0_91_maint/; revision=4854 --- lib/matplotlib/mathtext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index cebee4eb067b..6e194c1d8f7a 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -2058,7 +2058,7 @@ def __init__(self): ).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()) From 253a40699fa319a657bc057075a43d6616156c48 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 10 Jan 2008 16:40:54 +0000 Subject: [PATCH 006/324] Update changelog. svn path=/branches/v0_91_maint/; revision=4855 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index bd7fcca29017..06bebe2a4549 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-01-10 Fix bug displaying [ and ] in mathtext - MGD + 2008-01-10 Fix bug when displaying a tick value offset with scientific notation. (Manifests itself as a warning that the \times symbol can not be found). - MGD From 9ce195e075fcbf679dde660160c90e3a0b6917d3 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 14 Jan 2008 13:11:16 +0000 Subject: [PATCH 007/324] Fix SVG glyphs for use with Qt (which doesn't look forward for the glyph definitions). svn path=/branches/v0_91_maint/; revision=4866 --- lib/matplotlib/backends/backend_svg.py | 61 +++++++++++++++++++------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index 8e5f512c3849..afccb20404a9 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -284,8 +284,20 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath): fontsize = prop.get_size_in_points() color = rgb2hex(gc.get_rgb()) + write = self._svgwriter.write if rcParams['svg.embed_char_paths']: + new_chars = [] + for c in s: + path = self._add_char_def(prop, c) + if path is not None: + new_chars.append(path) + if len(new_chars): + write('\n') + for path in new_chars: + write(path) + write('\n') + svg = ['%(thetext)s """ % locals() - self._svgwriter.write (svg) + write(svg) def _add_char_def(self, prop, char): if isinstance(prop, FontProperties): @@ -347,9 +359,9 @@ def _add_char_def(self, prop, char): font.set_size(self.FONT_SCALE, 72) ps_name = font.get_sfnt()[(1,0,0,6)] char_id = urllib.quote('%s-%d' % (ps_name, ord(char))) - char_num, path = self._char_defs.get(char_id, (None, None)) + char_num = self._char_defs.get(char_id, None) if char_num is not None: - return char_num + return None path_data = [] glyph = font.load_char(ord(char), flags=LOAD_NO_HINTING) @@ -378,8 +390,19 @@ def _add_char_def(self, prop, char): currx, curry = step[-2], -step[-1] char_num = 'c_%x' % len(self._char_defs) path_element = '\n' % (char_num, ''.join(path_data)) - self._char_defs[char_id] = (char_num, path_element) - return char_num + self._char_defs[char_id] = char_num + return path_element + + def _get_char_def_id(self, prop, char): + if isinstance(prop, FontProperties): + newprop = prop.copy() + font = self._get_font(newprop) + else: + font = prop + font.set_size(self.FONT_SCALE, 72) + ps_name = font.get_sfnt()[(1,0,0,6)] + char_id = urllib.quote('%s-%d' % (ps_name, ord(char))) + return self._char_defs[char_id] def _draw_mathtext(self, gc, x, y, s, prop, angle): """ @@ -390,12 +413,22 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle): svg_glyphs = svg_elements.svg_glyphs svg_rects = svg_elements.svg_rects color = rgb2hex(gc.get_rgb()) - - self.open_group("mathtext") + write = self._svgwriter.write style = "fill: %s" % color if rcParams['svg.embed_char_paths']: + new_chars = [] + for font, fontsize, thetext, new_x, new_y_mtc, metrics in svg_glyphs: + path = self._add_char_def(font, thetext) + if path is not None: + new_chars.append(path) + if len(new_chars): + write('\n') + for path in new_chars: + write(path) + write('\n') + svg = ['\n') for font, fontsize, thetext, new_x, new_y_mtc, metrics in svg_glyphs: - charid = self._add_char_def(font, thetext) + charid = self._get_char_def_id(font, thetext) svg.append('\n' % (charid, new_x, -new_y_mtc, fontsize / self.FONT_SCALE)) @@ -459,16 +492,12 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle): svg.append('' % (x, -y + height, width, height)) svg.append("") - self._svgwriter.write (''.join(svg)) + self.open_group("mathtext") + write (''.join(svg)) self.close_group("mathtext") def finish(self): write = self._svgwriter.write - if len(self._char_defs): - write('\n') - for char_num, path in self._char_defs.values(): - write(path) - write('\n') write('\n') def flipy(self): From 331e452480367f608240669a5ef5523d4394e362 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 17 Jan 2008 04:13:27 +0000 Subject: [PATCH 008/324] forced nonunicode fname for save in agg svn path=/branches/v0_91_maint/; revision=4874 --- lib/matplotlib/backends/backend_agg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index cc348c20ba20..4c03a55f23f6 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -394,5 +394,6 @@ def print_raw(self, filename, *args, **kwargs): def print_png(self, filename, *args, **kwargs): self.draw() + filename = str(filename) # until we figure out unicode handling self.get_renderer()._renderer.write_png(filename, self.figure.dpi.get()) From 8c585331affed9707b76ba3e0f7ea045d2070508 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 18 Jan 2008 17:59:51 +0000 Subject: [PATCH 009/324] Fix poly_editor.py svn path=/branches/v0_91_maint/; revision=4879 --- examples/poly_editor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/poly_editor.py b/examples/poly_editor.py index faf81bc79bf7..5e9d327fdc42 100644 --- a/examples/poly_editor.py +++ b/examples/poly_editor.py @@ -37,6 +37,7 @@ def __init__(self, ax, poly): x, y = zip(*self.poly.xy) self.line = Line2D(x,y,marker='o', markerfacecolor='r', animated=True) + self.ax.add_line(self.line) #self._update_line(poly) cid = self.poly.add_callback(self.poly_changed) From 966e63157a4c6d6b1ac9157bd33434e3f555dfea Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 21 Jan 2008 19:03:48 +0000 Subject: [PATCH 010/324] Fix bug with pie chart slices less than 2.5 degrees. svn path=/branches/v0_91_maint/; revision=4882 --- lib/matplotlib/patches.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index ab9348351ca0..8304553bd71c 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -526,7 +526,9 @@ def __init__(self, center, r, theta1, theta2, theta1 = float(theta1) theta2 = float(theta2) dtheta = float(dtheta) - num_points = abs(theta2 - theta1) / dtheta + num_points = (abs(theta2 - theta1) / dtheta) + if num_points < 2.0: + num_points = 2.0 rads = (npy.pi/180.) * npy.linspace(theta1, theta2, num_points, endpoint=True) xs = r*npy.cos(rads)+xc ys = r*npy.sin(rads)+yc From 43b38765fa357e1a9578b0a5b546c1f3be76e4fc Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sat, 26 Jan 2008 00:11:36 +0000 Subject: [PATCH 011/324] Apply patch by Manuel Metz to scatter docstring. svn path=/branches/v0_91_maint/; revision=4896 --- lib/matplotlib/axes.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 5edc4386a6e9..3a73e5e9b998 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -4047,10 +4047,22 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None, 'p' : pentagram 'h' : hexagon '8' : octagon - - If marker is None and verts is not None, verts is a sequence - of (x,y) vertices for a custom scatter symbol. - + + The marker can also be a tuple (numsides, style, angle), which will + create a custom, regular symbol. + + numsides is the number of sides + + style is the style of the regular symbol: + 0 : a regular polygon + 1 : a star-like symbol + 2 : an asterisk + + angle is the angle of rotation of the symbol + + Finally, marker can be (verts, 0), verts is a sequence of (x,y) + vertices for a custom scatter symbol. + s is a size argument in points squared. Any or all of x, y, s, and c may be masked arrays, in which From d46da1cd6836fb009052ed2286f0b4b2a33583ae Mon Sep 17 00:00:00 2001 From: James Evans Date: Mon, 28 Jan 2008 18:02:31 +0000 Subject: [PATCH 012/324] Fixed a bug where plotting a singe point unitized errorbar data would fail. Fixed a bug where plotting errorbar data where the error is a duration for a time valued axes would fail. svn path=/branches/v0_91_maint/; revision=4904 --- lib/matplotlib/axes.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 3a73e5e9b998..8f41bced21e0 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -331,7 +331,6 @@ def makefill(x, y): self.set_patchprops(seg, **kwargs) ret.append(seg) - if self.command == 'plot': func = makeline else: func = makefill if multicol: @@ -2513,10 +2512,6 @@ def vlines(self, x, ymin, ymax, colors='k', linestyle='solid', ymin = npy.asarray(ymin) ymax = npy.asarray(ymax) - if len(ymin)==1: - ymin = ymin*npy.ones(x.shape, x.dtype) - if len(ymax)==1: - ymax = ymax*npy.ones(x.shape, x.dtype) if len(ymin)!=len(x): raise ValueError, 'ymin and x are unequal sized sequences' @@ -2533,12 +2528,17 @@ def vlines(self, x, ymin, ymax, colors='k', linestyle='solid', self.add_collection(coll) coll.update(kwargs) - minx = x.min() - maxx = x.max() - miny = min(ymin.min(), ymax.min()) - maxy = max(ymin.max(), ymax.max()) - minx, maxx = self.convert_xunits((minx, maxx)) - miny, maxy = self.convert_yunits((miny, maxy)) + # We do the conversion first since not all unitized data is uniform + xx = self.convert_xunits( x ) + yymin = self.convert_yunits( ymin ) + yymax = self.convert_yunits( ymax ) + + minx = min( xx ) + maxx = max( xx ) + + miny = min( min(yymin), min(yymax) ) + maxy = max( max(yymin), max(yymax) ) + corners = (minx, miny), (maxx, maxy) self.update_datalim(corners) self.autoscale_view() @@ -2644,7 +2644,6 @@ def plot(self, *args, **kwargs): autoscaled; default True. See Axes.autoscale_view for more information """ - scalex = kwargs.pop( 'scalex', True) scaley = kwargs.pop( 'scaley', True) From 50babfa49c26b08527aece29c7aa2d012753a71e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 29 Jan 2008 20:24:58 +0000 Subject: [PATCH 013/324] Allow updating of shared axes when calling Axes.axis() (Thanks Jorgen Stenarson) svn path=/branches/v0_91_maint/; revision=4907 --- lib/matplotlib/axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 8f41bced21e0..bda531792470 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -1006,7 +1006,7 @@ def axis(self, *v, **kwargs): try: v[0] except IndexError: - emit = kwargs.get('emit', False) + emit = kwargs.get('emit', True) xmin = kwargs.get('xmin', None) xmax = kwargs.get('xmax', None) From 29466fbcb42e1ae6c84aca0597cc7cea4bfbe325 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 31 Jan 2008 15:21:10 +0000 Subject: [PATCH 014/324] Fix \sqrt with a numeric radical. svn path=/branches/v0_91_maint/; revision=4911 --- CHANGELOG | 3 +++ examples/mathtext_examples.py | 6 +++--- lib/matplotlib/mathtext.py | 13 ++----------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 06bebe2a4549..de76bbf76d57 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-01-31 Fix \sqrt with radical number (broken by making [ and ] + work below) - MGD + 2008-01-10 Fix bug displaying [ and ] in mathtext - MGD 2008-01-10 Fix bug when displaying a tick value offset with scientific diff --git a/examples/mathtext_examples.py b/examples/mathtext_examples.py index e5258a35c887..7d9581553bfe 100755 --- a/examples/mathtext_examples.py +++ b/examples/mathtext_examples.py @@ -40,7 +40,7 @@ r"$f^'$", r'$\frac{x_2888}{y}$', r"$\sqrt[3]{\frac{X_2}{Y}}=5$", - r"$\sqrt[5x\pi]{\prod^\frac{x}{2\pi^2}_\infty}$", + r"$\sqrt[5]{\prod^\frac{x}{2\pi^2}_\infty}$", r"$\sqrt[3]{x}=5$", r'$\frac{X}{\frac{X}{Y}}$', # From UTR #25 @@ -56,7 +56,7 @@ def doall(): tests = stests - + figure(figsize=(8, (len(tests) * 1) + 2)) plot([0, 0], 'r') grid(False) @@ -69,7 +69,7 @@ def doall(): savefig('mathtext_examples') #close('all') show() - + if '--latex' in sys.argv: fd = open("mathtext_examples.ltx", "w") fd.write("\\documentclass{article}\n") diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 6e194c1d8f7a..34de301dd98f 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -2109,12 +2109,7 @@ def __init__(self): ) + Optional( Suppress(Literal("[")) - + Group( - OneOrMore( - (c_over_c | symbol) - ^ font - ) - ) + + Regex("[0-9]+") + Suppress(Literal("]")), default = None ) @@ -2607,11 +2602,7 @@ def sqrt(self, s, loc, toks): if root is None: root = Box(0., 0., 0.) else: - if not isinstance(root, ParseResults): - raise ParseFatalException( - "Can not parse root of radical. " - "Only simple symbols are allowed in the root.") - root = Hlist(root.asList()) + root = Hlist([Char(x, state) for x in root]) root.shrink() root.shrink() From 70d99997a25925de72314375e4ded2c4ed20a552 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 31 Jan 2008 18:59:22 +0000 Subject: [PATCH 015/324] Fix text spacing problems in PDF backend with some fonts. svn path=/branches/v0_91_maint/; revision=4914 --- CHANGELOG | 3 +++ lib/matplotlib/backends/backend_pdf.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index de76bbf76d57..660a797359b7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-01-31 Fix text spacing problems in PDF backend with *some* fonts, + such as STIXGeneral. + 2008-01-31 Fix \sqrt with radical number (broken by making [ and ] work below) - MGD diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 2c1c1f58f7c0..3b380677e113 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -795,8 +795,7 @@ def embedTTFType42(font, characters, descriptor): ccode = ord(c) gind = cmap.get(ccode) or 0 glyph = font.load_char(ccode, flags=LOAD_NO_HINTING) - # Why divided by 3.0 ??? Wish I knew... MGD - widths.append((ccode, cvt(glyph.horiAdvance) / 3.0)) + widths.append((ccode, glyph.horiAdvance / 6)) if ccode < 65536: cid_to_gid_map[ccode] = unichr(gind) max_ccode = max(ccode, max_ccode) From bc88e8cf83d2a28711b5f726a60661f0aed5359c Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Thu, 31 Jan 2008 19:05:28 +0000 Subject: [PATCH 016/324] fixed a bug in ticker, unicode string passed to tex svn path=/branches/v0_91_maint/; revision=4916 --- CHANGELOG | 2 ++ lib/matplotlib/ticker.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 660a797359b7..cb08f8c5a2db 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-01-31 Don't use unicode strings with usetex by default - DSD + 2008-01-31 Fix text spacing problems in PDF backend with *some* fonts, such as STIXGeneral. diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 088941b4e3c5..9731d4e64711 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -338,7 +338,7 @@ def get_offset(self): return ''.join(('$',sciNotStr,r'\mathdefault{',offsetStr,'}$')) elif self._usetex: if sciNotStr != '': - sciNotStr = u'\xd7%s' % sciNotStr + sciNotStr = u'\times%s' % sciNotStr return ''.join(('$',sciNotStr,offsetStr,'$')) else: return ''.join((sciNotStr,offsetStr)) From e4a937ce2390ebeed090ebe38f12e041404f704d Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Thu, 31 Jan 2008 19:14:20 +0000 Subject: [PATCH 017/324] forgot to change unicode string to raw string svn path=/branches/v0_91_maint/; revision=4917 --- lib/matplotlib/ticker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 9731d4e64711..55405dfbc60f 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -338,7 +338,7 @@ def get_offset(self): return ''.join(('$',sciNotStr,r'\mathdefault{',offsetStr,'}$')) elif self._usetex: if sciNotStr != '': - sciNotStr = u'\times%s' % sciNotStr + sciNotStr = r'\times%s' % sciNotStr return ''.join(('$',sciNotStr,offsetStr,'$')) else: return ''.join((sciNotStr,offsetStr)) From 455ef08b4590a078942a12338fcfe9c958e1fcfb Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 1 Feb 2008 17:19:02 +0000 Subject: [PATCH 018/324] Fix reference leak on Glyph objects. svn path=/branches/v0_91_maint/; revision=4918 --- CHANGELOG | 2 ++ src/ft2font.cpp | 46 ++++++++++++++++++++++------------------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index cb08f8c5a2db..b38b17fb72b2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD + 2008-01-31 Don't use unicode strings with usetex by default - DSD 2008-01-31 Fix text spacing problems in PDF backend with *some* fonts, diff --git a/src/ft2font.cpp b/src/ft2font.cpp index cd1b073df866..a28677583869 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -8,9 +8,9 @@ /** To improve the hinting of the fonts, this code uses a hack presented here: - + http://antigrain.com/research/font_rasterization/index.html - + The idea is to limit the effect of hinting in the x-direction, while preserving hinting in the y-direction. Since freetype does not support this directly, the dpi in the x-direction is set higher than @@ -20,7 +20,7 @@ hinting, whereas the global transform does not, this is documented behavior of freetype, and therefore hopefully unlikely to change. The freetype 2 tutorial says: - + NOTE: The transformation is applied to every glyph that is loaded through FT_Load_Glyph and is completely independent of any hinting process. This means that you won't get the same @@ -42,7 +42,7 @@ FT_Library _ft2Library; -// FT2Image::FT2Image() : +// FT2Image::FT2Image() : // _isDirty(true), // _buffer(NULL), // _width(0), _height(0), @@ -53,7 +53,7 @@ FT_Library _ft2Library; FT2Image::FT2Image(unsigned long width, unsigned long height) : _isDirty(true), - _buffer(NULL), + _buffer(NULL), _width(0), _height(0), _rgbCopy(NULL), _rgbaCopy(NULL) { @@ -61,10 +61,10 @@ FT2Image::FT2Image(unsigned long width, unsigned long height) : resize(width, height); } -FT2Image::~FT2Image() { +FT2Image::~FT2Image() { _VERBOSE("FT2Image::~FT2Image"); - delete [] _buffer; - _buffer=NULL; + delete [] _buffer; + _buffer=NULL; delete _rgbCopy; delete _rgbaCopy; } @@ -151,7 +151,7 @@ FT2Image::py_write_bitmap(const Py::Tuple & args) { } void -FT2Image::draw_rect(unsigned long x0, unsigned long y0, +FT2Image::draw_rect(unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1) { if ( x0<0 || y0<0 || x1<0 || y1<0 || x0>_width || x1>_width || @@ -195,7 +195,7 @@ FT2Image::py_draw_rect(const Py::Tuple & args) { return Py::Object(); } -void FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0, +void FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1) { x0 = CLAMP(x0, 0, _width); y0 = CLAMP(y0, 0, _height); @@ -209,7 +209,7 @@ void FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0, } _isDirty = true; -} +} char FT2Image::draw_rect_filled__doc__[] = "draw_rect_filled(x0, y0, x1, y1)\n" @@ -245,7 +245,7 @@ FT2Image::py_as_str(const Py::Tuple & args) { args.verify_length(0); return Py::asObject - (PyString_FromStringAndSize((const char *)_buffer, + (PyString_FromStringAndSize((const char *)_buffer, _width*_height) ); } @@ -284,7 +284,7 @@ FT2Image::py_as_rgb_str(const Py::Tuple & args) { args.verify_length(0); makeRgbCopy(); - + return _rgbCopy->py_as_str(args); } @@ -321,7 +321,7 @@ FT2Image::py_as_rgba_str(const Py::Tuple & args) { args.verify_length(0); makeRgbaCopy(); - + return _rgbaCopy->py_as_str(args); } @@ -671,7 +671,7 @@ FT2Font::FT2Font(std::string facefile) : } // set a default fontsize 12 pt at 72dpi -#ifdef VERTICAL_HINTING +#ifdef VERTICAL_HINTING error = FT_Set_Char_Size( face, 12 * 64, 0, 72 * HORIZ_HINTING, 72 ); static FT_Matrix transform = { 65536 / HORIZ_HINTING, 0, 0, 65536 }; FT_Set_Transform( face, &transform, 0 ); @@ -829,7 +829,7 @@ FT2Font::set_size(const Py::Tuple & args) { int error = FT_Set_Char_Size( face, (long)(ptsize * 64), 0, (unsigned int)dpi, (unsigned int)dpi ); -#endif +#endif if (error) throw Py::RuntimeError("Could not set the fontsize"); return Py::Object(); @@ -1036,7 +1036,6 @@ FT2Font::get_glyph(const Py::Tuple & args){ if ( (size_t)num >= gms.size()) throw Py::ValueError("Glyph index out of range"); - Py_INCREF(gms[num]); return Py::asObject(gms[num]); } @@ -1078,7 +1077,7 @@ FT2Font::load_char(const Py::Tuple & args, const Py::Dict & kwargs) { long charcode = Py::Long(args[0]), flags = Py::Long(FT_LOAD_FORCE_AUTOHINT); if (kwargs.hasKey("flags")) flags = Py::Long(kwargs["flags"]); - + int error = FT_Load_Char( face, (unsigned long)charcode, flags); if (error) @@ -1094,7 +1093,6 @@ FT2Font::load_char(const Py::Tuple & args, const Py::Dict & kwargs) { glyphs.push_back(thisGlyph); Glyph* gm = new Glyph(face, thisGlyph, num); gms.push_back(gm); - Py_INCREF(gm); //todo: refcount correct? return Py::asObject( gm); } @@ -1659,7 +1657,7 @@ FT2Font::get_sfnt_table(const Py::Tuple & args) { } } -char FT2Font::get_image__doc__ [] = +char FT2Font::get_image__doc__ [] = "get_image()\n" "\n" "Returns the underlying image buffer for this font object.\n"; @@ -1669,7 +1667,7 @@ FT2Font::get_image (const Py::Tuple &args) { if (image) { Py_XINCREF(image); return Py::asObject(image); - } + } throw Py::RuntimeError("You must call .set_text() before .get_image()"); } @@ -1684,7 +1682,7 @@ FT2Font::attach_file (const Py::Tuple &args) { args.verify_length(1); std::string filename = Py::String(args[0]); - FT_Error error = + FT_Error error = FT_Attach_File(face, filename.c_str()); if (error) { @@ -1884,7 +1882,7 @@ initft2font(void) d["KERNING_DEFAULT"] = Py::Int(FT_KERNING_DEFAULT); d["KERNING_UNFITTED"] = Py::Int(FT_KERNING_UNFITTED); d["KERNING_UNSCALED"] = Py::Int(FT_KERNING_UNSCALED); - + d["LOAD_DEFAULT"] = Py::Long(FT_LOAD_DEFAULT); d["LOAD_NO_SCALE"] = Py::Long(FT_LOAD_NO_SCALE); d["LOAD_NO_HINTING"] = Py::Long(FT_LOAD_NO_HINTING); @@ -1894,7 +1892,7 @@ initft2font(void) d["LOAD_FORCE_AUTOHINT"] = Py::Long(FT_LOAD_FORCE_AUTOHINT); d["LOAD_CROP_BITMAP"] = Py::Long(FT_LOAD_CROP_BITMAP); d["LOAD_PEDANTIC"] = Py::Long(FT_LOAD_PEDANTIC); - d["LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH"] = + d["LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH"] = Py::Long(FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); d["LOAD_NO_RECURSE"] = Py::Long(FT_LOAD_NO_RECURSE); d["LOAD_IGNORE_TRANSFORM"] = Py::Long(FT_LOAD_IGNORE_TRANSFORM); From 92ed2019bbcdc7945dc76ade287890e09166c8cf Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 1 Feb 2008 17:24:56 +0000 Subject: [PATCH 019/324] Change "delete" to "delete []" for arrays on the heap. (It's technically more correct, but also pleases valgrind.) svn path=/branches/v0_91_maint/; revision=4920 --- src/_backend_agg.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 6fb3b91ff7bf..5960957ed332 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -1110,10 +1110,10 @@ RendererAgg::draw_quad_mesh(const Py::Tuple& args){ newXCoords[k] += newXOffsets[k]; newYCoords[k] += newYOffsets[k]; } - delete xOffsets; - delete yOffsets; - delete newXOffsets; - delete newYOffsets; + delete[] xOffsets; + delete[] yOffsets; + delete[] newXOffsets; + delete[] newYOffsets; } for(q=0; q < Nverts; q++) @@ -1129,8 +1129,8 @@ RendererAgg::draw_quad_mesh(const Py::Tuple& args){ Py_XDECREF(xCoords); Py_XDECREF(yCoords); Py_XDECREF(colors); - delete newXCoords; - delete newYCoords; + delete[] newXCoords; + delete[] newYCoords; //printf("#2: %d\n", clock()); return Py::Object(); } From be0c7e5c68f30e74587f481cc5d4189917949e8b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 1 Feb 2008 18:02:14 +0000 Subject: [PATCH 020/324] Backing out Glyph object leak fix, since it causes segfaults with PDF backend. Will look into it further. svn path=/branches/v0_91_maint/; revision=4922 --- src/ft2font.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ft2font.cpp b/src/ft2font.cpp index a28677583869..dee10991069b 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -1036,6 +1036,7 @@ FT2Font::get_glyph(const Py::Tuple & args){ if ( (size_t)num >= gms.size()) throw Py::ValueError("Glyph index out of range"); + Py_INCREF(gm); return Py::asObject(gms[num]); } @@ -1093,6 +1094,7 @@ FT2Font::load_char(const Py::Tuple & args, const Py::Dict & kwargs) { glyphs.push_back(thisGlyph); Glyph* gm = new Glyph(face, thisGlyph, num); gms.push_back(gm); + Py_INCREF(gm); return Py::asObject( gm); } From dd16528daed83f21470e86985a4459f94e69fdd0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 1 Feb 2008 18:03:52 +0000 Subject: [PATCH 021/324] Oops in last commit. svn path=/branches/v0_91_maint/; revision=4924 --- src/ft2font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ft2font.cpp b/src/ft2font.cpp index dee10991069b..2491a1040da5 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -1036,7 +1036,7 @@ FT2Font::get_glyph(const Py::Tuple & args){ if ( (size_t)num >= gms.size()) throw Py::ValueError("Glyph index out of range"); - Py_INCREF(gm); + Py_INCREF(gms[num]); return Py::asObject(gms[num]); } From f0aa4487974d994ce269b9fbffb3b0609964d53a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 1 Feb 2008 18:36:38 +0000 Subject: [PATCH 022/324] Hopefully fixing the Glyph memory leak properly now. svn path=/branches/v0_91_maint/; revision=4925 --- src/ft2font.cpp | 36 ++---------------------------------- src/ft2font.h | 18 ++++++++---------- 2 files changed, 10 insertions(+), 44 deletions(-) diff --git a/src/ft2font.cpp b/src/ft2font.cpp index 2491a1040da5..c41145b7add9 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -749,10 +749,6 @@ FT2Font::~FT2Font() for (size_t i=0; i= gms.size()) - throw Py::ValueError("Glyph index out of range"); - - Py_INCREF(gms[num]); - return Py::asObject(gms[num]); -} - char FT2Font::get_num_glyphs__doc__[] = "get_num_glyphs()\n" "\n" @@ -1093,9 +1065,7 @@ FT2Font::load_char(const Py::Tuple & args, const Py::Dict & kwargs) { size_t num = glyphs.size(); //the index into the glyphs list glyphs.push_back(thisGlyph); Glyph* gm = new Glyph(face, thisGlyph, num); - gms.push_back(gm); - Py_INCREF(gm); - return Py::asObject( gm); + return Py::asObject(gm); } char FT2Font::get_width_height__doc__[] = @@ -1763,8 +1733,6 @@ FT2Font::init_type() { add_varargs_method("get_xys", &FT2Font::get_xys, FT2Font::get_xys__doc__); - add_varargs_method("get_glyph", &FT2Font::get_glyph, - FT2Font::get_glyph__doc__); add_varargs_method("get_num_glyphs", &FT2Font::get_num_glyphs, FT2Font::get_num_glyphs__doc__); add_keyword_method("load_char", &FT2Font::load_char, diff --git a/src/ft2font.h b/src/ft2font.h index 4a8d58a384e8..6239a2e3e04d 100644 --- a/src/ft2font.h +++ b/src/ft2font.h @@ -30,11 +30,11 @@ class FT2Image : public Py::PythonExtension { void draw_bitmap(FT_Bitmap* bitmap, FT_Int x, FT_Int y); void write_bitmap(const char* filename) const; - void draw_rect(unsigned long x0, unsigned long y0, + void draw_rect(unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1); - void draw_rect_filled(unsigned long x0, unsigned long y0, + void draw_rect_filled(unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1); - + unsigned int get_width() const { return _width; }; unsigned int get_height() const { return _height; }; const unsigned char *const get_buffer() const { return _buffer; }; @@ -94,7 +94,6 @@ class FT2Font : public Py::PythonExtension { Py::Object set_size(const Py::Tuple & args); Py::Object set_charmap(const Py::Tuple & args); Py::Object set_text(const Py::Tuple & args, const Py::Dict & kwargs); - Py::Object get_glyph(const Py::Tuple & args); Py::Object get_kerning(const Py::Tuple & args); Py::Object get_num_glyphs(const Py::Tuple & args); Py::Object load_char(const Py::Tuple & args, const Py::Dict & kws); @@ -124,7 +123,6 @@ class FT2Font : public Py::PythonExtension { FT_Error error; std::vector glyphs; std::vector pos; - std::vector gms; double angle; double ptsize; double dpi; @@ -168,16 +166,16 @@ class ft2font_module : public Py::ExtensionModule Glyph::init_type(); FT2Font::init_type(); - add_varargs_method("FT2Font", &ft2font_module::new_ft2font, + add_varargs_method("FT2Font", &ft2font_module::new_ft2font, "FT2Font"); - add_varargs_method("FT2Image", &ft2font_module::new_ft2image, + add_varargs_method("FT2Image", &ft2font_module::new_ft2image, "FT2Image"); initialize( "The ft2font module" ); } - - ~ft2font_module(); + + ~ft2font_module(); //static FT_Library ft2Library; - + private: Py::Object new_ft2font (const Py::Tuple &args); From bfc1952b514600bf2310b068da6fe21679790838 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 1 Feb 2008 19:13:09 +0000 Subject: [PATCH 023/324] Fix doubly-included fonts in Postscript files. svn path=/branches/v0_91_maint/; revision=4927 --- lib/matplotlib/mathtext.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 34de301dd98f..3faa041bff9e 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -552,7 +552,6 @@ class TruetypeFonts(Fonts): A generic base class for all font setups that use Truetype fonts (through ft2font) """ - basepath = os.path.join( get_data_path(), 'fonts' ) _fonts = {} class CachedFont: @@ -686,7 +685,7 @@ def __init__(self, *args, **kwargs): TruetypeFonts.__init__(self, *args, **kwargs) if not len(self.fontmap): for key, val in self._fontmap.iteritems(): - fullpath = os.path.join(self.basepath, 'ttf', val + ".ttf") + fullpath = findfont(val) self.fontmap[key] = fullpath self.fontmap[val] = fullpath @@ -913,7 +912,7 @@ def __init__(self, *args, **kwargs): TruetypeFonts.__init__(self, *args, **kwargs) if not len(self.fontmap): for key, name in self._fontmap.iteritems(): - fullpath = os.path.join(self.basepath, 'ttf', name + ".ttf") + fullpath = findfont(name) self.fontmap[key] = fullpath self.fontmap[name] = fullpath From 8c974c700d1819f381b0a94cb76c29a2fda0fb0e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 6 Feb 2008 14:02:11 +0000 Subject: [PATCH 024/324] Updating changelog svn path=/branches/v0_91_maint/; revision=4946 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b38b17fb72b2..91756d70d635 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-02-01 Fix doubly-included font problem in Postscript backend - MGD + 2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD 2008-01-31 Don't use unicode strings with usetex by default - DSD From 6d51df50a057cb85a9c9f13a2c851582d1a3a927 Mon Sep 17 00:00:00 2001 From: James Evans Date: Fri, 8 Feb 2008 17:56:12 +0000 Subject: [PATCH 025/324] Removed a reference to nx, replaced with numpy. svn path=/branches/v0_91_maint/; revision=4948 --- examples/units/units_sample.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/units/units_sample.py b/examples/units/units_sample.py index 1671a45974e4..bf54a0476613 100644 --- a/examples/units/units_sample.py +++ b/examples/units/units_sample.py @@ -8,9 +8,10 @@ """ from basic_units import cm, inch -from pylab import figure, show, nx +from pylab import figure, show +import numpy -cms = cm *nx.arange(0, 10, 2) +cms = cm *numpy.arange(0, 10, 2) fig = figure() From 1e6c77524379d0c7dc8e9b934cf191a61160e236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Mon, 11 Feb 2008 19:40:18 +0000 Subject: [PATCH 026/324] Update plotting() doc string to refer to getp/setp. svn path=/branches/v0_91_maint/; revision=4951 --- CHANGELOG | 2 ++ lib/matplotlib/pyplot.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 91756d70d635..3385f6001562 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-02-11 Update plotting() doc string to refer to getp/setp. - JKS + 2008-02-01 Fix doubly-included font problem in Postscript backend - MGD 2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 804e07b2496f..b950ac58996d 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -933,7 +933,7 @@ def plotting(): gca - return the current axes gcf - return the current figure gci - get the current image, or None - get - get a handle graphics property + getp - get a handle graphics property hist - make a histogram hold - set the hold state on current axes legend - add a legend to the axes @@ -949,7 +949,7 @@ def plotting(): rc - control the default params savefig - save the current figure scatter - make a scatter plot - set - set a handle graphics property + setp - set a handle graphics property semilogx - log x axis semilogy - log y axis show - show the figures From 2cca74a7ddb2c4c7533f463cc2635c16fd38239d Mon Sep 17 00:00:00 2001 From: John Hunter Date: Tue, 19 Feb 2008 15:26:56 +0000 Subject: [PATCH 027/324] added rec_groupby and rec2txt svn path=/branches/v0_91_maint/; revision=4977 --- CHANGELOG | 4 + examples/data/aapl.csv | 3134 ++++++++++++++++++++++++++++++++++ examples/rec_groupby_demo.py | 48 + lib/matplotlib/mlab.py | 238 ++- 4 files changed, 3417 insertions(+), 7 deletions(-) create mode 100644 examples/data/aapl.csv create mode 100644 examples/rec_groupby_demo.py diff --git a/CHANGELOG b/CHANGELOG index 3385f6001562..dcff34f7af8c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2008-02-16 Added some new rec array functionality to mlab + (rec_summarize, rec2txt and rec_groupby). See + examples/rec_groupby_demo.py. Thanks to Tim M for rec2txt. + 2008-02-11 Update plotting() doc string to refer to getp/setp. - JKS 2008-02-01 Fix doubly-included font problem in Postscript backend - MGD diff --git a/examples/data/aapl.csv b/examples/data/aapl.csv new file mode 100644 index 000000000000..3744405ce112 --- /dev/null +++ b/examples/data/aapl.csv @@ -0,0 +1,3134 @@ +Date,Open,High,Low,Close,Volume,Adj Close +2008-02-15,126.27,127.08,124.06,124.63,32163400,124.63 +2008-02-14,129.40,130.80,127.01,127.46,34074900,127.46 +2008-02-13,126.68,129.78,125.63,129.40,34542300,129.40 +2008-02-12,130.70,131.00,123.62,124.86,43749900,124.86 +2008-02-11,128.01,129.98,127.20,129.45,42886900,129.45 +2008-02-08,122.08,125.70,121.60,125.48,48412700,125.48 +2008-02-07,119.97,124.78,117.27,121.24,74404700,121.24 +2008-02-06,130.83,131.92,121.77,122.00,56093900,122.00 +2008-02-05,130.43,134.00,128.90,129.36,40723400,129.36 +2008-02-04,134.21,135.90,131.42,131.65,32103400,131.65 +2008-02-01,136.24,136.59,132.18,133.75,36085400,133.75 +2008-01-31,129.45,136.65,129.40,135.36,48004500,135.36 +2008-01-30,131.37,135.45,130.00,132.18,44323500,132.18 +2008-01-29,131.15,132.79,129.05,131.54,39269800,131.54 +2008-01-28,128.16,133.20,126.45,130.01,52628400,130.01 +2008-01-25,138.99,139.09,129.61,130.01,55440400,130.01 +2008-01-24,139.99,140.70,132.01,135.60,71564900,135.60 +2008-01-23,136.19,140.00,126.14,139.07,120415200,139.07 +2008-01-22,148.06,159.98,146.00,155.64,86214800,155.64 +2008-01-18,161.71,165.75,159.61,161.36,61547400,161.36 +2008-01-17,161.51,165.36,158.42,160.89,62780700,160.89 +2008-01-16,165.23,169.01,156.70,159.64,79065900,159.64 +2008-01-15,177.72,179.22,164.66,169.04,83688500,169.04 +2008-01-14,177.52,179.42,175.17,178.78,39256900,178.78 +2008-01-11,176.00,177.85,170.00,172.69,43936100,172.69 +2008-01-10,177.58,181.00,175.41,178.02,52904500,178.02 +2008-01-09,171.30,179.50,168.30,179.40,64781500,179.40 +2008-01-08,180.14,182.46,170.80,171.25,54338200,171.25 +2008-01-07,181.25,183.60,170.23,177.64,73972900,177.64 +2008-01-04,191.45,193.00,178.89,180.05,51959400,180.05 +2008-01-03,195.41,197.39,192.69,194.93,30052300,194.93 +2008-01-02,199.27,200.26,192.55,194.84,38519200,194.84 +2007-12-31,199.50,200.50,197.75,198.08,19249800,198.08 +2007-12-28,200.59,201.56,196.88,199.83,24766200,199.83 +2007-12-27,198.95,202.96,197.80,198.57,28383000,198.57 +2007-12-26,199.01,200.96,196.82,198.95,25110500,198.95 +2007-12-24,195.03,199.33,194.79,198.80,17150100,198.80 +2007-12-21,190.12,193.91,189.89,193.91,35498600,193.91 +2007-12-20,185.43,187.83,183.33,187.21,27603200,187.21 +2007-12-19,182.98,184.64,180.90,183.12,29484300,183.12 +2007-12-18,186.52,187.33,178.60,182.98,43649200,182.98 +2007-12-17,190.72,192.65,182.98,184.40,36556700,184.40 +2007-12-14,190.37,193.20,189.54,190.39,24082600,190.39 +2007-12-13,190.19,192.12,187.82,191.83,30879200,191.83 +2007-12-12,193.44,194.48,185.76,190.86,43696200,190.86 +2007-12-11,194.75,196.83,187.39,188.54,39589700,188.54 +2007-12-10,193.59,195.66,192.69,194.21,25776800,194.21 +2007-12-07,190.54,194.99,188.04,194.30,38057700,194.30 +2007-12-06,186.19,190.10,186.12,189.95,32136100,189.95 +2007-12-05,182.89,186.00,182.41,185.50,31833300,185.50 +2007-12-04,177.15,180.90,176.99,179.81,27625500,179.81 +2007-12-03,181.86,184.14,177.70,178.86,34308100,178.86 +2007-11-30,187.34,187.70,179.70,182.22,42400500,182.22 +2007-11-29,179.43,185.17,179.15,184.29,37413100,184.29 +2007-11-28,176.82,180.60,175.35,180.22,41073100,180.22 +2007-11-27,175.22,175.79,170.01,174.81,47005000,174.81 +2007-11-26,173.59,177.27,172.35,172.54,46603400,172.54 +2007-11-23,172.00,172.05,169.75,171.54,16622500,171.54 +2007-11-21,165.84,172.35,164.67,168.46,43493200,168.46 +2007-11-20,165.67,171.79,163.53,168.85,55076200,168.85 +2007-11-19,166.10,168.20,162.10,163.95,41196800,163.95 +2007-11-16,165.30,167.02,159.33,166.39,49391300,166.39 +2007-11-15,166.39,169.59,160.30,164.30,53095600,164.30 +2007-11-14,177.16,177.57,163.74,166.11,51695400,166.11 +2007-11-13,160.85,170.98,153.76,169.96,62034100,169.96 +2007-11-12,165.28,167.70,150.63,153.76,63057700,153.76 +2007-11-09,171.15,175.12,165.21,165.37,54458700,165.37 +2007-11-08,186.67,186.90,167.77,175.47,67458500,175.47 +2007-11-07,190.61,192.68,186.13,186.30,35473400,186.30 +2007-11-06,187.05,192.00,185.27,191.79,34068500,191.79 +2007-11-05,185.29,188.96,184.24,186.18,28703700,186.18 +2007-11-02,189.21,189.44,183.49,187.87,35769600,187.87 +2007-11-01,188.60,190.10,180.00,187.44,28734100,187.44 +2007-10-31,187.63,190.12,184.95,189.95,29699700,189.95 +2007-10-30,186.18,189.37,184.73,187.00,33495900,187.00 +2007-10-29,185.45,186.59,184.70,185.09,19281800,185.09 +2007-10-26,185.29,185.37,182.88,184.70,25219800,184.70 +2007-10-25,184.87,185.90,181.66,182.78,34729500,182.78 +2007-10-24,185.81,187.21,179.24,185.93,45961300,185.93 +2007-10-23,188.56,188.60,182.76,186.16,64005900,186.16 +2007-10-22,170.35,174.90,169.96,174.36,56203900,174.36 +2007-10-19,174.24,174.63,170.00,170.42,46063800,170.42 +2007-10-18,171.50,174.19,171.05,173.50,29417000,173.50 +2007-10-17,172.69,173.04,169.18,172.75,39969400,172.75 +2007-10-16,165.54,170.18,165.15,169.58,38093400,169.58 +2007-10-15,167.98,169.57,163.50,166.98,38448900,166.98 +2007-10-12,163.01,167.28,161.80,167.25,35244200,167.25 +2007-10-11,169.49,171.88,153.21,162.23,58671500,162.23 +2007-10-10,167.55,167.88,165.60,166.79,23779600,166.79 +2007-10-09,170.20,171.11,166.68,167.86,39438800,167.86 +2007-10-08,163.49,167.91,162.97,167.91,29815900,167.91 +2007-10-05,158.37,161.58,157.70,161.45,33595200,161.45 +2007-10-04,158.00,158.08,153.50,156.24,23402900,156.24 +2007-10-03,157.78,159.18,157.01,157.92,24696400,157.92 +2007-10-02,156.55,158.59,155.89,158.45,28250600,158.45 +2007-10-01,154.63,157.41,152.93,156.34,29861300,156.34 +2007-09-28,153.44,154.60,152.75,153.47,21915800,153.47 +2007-09-27,153.77,154.52,152.32,154.50,23427700,154.50 +2007-09-26,154.47,155.00,151.25,152.77,34801900,152.77 +2007-09-25,146.84,153.22,146.82,153.18,42572900,153.18 +2007-09-24,146.73,149.85,146.65,148.28,37506200,148.28 +2007-09-21,141.14,144.65,140.31,144.15,40651300,144.15 +2007-09-20,140.15,141.79,139.32,140.31,24575400,140.31 +2007-09-19,143.02,143.16,139.40,140.77,36633200,140.77 +2007-09-18,139.06,142.85,137.83,140.92,37951300,140.92 +2007-09-17,138.99,140.59,137.60,138.41,28301900,138.41 +2007-09-14,136.57,138.98,136.20,138.81,21674400,138.81 +2007-09-13,138.83,139.00,136.65,137.20,23434400,137.20 +2007-09-12,135.99,139.40,135.75,136.85,36527500,136.85 +2007-09-11,137.90,138.30,133.75,135.49,34710200,135.49 +2007-09-10,136.99,138.04,133.95,136.71,53137100,136.71 +2007-09-07,132.01,132.30,130.00,131.77,51092000,131.77 +2007-09-06,135.56,137.57,132.71,135.01,67902200,135.01 +2007-09-05,144.97,145.84,136.10,136.76,83150800,136.76 +2007-09-04,139.94,145.73,139.84,144.16,47030100,144.16 +2007-08-31,139.49,139.65,137.41,138.48,31317400,138.48 +2007-08-30,132.67,138.25,132.30,136.25,51270800,136.25 +2007-08-29,129.88,134.18,129.54,134.08,41673600,134.08 +2007-08-28,130.99,132.41,126.63,126.82,42120200,126.82 +2007-08-27,133.39,134.66,132.10,132.25,25265700,132.25 +2007-08-24,130.53,135.37,129.81,135.30,32565500,135.30 +2007-08-23,133.09,133.34,129.76,131.07,30958500,131.07 +2007-08-22,131.22,132.75,130.33,132.51,37920200,132.51 +2007-08-21,122.21,128.96,121.00,127.57,46537400,127.57 +2007-08-20,123.96,124.50,120.50,122.22,28689900,122.22 +2007-08-17,122.01,123.50,119.82,122.06,42680800,122.06 +2007-08-16,117.01,118.50,111.62,117.05,66667500,117.05 +2007-08-15,122.74,124.86,119.65,119.90,35459000,119.90 +2007-08-14,128.29,128.30,123.71,124.03,26393100,124.03 +2007-08-13,128.32,129.35,126.50,127.79,26889700,127.79 +2007-08-10,123.12,127.75,120.30,125.00,50383900,125.00 +2007-08-09,131.11,133.00,125.09,126.39,40192700,126.39 +2007-08-08,136.76,136.86,132.00,134.01,28860600,134.01 +2007-08-07,134.94,137.24,132.63,135.03,33926300,135.03 +2007-08-06,132.90,135.27,128.30,135.25,33041800,135.25 +2007-08-03,135.26,135.95,131.50,131.85,24256700,131.85 +2007-08-02,136.65,136.96,134.15,136.49,30451600,136.49 +2007-08-01,133.64,135.38,127.77,135.00,62505600,135.00 +2007-07-31,142.97,143.48,131.52,131.76,62942600,131.76 +2007-07-30,144.33,145.45,139.57,141.43,39535300,141.43 +2007-07-27,146.19,148.92,143.78,143.85,41467800,143.85 +2007-07-26,145.91,148.50,136.96,146.00,78093900,146.00 +2007-07-25,137.35,138.36,135.00,137.26,53435100,137.26 +2007-07-24,138.88,141.00,134.15,134.89,64117600,134.89 +2007-07-23,143.31,145.22,140.93,143.70,37017500,143.70 +2007-07-20,141.65,144.18,140.00,143.75,41706200,143.75 +2007-07-19,140.30,140.81,139.65,140.00,26174700,140.00 +2007-07-18,138.19,138.44,136.04,138.12,27030600,138.12 +2007-07-17,138.30,139.60,137.50,138.91,25355700,138.91 +2007-07-16,138.39,139.98,137.50,138.10,33432600,138.10 +2007-07-13,135.03,137.85,134.52,137.73,32414500,137.73 +2007-07-12,133.85,134.24,132.39,134.07,25164600,134.07 +2007-07-11,132.07,133.70,131.31,132.39,29349000,132.39 +2007-07-10,128.88,134.50,128.81,132.35,44821700,132.35 +2007-07-09,132.38,132.90,129.18,130.33,35565000,130.33 +2007-07-06,133.13,133.34,130.40,132.30,31239100,132.30 +2007-07-05,128.80,132.97,128.69,132.75,51894700,132.75 +2007-07-03,122.00,127.40,121.50,127.17,41517200,127.17 +2007-07-02,121.05,122.09,119.30,121.26,35530800,121.26 +2007-06-29,121.97,124.00,121.09,122.04,40637200,122.04 +2007-06-28,122.36,122.49,120.00,120.56,29933700,120.56 +2007-06-27,120.61,122.04,119.26,121.89,34810600,121.89 +2007-06-26,123.98,124.00,118.72,119.65,48035900,119.65 +2007-06-25,124.19,125.09,121.06,122.34,34478700,122.34 +2007-06-22,123.85,124.45,122.38,123.00,22567000,123.00 +2007-06-21,121.70,124.29,120.72,123.90,30965900,123.90 +2007-06-20,123.87,124.66,121.50,121.55,32054000,121.55 +2007-06-19,124.69,125.01,122.91,123.66,33679500,123.66 +2007-06-18,123.28,125.18,122.54,125.09,32521600,125.09 +2007-06-15,120.62,120.67,119.86,120.50,28972100,120.50 +2007-06-14,117.20,119.45,116.42,118.75,34759500,118.75 +2007-06-13,121.15,121.19,115.40,117.50,61476900,117.50 +2007-06-12,119.35,121.71,118.31,120.38,50948800,120.38 +2007-06-11,126.00,126.15,119.54,120.19,66937800,120.19 +2007-06-08,125.82,125.83,122.29,124.49,44345800,124.49 +2007-06-07,124.99,127.61,123.19,124.07,68395700,124.07 +2007-06-06,122.30,124.05,121.95,123.64,39722900,123.64 +2007-06-05,121.41,122.69,120.50,122.67,32885200,122.67 +2007-06-04,118.63,121.73,117.90,121.33,31666900,121.33 +2007-06-01,121.10,121.19,118.29,118.40,31616500,118.40 +2007-05-31,120.07,122.17,119.54,121.19,46323800,121.19 +2007-05-30,114.30,118.88,113.53,118.77,52801600,118.77 +2007-05-29,114.45,114.86,112.69,114.35,23060500,114.35 +2007-05-25,112.00,113.78,111.50,113.62,22605700,113.62 +2007-05-24,112.81,114.46,110.37,110.69,31691500,110.69 +2007-05-23,114.02,115.00,112.59,112.89,32549100,112.89 +2007-05-22,112.49,113.75,112.01,113.54,20443200,113.54 +2007-05-21,110.31,112.45,110.05,111.98,22853300,111.98 +2007-05-18,110.23,110.64,109.77,110.02,22190900,110.02 +2007-05-17,107.15,109.87,107.15,109.44,26260400,109.44 +2007-05-16,108.53,108.83,103.42,107.34,40241700,107.34 +2007-05-15,109.57,110.20,106.48,107.52,34089800,107.52 +2007-05-14,109.62,110.00,108.25,109.36,23283800,109.36 +2007-05-11,107.74,109.13,106.78,108.74,23346300,108.74 +2007-05-10,106.63,108.84,105.92,107.34,42759200,107.34 +2007-05-09,104.91,106.96,104.89,106.88,25634200,106.88 +2007-05-08,103.47,105.15,103.42,105.06,27999900,105.06 +2007-05-07,101.08,104.35,101.01,103.92,30769900,103.92 +2007-05-04,100.80,101.60,100.50,100.81,13642400,100.81 +2007-05-03,100.73,101.45,100.01,100.40,20574200,100.40 +2007-05-02,99.65,100.54,99.47,100.39,18040900,100.39 +2007-05-01,99.59,100.35,98.55,99.47,19018700,99.47 +2007-04-30,100.09,101.00,99.67,99.80,22018200,99.80 +2007-04-27,98.18,99.95,97.69,99.92,24978700,99.92 +2007-04-26,101.58,102.50,98.30,98.84,62063500,98.84 +2007-04-25,94.23,95.40,93.80,95.35,42398000,95.35 +2007-04-24,93.96,96.39,91.30,93.24,37687600,93.24 +2007-04-23,91.59,93.80,91.42,93.51,27867500,93.51 +2007-04-20,90.89,91.18,90.55,90.97,18670700,90.97 +2007-04-19,90.19,91.25,89.83,90.27,15211200,90.27 +2007-04-18,90.16,90.85,89.60,90.40,16573000,90.40 +2007-04-17,92.00,92.30,89.70,90.35,26854300,90.35 +2007-04-16,90.57,91.50,90.25,91.43,21751200,91.43 +2007-04-13,90.90,91.40,90.06,90.24,25712200,90.24 +2007-04-12,92.04,92.31,90.72,92.19,23452700,92.19 +2007-04-11,93.90,93.95,92.33,92.59,19607800,92.59 +2007-04-10,93.67,94.26,93.41,94.25,12588100,94.25 +2007-04-09,95.21,95.30,93.04,93.65,14762200,93.65 +2007-04-05,94.12,94.68,93.52,94.68,12697000,94.68 +2007-04-04,94.94,95.14,94.13,94.27,17028000,94.27 +2007-04-03,94.14,95.23,93.76,94.50,20854800,94.50 +2007-04-02,94.14,94.25,93.02,93.65,17928300,93.65 +2007-03-30,94.28,94.68,92.75,92.91,21448500,92.91 +2007-03-29,94.19,94.19,92.23,93.75,25918700,93.75 +2007-03-28,94.88,95.40,93.15,93.24,33654900,93.24 +2007-03-27,95.71,96.83,95.00,95.46,33287600,95.46 +2007-03-26,93.99,95.90,93.30,95.85,30892400,95.85 +2007-03-23,93.35,94.07,93.30,93.52,16103000,93.52 +2007-03-22,93.73,94.36,93.00,93.96,20053300,93.96 +2007-03-21,91.99,94.00,91.65,93.87,24532000,93.87 +2007-03-20,91.35,91.84,91.06,91.48,17461300,91.48 +2007-03-19,90.24,91.55,89.59,91.13,25462900,91.13 +2007-03-16,89.54,89.99,89.32,89.59,20418000,89.59 +2007-03-15,89.96,90.36,89.31,89.57,19982100,89.57 +2007-03-14,88.60,90.00,87.92,90.00,28449500,90.00 +2007-03-13,89.41,90.60,88.40,88.40,30996100,88.40 +2007-03-12,88.07,89.99,87.99,89.87,26050300,89.87 +2007-03-09,88.80,88.85,87.40,87.97,16137000,87.97 +2007-03-08,88.59,88.72,87.46,88.00,18250400,88.00 +2007-03-07,88.05,88.97,87.45,87.72,22367300,87.72 +2007-03-06,87.80,88.31,87.40,88.19,25828100,88.19 +2007-03-05,85.89,88.65,85.76,86.32,29960700,86.32 +2007-03-02,86.77,87.54,85.21,85.41,30714300,85.41 +2007-03-01,84.03,88.31,83.75,87.06,50554600,87.06 +2007-02-28,83.00,85.60,83.00,84.61,32838400,84.61 +2007-02-27,86.30,87.08,83.41,83.93,40921900,83.93 +2007-02-26,89.84,90.00,87.61,88.51,21994600,88.51 +2007-02-23,89.16,90.34,88.85,89.07,18496200,89.07 +2007-02-22,90.80,90.81,88.53,89.51,29936600,89.51 +2007-02-21,85.98,89.49,85.96,89.20,41261200,89.20 +2007-02-20,84.65,86.16,84.16,85.90,22060800,85.90 +2007-02-16,85.25,85.41,84.66,84.83,14281000,84.83 +2007-02-15,85.44,85.62,84.78,85.21,12987900,85.21 +2007-02-14,84.63,85.64,84.57,85.30,18142200,85.30 +2007-02-13,85.16,85.29,84.30,84.70,20749500,84.70 +2007-02-12,84.43,85.18,83.63,84.88,25859700,84.88 +2007-02-09,85.88,86.20,83.21,83.27,30733600,83.27 +2007-02-08,85.43,86.51,85.41,86.18,24251100,86.18 +2007-02-07,84.48,86.38,83.55,86.15,38100900,86.15 +2007-02-06,84.45,84.47,82.86,84.15,30871200,84.15 +2007-02-05,84.30,85.23,83.94,83.94,20673300,83.94 +2007-02-02,84.12,85.25,83.70,84.75,22197500,84.75 +2007-02-01,86.23,86.27,84.74,84.74,23726500,84.74 +2007-01-31,84.86,86.00,84.35,85.73,30573900,85.73 +2007-01-30,86.43,86.49,85.25,85.55,20641800,85.55 +2007-01-29,86.30,86.65,85.53,85.94,32202300,85.94 +2007-01-26,87.11,87.37,84.99,85.38,35245500,85.38 +2007-01-25,87.11,88.50,86.03,86.25,32356200,86.25 +2007-01-24,86.68,87.15,86.08,86.70,33136200,86.70 +2007-01-23,85.73,87.51,85.51,85.70,43122300,85.70 +2007-01-22,89.14,89.16,85.65,86.79,51929500,86.79 +2007-01-19,88.63,89.65,88.12,88.50,48731200,88.50 +2007-01-18,92.10,92.11,89.05,89.07,84450200,89.07 +2007-01-17,97.56,97.60,94.82,94.95,58795000,94.95 +2007-01-16,95.68,97.25,95.45,97.10,44431300,97.10 +2007-01-12,94.59,95.06,93.23,94.62,46881800,94.62 +2007-01-11,95.94,96.78,95.10,95.80,51437600,95.80 +2007-01-10,94.75,97.80,93.45,97.00,105460000,97.00 +2007-01-09,86.45,92.98,85.15,92.57,119617800,92.57 +2007-01-08,85.96,86.53,85.28,85.47,28468100,85.47 +2007-01-05,85.77,86.20,84.40,85.05,29812200,85.05 +2007-01-04,84.05,85.95,83.82,85.66,30259300,85.66 +2007-01-03,86.29,86.58,81.90,83.80,44225700,83.80 +2006-12-29,83.95,85.40,83.36,84.84,38443900,84.84 +2006-12-28,80.22,81.25,79.65,80.87,39995600,80.87 +2006-12-27,78.15,82.00,76.77,81.52,69134100,81.52 +2006-12-26,82.15,82.57,80.89,81.51,17524600,81.51 +2006-12-22,83.46,84.04,81.60,82.20,21903700,82.20 +2006-12-21,84.70,85.48,82.20,82.90,32271400,82.90 +2006-12-20,86.47,86.67,84.74,84.76,20274700,84.76 +2006-12-19,84.73,86.68,83.62,86.31,32550200,86.31 +2006-12-18,87.63,88.00,84.59,85.47,25770600,85.47 +2006-12-15,89.02,89.22,87.33,87.72,26426400,87.72 +2006-12-14,89.05,90.00,88.26,88.55,29726100,88.55 +2006-12-13,87.95,89.07,87.15,89.05,30609000,89.05 +2006-12-12,88.61,88.84,85.53,86.14,36665000,86.14 +2006-12-11,88.90,89.30,88.05,88.75,17849300,88.75 +2006-12-08,87.23,89.39,87.00,88.26,28009900,88.26 +2006-12-07,90.03,90.50,86.90,87.04,35886700,87.04 +2006-12-06,90.64,91.39,89.67,89.83,22792300,89.83 +2006-12-05,91.65,92.33,90.87,91.27,23672800,91.27 +2006-12-04,91.88,92.05,90.50,91.12,25340600,91.12 +2006-12-01,91.80,92.33,90.10,91.32,28395700,91.32 +2006-11-30,92.21,92.68,91.06,91.66,31088800,91.66 +2006-11-29,93.00,93.15,90.25,91.80,41324400,91.80 +2006-11-28,90.36,91.97,89.91,91.81,37006200,91.81 +2006-11-27,92.51,93.16,89.50,89.54,38387000,89.54 +2006-11-24,89.53,93.08,89.50,91.63,18524200,91.63 +2006-11-22,88.99,90.75,87.85,90.31,23997900,90.31 +2006-11-21,87.42,88.60,87.11,88.60,22238100,88.60 +2006-11-20,85.40,87.00,85.20,86.47,20385500,86.47 +2006-11-17,85.14,85.94,85.00,85.85,16658000,85.85 +2006-11-16,84.87,86.30,84.62,85.61,24783600,85.61 +2006-11-15,85.05,85.90,84.00,84.05,23404400,84.05 +2006-11-14,84.80,85.00,83.90,85.00,21034100,85.00 +2006-11-13,83.22,84.45,82.64,84.35,16095500,84.35 +2006-11-10,83.55,83.60,82.50,83.12,13352300,83.12 +2006-11-09,82.90,84.69,82.12,83.34,32966200,83.34 +2006-11-08,80.02,82.69,79.89,82.45,24675600,82.45 +2006-11-07,80.45,81.00,80.13,80.51,18783300,80.51 +2006-11-06,78.95,80.06,78.43,79.71,15520600,79.71 +2006-11-03,79.36,79.53,77.79,78.29,15424600,78.29 +2006-11-02,78.92,79.32,78.50,78.98,16624400,78.98 +2006-11-01,81.10,81.38,78.36,79.16,21828300,79.16 +2006-10-31,81.45,81.68,80.23,81.08,17909800,81.08 +2006-10-30,79.99,80.90,79.50,80.42,17854200,80.42 +2006-10-27,81.75,82.45,80.01,80.41,21248800,80.41 +2006-10-26,81.90,82.60,81.13,82.19,15455600,82.19 +2006-10-25,81.35,82.00,81.01,81.68,17329100,81.68 +2006-10-24,81.21,81.68,80.20,81.05,16543300,81.05 +2006-10-23,79.99,81.90,79.75,81.46,29732400,81.46 +2006-10-20,78.97,79.99,78.67,79.95,22836200,79.95 +2006-10-19,79.26,79.95,78.16,78.99,54034900,78.99 +2006-10-18,74.75,75.37,73.91,74.53,40496700,74.53 +2006-10-17,75.04,75.27,74.04,74.29,17175900,74.29 +2006-10-16,75.19,75.88,74.79,75.40,18167600,75.40 +2006-10-13,75.63,76.88,74.74,75.02,24435600,75.02 +2006-10-12,73.61,75.39,73.60,75.26,21173400,75.26 +2006-10-11,73.42,73.98,72.60,73.23,20423400,73.23 +2006-10-10,74.54,74.58,73.08,73.81,18985300,73.81 +2006-10-09,73.80,75.08,73.53,74.63,15650800,74.63 +2006-10-06,74.42,75.04,73.81,74.22,16677100,74.22 +2006-10-05,74.53,76.16,74.13,74.83,24424400,74.83 +2006-10-04,74.10,75.46,73.16,75.38,29610100,75.38 +2006-10-03,74.45,74.95,73.19,74.08,28239600,74.08 +2006-10-02,75.10,75.87,74.30,74.86,25451400,74.86 +2006-09-29,77.11,77.52,76.68,76.98,14493300,76.98 +2006-09-28,77.02,77.48,75.95,77.01,25843200,77.01 +2006-09-27,77.17,77.47,75.82,76.41,28941900,76.41 +2006-09-26,76.18,77.78,76.10,77.61,39391000,77.61 +2006-09-25,73.81,75.86,73.72,75.75,30678300,75.75 +2006-09-22,74.30,74.34,72.58,73.00,23754000,73.00 +2006-09-21,75.25,76.06,74.02,74.65,28361600,74.65 +2006-09-20,74.38,75.68,74.22,75.26,29385400,75.26 +2006-09-19,74.10,74.36,72.80,73.77,25358900,73.77 +2006-09-18,73.80,74.86,73.30,73.89,25188500,73.89 +2006-09-15,74.60,74.98,73.29,74.10,35066200,74.10 +2006-09-14,73.72,74.67,73.46,74.17,28633200,74.17 +2006-09-13,72.85,74.32,72.30,74.20,40933500,74.20 +2006-09-12,72.81,73.45,71.45,72.63,60167400,72.63 +2006-09-11,72.43,73.73,71.42,72.50,33897300,72.50 +2006-09-08,73.37,73.57,71.91,72.52,31997200,72.52 +2006-09-07,70.60,73.48,70.25,72.80,45284200,72.80 +2006-09-06,71.08,71.69,69.70,70.03,34789400,70.03 +2006-09-05,68.97,71.50,68.55,71.48,36159200,71.48 +2006-09-01,68.48,68.65,67.82,68.38,14589100,68.38 +2006-08-31,67.28,68.30,66.66,67.85,20524900,67.85 +2006-08-30,67.34,67.82,66.68,66.96,24290800,66.96 +2006-08-29,66.99,67.26,65.12,66.48,33833300,66.48 +2006-08-28,68.50,68.61,66.68,66.98,26362900,66.98 +2006-08-25,67.34,69.05,67.31,68.75,19427100,68.75 +2006-08-24,67.89,68.19,66.27,67.81,23399700,67.81 +2006-08-23,68.00,68.65,66.94,67.31,19152100,67.31 +2006-08-22,66.68,68.32,66.50,67.62,20606000,67.62 +2006-08-21,67.30,67.31,66.15,66.56,18793800,66.56 +2006-08-18,67.71,68.40,67.26,67.91,19155500,67.91 +2006-08-17,68.00,68.66,67.18,67.59,20755300,67.59 +2006-08-16,67.10,68.07,66.33,67.98,27903000,67.98 +2006-08-15,65.34,66.50,64.80,66.45,30762600,66.45 +2006-08-14,64.05,65.22,63.60,63.94,25629300,63.94 +2006-08-11,63.23,64.13,62.58,63.65,27768900,63.65 +2006-08-10,63.25,64.81,62.70,64.07,24920000,64.07 +2006-08-09,65.43,65.60,63.40,63.59,34137100,63.59 +2006-08-08,67.09,67.11,64.51,64.78,35638000,64.78 +2006-08-07,67.72,69.60,66.31,67.21,44482600,67.21 +2006-08-04,67.05,68.61,64.96,68.30,66173800,68.30 +2006-08-03,67.91,70.00,67.81,69.59,30037300,69.59 +2006-08-02,67.65,68.68,67.51,68.16,19670300,68.16 +2006-08-01,67.22,67.93,65.94,67.18,25420200,67.18 +2006-07-31,66.83,68.63,66.28,67.96,31887200,67.96 +2006-07-28,63.94,65.68,63.50,65.59,24696700,65.59 +2006-07-27,64.50,65.02,62.86,63.40,26251600,63.40 +2006-07-26,62.00,64.64,61.68,63.87,32086700,63.87 +2006-07-25,61.78,62.09,60.78,61.93,21038200,61.93 +2006-07-24,61.26,62.10,60.43,61.42,25816300,61.42 +2006-07-21,59.82,61.15,59.64,60.72,31853300,60.72 +2006-07-20,60.96,61.59,59.72,60.50,70433800,60.50 +2006-07-19,52.96,55.08,52.36,54.10,49669400,54.10 +2006-07-18,53.16,53.85,51.85,52.90,35730300,52.90 +2006-07-17,51.73,53.11,51.65,52.37,36590800,52.37 +2006-07-14,52.50,52.89,50.16,50.67,35465600,50.67 +2006-07-13,52.03,54.12,51.41,52.25,44639500,52.25 +2006-07-12,55.17,55.24,52.92,52.96,33118900,52.96 +2006-07-11,55.11,55.99,54.53,55.65,29465100,55.65 +2006-07-10,55.70,56.49,54.50,55.00,18905200,55.00 +2006-07-07,55.48,56.55,54.67,55.40,28548600,55.40 +2006-07-06,57.09,57.40,55.61,55.77,22614600,55.77 +2006-07-05,57.15,57.60,56.56,57.00,18508600,57.00 +2006-07-03,57.52,58.18,57.34,57.95,6956100,57.95 +2006-06-30,57.59,57.75,56.50,57.27,26417700,57.27 +2006-06-29,56.76,59.09,56.39,58.97,31192800,58.97 +2006-06-28,57.29,57.30,55.41,56.02,30382300,56.02 +2006-06-27,59.09,59.22,57.40,57.43,19664700,57.43 +2006-06-26,59.17,59.20,58.37,58.99,16662000,58.99 +2006-06-23,59.72,60.17,58.73,58.83,23578700,58.83 +2006-06-22,58.20,59.75,58.07,59.58,34486900,59.58 +2006-06-21,57.74,58.71,57.30,57.86,30832000,57.86 +2006-06-20,57.61,58.35,57.29,57.47,24034800,57.47 +2006-06-19,57.83,58.18,57.00,57.20,25163400,57.20 +2006-06-16,58.96,59.19,57.52,57.56,29932200,57.56 +2006-06-15,57.30,59.74,56.75,59.38,42513700,59.38 +2006-06-14,58.28,58.78,56.69,57.61,31362000,57.61 +2006-06-13,57.61,59.10,57.36,58.33,38594400,58.33 +2006-06-12,59.40,59.73,56.96,57.00,25635200,57.00 +2006-06-09,61.18,61.56,59.10,59.24,27708500,59.24 +2006-06-08,58.44,60.93,57.15,60.76,49910100,60.76 +2006-06-07,60.10,60.40,58.35,58.56,26803800,58.56 +2006-06-06,60.22,60.63,58.91,59.72,25929900,59.72 +2006-06-05,61.15,61.15,59.97,60.00,21635200,60.00 +2006-06-02,62.99,63.10,60.88,61.66,24492400,61.66 +2006-06-01,59.85,62.28,59.52,62.17,33661000,62.17 +2006-05-31,61.76,61.79,58.69,59.77,45749200,59.77 +2006-05-30,63.29,63.30,61.22,61.22,20121500,61.22 +2006-05-26,64.31,64.56,63.14,63.55,15462500,63.55 +2006-05-25,64.26,64.45,63.29,64.33,16549000,64.33 +2006-05-24,62.99,63.65,61.56,63.34,32715400,63.34 +2006-05-23,64.86,65.19,63.00,63.15,24800500,63.15 +2006-05-22,63.87,63.99,62.77,63.38,25677700,63.38 +2006-05-19,63.26,64.88,62.82,64.51,35209500,64.51 +2006-05-18,65.68,66.26,63.12,63.18,23515800,63.18 +2006-05-17,64.71,65.70,64.07,65.26,26935500,65.26 +2006-05-16,68.10,68.25,64.75,64.98,33455000,64.98 +2006-05-15,67.37,68.38,67.12,67.79,18899200,67.79 +2006-05-12,67.85,68.69,66.86,67.70,22920500,67.70 +2006-05-11,70.79,70.84,67.55,68.15,29024600,68.15 +2006-05-10,71.29,71.33,69.61,70.60,16424600,70.60 +2006-05-09,71.82,72.56,70.62,71.03,18988100,71.03 +2006-05-08,72.99,73.80,71.72,71.89,21244700,71.89 +2006-05-05,71.86,72.25,71.15,71.89,20139700,71.89 +2006-05-04,71.22,72.89,70.46,71.13,30729300,71.13 +2006-05-03,71.83,71.95,70.18,71.14,24535400,71.14 +2006-05-02,70.15,71.98,70.11,71.62,27559400,71.62 +2006-05-01,70.77,71.54,69.16,69.60,26799300,69.60 +2006-04-28,69.38,71.30,69.20,70.39,27144200,70.39 +2006-04-27,67.73,69.86,67.35,69.36,30212400,69.36 +2006-04-26,66.65,68.28,66.40,68.15,25388800,68.15 +2006-04-25,65.96,66.59,65.56,66.17,18895100,66.17 +2006-04-24,66.85,66.92,65.50,65.75,25251000,65.75 +2006-04-21,68.19,68.64,66.47,67.04,28178100,67.04 +2006-04-20,69.51,70.00,66.20,67.63,59535100,67.63 +2006-04-19,66.82,67.00,65.47,65.65,38786900,65.65 +2006-04-18,65.04,66.47,64.79,66.22,28387300,66.22 +2006-04-17,66.51,66.84,64.35,64.81,25783500,64.81 +2006-04-13,66.34,67.44,65.81,66.47,26238500,66.47 +2006-04-12,68.01,68.17,66.30,66.71,26424800,66.71 +2006-04-11,68.99,69.30,67.07,67.99,33547000,67.99 +2006-04-10,70.29,70.93,68.45,68.67,32268400,68.67 +2006-04-07,70.93,71.21,68.47,69.79,55187100,69.79 +2006-04-06,68.30,72.05,68.20,71.24,95134600,71.24 +2006-04-05,64.71,67.21,64.15,67.21,79764600,67.21 +2006-04-04,62.10,62.22,61.05,61.17,33283000,61.17 +2006-04-03,63.67,64.12,62.61,62.65,29135400,62.65 +2006-03-31,63.25,63.61,62.24,62.72,29119900,62.72 +2006-03-30,62.82,63.30,61.53,62.75,49666100,62.75 +2006-03-29,59.13,62.52,57.67,62.33,83815500,62.33 +2006-03-28,59.63,60.14,58.25,58.71,48940100,58.71 +2006-03-27,60.35,61.38,59.40,59.51,39574000,59.51 +2006-03-24,60.25,60.94,59.03,59.96,38285000,59.96 +2006-03-23,61.82,61.90,59.61,60.16,50993800,60.16 +2006-03-22,62.16,63.25,61.27,61.67,48067700,61.67 +2006-03-21,64.29,64.34,61.39,61.81,47991700,61.81 +2006-03-20,65.22,65.46,63.87,63.99,21622900,63.99 +2006-03-17,64.75,65.54,64.11,64.66,29001500,64.66 +2006-03-16,66.85,66.90,64.30,64.31,26772800,64.31 +2006-03-15,67.71,68.04,65.52,66.23,31857000,66.23 +2006-03-14,65.77,67.32,65.50,67.32,22929300,67.32 +2006-03-13,65.05,66.28,64.79,65.68,30756700,65.68 +2006-03-10,64.05,64.49,62.45,63.19,37255100,63.19 +2006-03-09,65.98,66.47,63.81,63.93,28546600,63.93 +2006-03-08,66.29,67.20,65.35,65.66,23330400,65.66 +2006-03-07,65.76,66.90,65.08,66.31,31174200,66.31 +2006-03-06,67.69,67.72,64.94,65.48,32595200,65.48 +2006-03-03,69.40,69.91,67.53,67.72,26345300,67.72 +2006-03-02,68.99,69.99,68.67,69.61,22331200,69.61 +2006-03-01,68.84,69.49,68.02,69.10,27279200,69.10 +2006-02-28,71.58,72.40,68.10,68.49,45249300,68.49 +2006-02-27,71.99,72.12,70.65,70.99,28258600,70.99 +2006-02-24,72.14,72.89,71.20,71.46,19098000,71.46 +2006-02-23,71.79,73.00,71.43,71.75,30604200,71.75 +2006-02-22,69.00,71.67,68.00,71.32,34937100,71.32 +2006-02-21,70.59,70.80,68.68,69.08,27843100,69.08 +2006-02-17,70.30,70.89,69.61,70.29,20571400,70.29 +2006-02-16,69.91,71.01,69.48,70.57,33863400,70.57 +2006-02-15,67.16,69.62,66.75,69.22,41420400,69.22 +2006-02-14,65.10,68.10,65.00,67.64,41462100,67.64 +2006-02-13,66.63,66.75,64.64,64.71,31553500,64.71 +2006-02-10,65.18,67.67,62.90,67.31,62874200,67.31 +2006-02-09,69.10,69.23,64.53,64.95,41063000,64.95 +2006-02-08,68.49,69.08,66.00,68.81,34039800,68.81 +2006-02-07,68.27,69.48,66.68,67.60,49601100,67.60 +2006-02-06,72.02,72.51,66.74,67.30,58991700,67.30 +2006-02-03,72.24,72.79,71.04,71.85,24718700,71.85 +2006-02-02,75.10,75.36,72.05,72.10,25261500,72.10 +2006-02-01,74.95,76.46,74.64,75.42,18613800,75.42 +2006-01-31,75.50,76.34,73.75,75.51,32626500,75.51 +2006-01-30,71.17,76.60,70.87,75.00,49942900,75.00 +2006-01-27,72.95,73.60,71.10,72.03,34066600,72.03 +2006-01-26,74.53,75.43,71.93,72.33,42192400,72.33 +2006-01-25,77.39,77.50,73.25,74.20,45563800,74.20 +2006-01-24,78.76,79.42,75.77,76.04,40794800,76.04 +2006-01-23,76.10,79.56,76.00,77.67,37847500,77.67 +2006-01-20,79.28,80.04,75.83,76.09,40527100,76.09 +2006-01-19,81.25,81.66,78.74,79.04,60566000,79.04 +2006-01-18,83.08,84.05,81.85,82.49,42879900,82.49 +2006-01-17,85.70,86.38,83.87,84.71,29843700,84.71 +2006-01-13,84.99,86.01,84.60,85.59,27725200,85.59 +2006-01-12,84.97,86.40,83.62,84.29,45743200,84.29 +2006-01-11,83.84,84.80,82.59,83.90,53349800,83.90 +2006-01-10,76.25,81.89,75.83,80.86,81423900,80.86 +2006-01-09,76.73,77.20,75.74,76.05,24108600,76.05 +2006-01-06,75.25,76.70,74.55,76.30,25159200,76.30 +2006-01-05,74.83,74.90,73.75,74.38,16050800,74.38 +2006-01-04,75.13,75.98,74.50,74.97,22128700,74.97 +2006-01-03,72.38,74.75,72.25,74.75,28829800,74.75 +2005-12-30,70.91,72.43,70.34,71.89,22295100,71.89 +2005-12-29,73.78,73.82,71.42,71.45,17500900,71.45 +2005-12-28,74.47,74.76,73.32,73.57,14218400,73.57 +2005-12-27,74.00,75.18,73.95,74.23,21092500,74.23 +2005-12-23,74.17,74.26,73.30,73.35,8209200,73.35 +2005-12-22,73.91,74.49,73.60,74.02,13236100,74.02 +2005-12-21,72.60,73.61,72.54,73.50,16990600,73.50 +2005-12-20,71.63,72.38,71.12,72.11,17111000,72.11 +2005-12-19,71.11,72.60,71.04,71.38,18903400,71.38 +2005-12-16,72.14,72.30,71.06,71.11,23970400,71.11 +2005-12-15,72.68,72.86,71.35,72.18,20041500,72.18 +2005-12-14,72.53,73.30,70.27,72.01,51811300,72.01 +2005-12-13,74.85,75.46,74.21,74.98,17636300,74.98 +2005-12-12,74.87,75.35,74.56,74.91,18749800,74.91 +2005-12-09,74.21,74.59,73.35,74.33,19835800,74.33 +2005-12-08,73.20,74.17,72.60,74.08,28231500,74.08 +2005-12-07,74.23,74.46,73.12,73.95,24266600,73.95 +2005-12-06,73.93,74.83,73.35,74.05,30608200,74.05 +2005-12-05,71.95,72.53,71.49,71.82,20845400,71.82 +2005-12-02,72.27,72.74,70.70,72.63,31991500,72.63 +2005-12-01,68.95,71.73,68.81,71.60,29031900,71.60 +2005-11-30,68.43,68.85,67.52,67.82,21274100,67.82 +2005-11-29,69.99,70.30,67.35,68.10,31836900,68.10 +2005-11-28,70.72,71.07,69.07,69.66,36375700,69.66 +2005-11-25,67.66,69.54,67.50,69.34,14107600,69.34 +2005-11-23,66.88,67.98,66.69,67.11,17351900,67.11 +2005-11-22,64.84,66.76,64.52,66.52,19295800,66.52 +2005-11-21,64.82,65.19,63.72,64.96,18275400,64.96 +2005-11-18,65.31,65.43,64.37,64.56,18748700,64.56 +2005-11-17,65.59,65.88,64.25,64.52,24150200,64.52 +2005-11-16,63.15,65.06,63.09,64.95,28018400,64.95 +2005-11-15,61.60,63.08,61.46,62.28,19172900,62.28 +2005-11-14,61.54,61.98,60.91,61.45,13211900,61.45 +2005-11-11,61.54,62.11,61.34,61.54,15194600,61.54 +2005-11-10,60.64,61.20,59.01,61.18,23762300,61.18 +2005-11-09,60.00,61.21,60.00,60.11,19747500,60.11 +2005-11-08,59.95,60.38,59.10,59.90,16920200,59.90 +2005-11-07,60.85,61.67,60.14,60.23,22815400,60.23 +2005-11-04,60.35,61.24,59.62,61.15,31358400,61.15 +2005-11-03,60.26,62.32,60.07,61.85,31585100,61.85 +2005-11-02,57.72,60.00,57.60,59.95,30609300,59.95 +2005-11-01,57.24,58.14,56.87,57.50,26774500,57.50 +2005-10-31,55.20,57.98,54.75,57.59,33601600,57.59 +2005-10-28,56.04,56.43,54.17,54.47,27492400,54.47 +2005-10-27,56.99,57.01,55.41,55.41,14697900,55.41 +2005-10-26,56.28,57.56,55.92,57.03,22556900,57.03 +2005-10-25,56.40,56.85,55.69,56.10,16611700,56.10 +2005-10-24,55.25,56.79,55.09,56.79,21776900,56.79 +2005-10-21,56.84,56.98,55.36,55.66,28454500,55.66 +2005-10-20,54.47,56.50,54.35,56.14,48491500,56.14 +2005-10-19,52.07,54.96,51.21,54.94,36024400,54.94 +2005-10-18,53.25,53.95,52.20,52.21,21771000,52.21 +2005-10-17,53.98,54.23,52.68,53.44,22029800,53.44 +2005-10-14,54.03,54.35,52.79,54.00,36984000,54.00 +2005-10-13,49.44,53.95,49.27,53.74,66627700,53.74 +2005-10-12,48.65,50.30,47.87,49.25,96338800,49.25 +2005-10-11,51.23,51.87,50.40,51.59,43781600,51.59 +2005-10-10,51.76,51.91,50.28,50.37,18125200,50.37 +2005-10-07,51.72,51.93,50.55,51.30,24210100,51.30 +2005-10-06,53.20,53.49,50.87,51.70,27054900,51.70 +2005-10-05,54.33,54.36,52.75,52.78,21813200,52.78 +2005-10-04,54.95,55.35,53.64,53.75,19266400,53.75 +2005-10-03,54.16,54.54,53.68,54.44,18126900,54.44 +2005-09-30,52.33,53.65,51.88,53.61,18986900,53.61 +2005-09-29,51.23,52.59,50.81,52.34,22744500,52.34 +2005-09-28,53.07,53.11,50.59,51.08,40198000,51.08 +2005-09-27,53.92,54.24,53.43,53.44,12203700,53.44 +2005-09-26,54.03,54.56,53.32,53.84,19520100,53.84 +2005-09-23,52.10,53.50,51.84,53.20,19944900,53.20 +2005-09-22,51.88,52.47,51.32,51.90,16561700,51.90 +2005-09-21,52.96,53.05,51.86,52.11,15526700,52.11 +2005-09-20,52.99,53.81,52.92,53.19,29279600,53.19 +2005-09-19,51.05,52.89,51.05,52.64,27990400,52.64 +2005-09-16,50.23,51.21,49.95,51.21,21107300,51.21 +2005-09-15,50.00,50.18,49.33,49.87,14827000,49.87 +2005-09-14,51.06,51.19,49.46,49.61,16943800,49.61 +2005-09-13,51.02,51.29,50.32,50.82,17603000,50.82 +2005-09-12,51.10,51.63,50.58,51.40,16171300,51.40 +2005-09-09,50.07,51.35,49.79,51.31,21987200,51.31 +2005-09-08,49.35,50.12,49.14,49.78,25094300,49.78 +2005-09-07,49.05,49.40,47.92,48.68,34395500,48.68 +2005-09-06,46.70,48.88,46.55,48.80,29236400,48.80 +2005-09-02,46.30,46.80,46.12,46.22,7942100,46.22 +2005-09-01,47.00,47.17,46.09,46.26,12727400,46.26 +2005-08-31,46.86,47.03,46.27,46.89,14391300,46.89 +2005-08-30,45.99,46.79,45.92,46.57,18527200,46.57 +2005-08-29,45.27,46.03,45.26,45.84,9153400,45.84 +2005-08-26,46.12,46.34,45.36,45.74,9323500,45.74 +2005-08-25,46.12,46.49,45.81,46.06,9866200,46.06 +2005-08-24,45.60,47.12,45.59,45.77,20431100,45.77 +2005-08-23,45.85,46.10,45.32,45.74,10557300,45.74 +2005-08-22,46.15,46.75,45.26,45.87,13847600,45.87 +2005-08-19,46.28,46.70,45.77,45.83,13448900,45.83 +2005-08-18,46.91,47.00,45.75,46.30,15805700,46.30 +2005-08-17,46.40,47.44,46.37,47.15,17847300,47.15 +2005-08-16,47.39,47.50,46.21,46.25,19200800,46.25 +2005-08-15,46.48,48.33,46.45,47.68,38811700,47.68 +2005-08-12,43.46,46.22,43.36,46.10,32715600,46.10 +2005-08-11,43.39,44.12,43.25,44.00,9713700,44.00 +2005-08-10,44.00,44.39,43.31,43.38,12890900,43.38 +2005-08-09,42.93,43.89,42.91,43.82,13601400,43.82 +2005-08-08,43.00,43.25,42.61,42.65,6299400,42.65 +2005-08-05,42.49,43.36,42.02,42.99,8640400,42.99 +2005-08-04,42.89,43.00,42.29,42.71,9618000,42.71 +2005-08-03,43.19,43.31,42.77,43.22,9225800,43.22 +2005-08-02,42.89,43.50,42.61,43.19,10602700,43.19 +2005-08-01,42.57,43.08,42.08,42.75,11223200,42.75 +2005-07-29,43.56,44.38,42.26,42.65,20074300,42.65 +2005-07-28,43.85,44.00,43.30,43.80,8975400,43.80 +2005-07-27,43.83,44.07,42.67,43.99,10133900,43.99 +2005-07-26,44.01,44.11,43.36,43.63,9592600,43.63 +2005-07-25,43.99,44.28,43.73,43.81,10522400,43.81 +2005-07-22,43.44,44.00,43.39,44.00,10753800,44.00 +2005-07-21,43.70,44.04,42.90,43.29,14438000,43.29 +2005-07-20,42.86,43.80,42.65,43.63,16192700,43.63 +2005-07-19,41.52,43.23,41.07,43.19,23966500,43.19 +2005-07-18,41.41,42.10,41.37,41.49,20939200,41.49 +2005-07-15,40.97,41.57,40.46,41.55,24560100,41.55 +2005-07-14,40.79,42.01,40.23,40.75,74859300,40.75 +2005-07-13,38.29,38.50,37.90,38.35,24458400,38.35 +2005-07-12,38.23,38.40,37.91,38.24,13822800,38.24 +2005-07-11,38.37,38.65,37.78,38.10,13885300,38.10 +2005-07-08,37.87,38.28,37.47,38.25,10383400,38.25 +2005-07-07,36.81,37.76,36.80,37.63,13704400,37.63 +2005-07-06,37.71,38.16,37.20,37.39,14093800,37.39 +2005-07-05,36.55,38.15,36.50,37.98,16223900,37.98 +2005-07-01,36.83,36.97,36.29,36.50,8928600,36.50 +2005-06-30,36.61,37.16,36.31,36.81,14942500,36.81 +2005-06-29,37.23,37.29,36.12,36.37,16012800,36.37 +2005-06-28,37.49,37.59,37.17,37.31,12510700,37.31 +2005-06-27,36.84,38.10,36.68,37.10,21434700,37.10 +2005-06-24,39.09,39.12,37.68,37.76,14668200,37.76 +2005-06-23,38.83,39.78,38.65,38.89,24080500,38.89 +2005-06-22,38.26,38.60,38.14,38.55,15175900,38.55 +2005-06-21,37.72,38.19,37.38,37.86,13233100,37.86 +2005-06-20,37.85,38.09,37.45,37.61,11561300,37.61 +2005-06-17,38.47,38.54,37.83,38.31,21290200,38.31 +2005-06-16,37.19,38.08,36.82,37.98,19559800,37.98 +2005-06-15,36.87,37.30,36.30,37.13,20119400,37.13 +2005-06-14,35.92,36.15,35.75,36.00,12423100,36.00 +2005-06-13,35.89,36.61,35.82,35.90,15563300,35.90 +2005-06-10,37.40,37.40,35.52,35.81,24247600,35.81 +2005-06-09,37.00,37.94,36.82,37.65,13937700,37.65 +2005-06-08,36.63,37.25,36.57,36.92,14428800,36.92 +2005-06-07,37.60,37.73,36.45,36.54,26616600,36.54 +2005-06-06,38.33,38.63,37.56,37.92,28998800,37.92 +2005-06-03,38.16,38.58,37.77,38.24,34173900,38.24 +2005-06-02,40.05,40.32,39.60,40.04,13356200,40.04 +2005-06-01,39.89,40.76,39.86,40.30,16207600,40.30 +2005-05-31,40.66,40.74,39.58,39.76,14435900,39.76 +2005-05-27,40.64,40.79,40.01,40.56,11286000,40.56 +2005-05-26,39.94,40.94,39.94,40.74,18768600,40.74 +2005-05-25,39.50,39.95,39.32,39.78,14143100,39.78 +2005-05-24,39.45,39.99,39.03,39.70,21195000,39.70 +2005-05-23,37.85,39.90,37.85,39.76,37234800,39.76 +2005-05-20,37.25,37.65,37.19,37.55,16166100,37.55 +2005-05-19,35.78,37.68,35.78,37.55,28327200,37.55 +2005-05-18,35.45,37.56,34.99,35.84,22740100,35.84 +2005-05-17,35.14,35.46,34.54,35.36,21012300,35.36 +2005-05-16,34.56,35.70,34.53,35.55,16939100,35.55 +2005-05-13,34.20,35.23,34.07,34.77,25096900,34.77 +2005-05-12,35.42,35.59,34.00,34.13,34651500,34.13 +2005-05-11,35.20,35.67,33.11,35.61,72927900,35.61 +2005-05-10,36.75,37.25,36.33,36.42,15723700,36.42 +2005-05-09,37.28,37.45,36.75,36.97,12703400,36.97 +2005-05-06,36.89,37.33,36.79,37.24,11651700,37.24 +2005-05-05,37.25,37.27,36.47,36.68,13834500,36.68 +2005-05-04,36.11,37.20,36.10,37.15,16006300,37.15 +2005-05-03,36.40,36.74,36.03,36.21,17740700,36.21 +2005-05-02,36.21,36.65,36.02,36.43,16640000,36.43 +2005-04-29,36.15,36.23,35.22,36.06,23986800,36.06 +2005-04-28,36.29,36.34,35.24,35.54,20539500,35.54 +2005-04-27,35.89,36.36,35.51,35.95,21924600,35.95 +2005-04-26,36.78,37.51,36.12,36.19,28946700,36.19 +2005-04-25,36.49,37.02,36.11,36.98,26659300,36.98 +2005-04-22,36.84,37.00,34.90,35.50,29968900,35.50 +2005-04-21,36.40,37.21,35.90,37.18,27128300,37.18 +2005-04-20,37.66,37.74,35.44,35.51,33754700,35.51 +2005-04-19,36.60,37.44,35.87,37.09,38630100,37.09 +2005-04-18,35.00,36.30,34.00,35.62,47399200,35.62 +2005-04-15,36.62,37.25,35.28,35.35,61717400,35.35 +2005-04-14,38.81,39.56,36.84,37.26,98328300,37.26 +2005-04-13,42.95,42.99,40.39,41.04,48998100,41.04 +2005-04-12,42.49,43.19,42.01,42.66,35037900,42.66 +2005-04-11,44.15,44.25,41.91,41.92,29345100,41.92 +2005-04-08,43.70,44.45,43.54,43.74,23212500,43.74 +2005-04-07,42.33,43.75,42.25,43.56,18106700,43.56 +2005-04-06,42.40,42.81,42.15,42.33,14815200,42.33 +2005-04-05,41.22,42.24,41.09,41.89,19865700,41.89 +2005-04-04,40.99,41.31,40.16,41.09,20714800,41.09 +2005-04-01,42.09,42.18,40.57,40.89,22903000,40.89 +2005-03-31,42.45,42.52,41.59,41.67,22719100,41.67 +2005-03-30,42.07,42.80,41.82,42.80,14105700,42.80 +2005-03-29,42.56,42.83,41.50,41.75,16477000,41.75 +2005-03-28,42.75,42.96,42.47,42.53,9836100,42.53 +2005-03-24,42.91,43.00,42.50,42.50,12596600,42.50 +2005-03-23,42.45,43.40,42.02,42.55,21779400,42.55 +2005-03-22,43.71,43.96,42.68,42.83,19693400,42.83 +2005-03-21,43.29,43.97,42.86,43.70,19326000,43.70 +2005-03-18,43.33,43.44,42.50,42.96,33576800,42.96 +2005-03-17,41.53,42.88,41.32,42.25,28640000,42.25 +2005-03-16,41.21,42.31,40.78,41.18,24921900,41.18 +2005-03-15,40.64,41.14,40.25,40.96,18164600,40.96 +2005-03-14,40.52,40.79,39.52,40.32,21620900,40.32 +2005-03-11,40.21,40.59,39.80,40.27,22601100,40.27 +2005-03-10,39.53,40.26,39.10,39.83,27753900,39.83 +2005-03-09,39.64,40.28,38.83,39.35,47230900,39.35 +2005-03-08,41.90,42.16,40.10,40.53,36480400,40.53 +2005-03-07,42.80,43.25,42.35,42.75,16094000,42.75 +2005-03-04,42.76,43.01,41.85,42.81,27022100,42.81 +2005-03-03,44.37,44.41,41.22,41.79,50416200,41.79 +2005-03-02,44.25,44.89,44.08,44.12,16362900,44.12 +2005-03-01,44.99,45.11,44.16,44.50,16721000,44.50 +2005-02-28,44.68,45.14,43.96,44.86,23271800,44.86 +2005-02-25,89.62,89.91,88.19,88.99,32696800,44.49 +2005-02-24,88.48,89.31,87.73,88.93,54251000,44.47 +2005-02-23,86.72,88.45,85.55,88.23,48042200,44.12 +2005-02-22,86.30,88.30,85.29,85.29,43546200,42.65 +2005-02-18,87.74,87.86,86.25,86.81,41544800,43.40 +2005-02-17,90.65,90.88,87.45,87.81,54231200,43.90 +2005-02-16,88.15,90.20,87.35,90.13,58544400,45.06 +2005-02-15,86.66,89.08,86.00,88.41,82579200,44.21 +2005-02-14,82.73,84.79,82.05,84.63,45409400,42.31 +2005-02-11,79.86,81.76,78.94,81.21,42894800,40.60 +2005-02-10,78.72,79.28,76.66,78.36,39036400,39.18 +2005-02-09,81.04,81.99,78.10,78.74,42552000,39.37 +2005-02-08,79.07,81.38,78.79,80.90,31786400,40.45 +2005-02-07,78.93,79.35,77.50,78.94,18730600,39.47 +2005-02-04,77.87,78.93,77.53,78.84,20127000,39.42 +2005-02-03,79.10,79.43,77.33,77.81,26130400,38.90 +2005-02-02,77.95,79.91,77.69,79.63,36430800,39.81 +2005-02-01,77.05,77.77,76.58,77.53,24228400,38.76 +2005-01-31,74.58,77.89,74.51,76.90,60039200,38.45 +2005-01-28,72.62,73.98,72.44,73.98,28629000,36.99 +2005-01-27,72.16,72.92,71.55,72.64,17722400,36.32 +2005-01-26,72.66,72.75,71.22,72.25,26410600,36.12 +2005-01-25,71.37,72.84,70.94,72.05,34615400,36.03 +2005-01-24,70.98,71.78,70.55,70.76,30058200,35.38 +2005-01-21,71.31,71.60,70.00,70.49,32547600,35.24 +2005-01-20,69.65,71.27,69.47,70.46,32675800,35.23 +2005-01-19,70.49,71.46,69.75,69.88,26853400,34.94 +2005-01-18,69.85,70.70,67.75,70.65,35945000,35.33 +2005-01-14,70.25,71.72,69.19,70.20,63240800,35.10 +2005-01-13,73.71,74.42,69.73,69.80,113025600,34.90 +2005-01-12,65.45,65.90,63.30,65.46,68560800,32.73 +2005-01-11,68.25,69.15,64.14,64.56,93272400,32.28 +2005-01-10,69.83,70.70,67.88,68.96,61618200,34.48 +2005-01-07,65.00,69.63,64.75,69.25,79551800,34.62 +2005-01-06,64.67,64.91,63.33,64.55,25198400,32.28 +2005-01-05,64.46,65.25,64.05,64.50,24301200,32.25 +2005-01-04,63.79,65.47,62.97,63.94,39171800,31.97 +2005-01-03,64.78,65.11,62.60,63.29,24714000,31.65 +2004-12-31,64.89,65.00,64.03,64.40,9949600,32.20 +2004-12-30,64.81,65.03,64.22,64.80,12333600,32.40 +2004-12-29,63.81,64.98,63.57,64.44,16055800,32.22 +2004-12-28,63.30,64.25,62.05,64.18,21848400,32.09 +2004-12-27,64.80,65.15,62.88,63.16,19981800,31.58 +2004-12-23,63.75,64.25,63.60,64.01,8783200,32.01 +2004-12-22,63.66,64.36,63.40,63.75,20208200,31.88 +2004-12-21,63.56,63.77,61.60,63.69,38014800,31.84 +2004-12-20,65.47,66.00,61.76,62.72,41718800,31.36 +2004-12-17,66.84,67.04,64.90,64.99,27982000,32.49 +2004-12-16,66.15,67.50,66.05,66.60,40218400,33.30 +2004-12-15,65.24,65.46,64.66,65.26,14227200,32.63 +2004-12-14,65.40,65.88,65.02,65.29,14847200,32.65 +2004-12-13,65.62,65.90,64.60,64.91,14108600,32.46 +2004-12-10,65.03,66.05,64.70,65.15,27706200,32.58 +2004-12-09,62.81,64.40,62.07,63.99,26482200,32.00 +2004-12-08,63.08,64.43,62.05,63.28,24710800,31.64 +2004-12-07,65.93,66.73,62.56,62.89,37746400,31.44 +2004-12-06,64.25,66.24,62.95,65.78,44568600,32.89 +2004-12-03,64.53,65.00,61.75,62.68,44244600,31.34 +2004-12-02,66.13,66.90,64.66,65.21,35265800,32.60 +2004-12-01,67.79,67.95,66.27,67.79,28591200,33.90 +2004-11-30,68.79,68.79,67.05,67.05,36732800,33.53 +2004-11-29,68.95,69.57,67.41,68.44,61175600,34.22 +2004-11-26,65.35,65.76,64.34,64.55,19648000,32.28 +2004-11-24,61.69,65.20,61.55,64.05,49671000,32.03 +2004-11-23,62.30,62.45,61.05,61.27,32551800,30.64 +2004-11-22,61.80,64.00,57.90,61.35,91721800,30.67 +2004-11-19,55.49,56.91,54.50,55.17,27331400,27.58 +2004-11-18,54.30,55.45,54.29,55.39,16398200,27.69 +2004-11-17,55.19,55.45,54.22,54.90,14205400,27.45 +2004-11-16,55.16,55.20,54.48,54.94,10539400,27.47 +2004-11-15,55.20,55.46,54.34,55.24,13430200,27.62 +2004-11-12,55.01,55.69,54.84,55.50,14132200,27.75 +2004-11-11,54.95,55.43,54.23,55.30,14546400,27.65 +2004-11-10,53.95,55.39,53.91,54.75,18167000,27.38 +2004-11-09,54.23,54.55,53.38,54.05,16991600,27.02 +2004-11-08,54.27,55.45,53.86,54.38,18818600,27.19 +2004-11-05,54.86,55.00,52.04,54.72,43037400,27.36 +2004-11-04,55.03,55.55,54.37,54.45,33165200,27.23 +2004-11-03,54.37,56.11,53.99,55.31,43006200,27.66 +2004-11-02,52.40,54.08,52.40,53.50,26071000,26.75 +2004-11-01,52.50,53.26,52.04,52.45,21501800,26.23 +2004-10-29,51.84,53.20,51.80,52.40,28936400,26.20 +2004-10-28,49.98,52.22,49.50,52.19,30866600,26.09 +2004-10-27,48.51,50.62,48.17,50.30,42624800,25.15 +2004-10-26,47.45,48.05,46.97,47.97,21227200,23.99 +2004-10-25,47.20,47.84,47.07,47.55,14023000,23.77 +2004-10-22,47.54,47.67,47.02,47.41,17252400,23.70 +2004-10-21,47.48,48.13,47.36,47.94,25875200,23.97 +2004-10-20,47.18,47.60,46.65,47.47,21611000,23.74 +2004-10-19,48.10,48.35,47.31,47.42,28642600,23.71 +2004-10-18,44.70,47.75,44.70,47.75,42884000,23.88 +2004-10-15,44.88,45.61,44.19,45.50,36826000,22.75 +2004-10-14,43.19,45.75,42.55,44.98,98872400,22.49 +2004-10-13,38.87,39.76,38.74,39.75,41536000,19.88 +2004-10-12,38.50,38.58,37.65,38.29,16435400,19.15 +2004-10-11,38.80,39.06,38.20,38.59,11566800,19.30 +2004-10-08,39.56,39.77,38.84,39.06,12829600,19.53 +2004-10-07,40.54,40.93,39.46,39.62,15219600,19.81 +2004-10-06,39.50,40.76,39.47,40.64,15939400,20.32 +2004-10-05,38.56,39.67,38.40,39.37,14505800,19.68 +2004-10-04,39.18,39.18,38.75,38.79,20503000,19.40 +2004-10-01,39.12,39.19,38.58,38.67,16621600,19.33 +2004-09-30,39.00,39.27,38.45,38.75,15179000,19.38 +2004-09-29,37.93,38.86,37.82,38.68,9768200,19.34 +2004-09-28,37.46,38.29,37.45,38.04,12613800,19.02 +2004-09-27,36.95,37.98,36.83,37.53,14197000,18.76 +2004-09-24,37.45,38.00,37.15,37.29,13196000,18.65 +2004-09-23,37.04,37.50,36.93,37.27,14193000,18.64 +2004-09-22,38.10,38.14,36.81,36.92,14346000,18.46 +2004-09-21,37.75,38.87,37.46,38.01,13809000,19.00 +2004-09-20,36.88,37.98,36.87,37.71,8750000,18.85 +2004-09-17,36.55,37.38,36.40,37.14,17939600,18.57 +2004-09-16,35.20,36.76,35.08,36.35,17925600,18.17 +2004-09-15,35.36,35.48,34.80,35.20,8309600,17.60 +2004-09-14,35.24,35.55,34.78,35.49,9100800,17.75 +2004-09-13,35.88,36.07,35.32,35.59,10070600,17.80 +2004-09-10,35.66,36.23,35.46,35.87,11714800,17.93 +2004-09-09,36.10,36.30,35.28,35.70,16476400,17.85 +2004-09-08,35.70,36.57,35.68,36.35,12268800,18.17 +2004-09-07,35.40,36.19,35.23,35.76,10784200,17.88 +2004-09-03,35.01,35.92,35.01,35.23,10481000,17.61 +2004-09-02,35.50,35.81,34.83,35.66,14511600,17.83 +2004-09-01,34.30,35.99,34.19,35.86,18418800,17.93 +2004-08-31,34.07,34.95,34.00,34.49,13448600,17.25 +2004-08-30,34.00,34.72,33.96,34.12,7790800,17.06 +2004-08-27,34.68,34.76,34.00,34.35,13886200,17.17 +2004-08-26,33.04,35.18,32.74,34.66,34137800,17.33 +2004-08-25,31.87,33.15,31.73,33.05,18057800,16.52 +2004-08-24,31.26,31.95,31.19,31.95,13362000,15.98 +2004-08-23,30.86,31.27,30.60,31.08,9095000,15.54 +2004-08-20,30.71,30.99,30.49,30.80,11313600,15.40 +2004-08-19,31.51,31.86,30.36,30.71,13890000,15.35 +2004-08-18,30.51,31.85,30.49,31.74,13023400,15.87 +2004-08-17,30.58,31.13,30.35,30.87,11536400,15.44 +2004-08-16,31.00,31.72,30.64,30.78,15559800,15.39 +2004-08-13,30.60,31.28,30.40,30.84,11716000,15.42 +2004-08-12,30.45,30.85,30.28,30.37,8078600,15.19 +2004-08-11,31.10,31.13,30.26,31.01,11514000,15.51 +2004-08-10,30.39,31.54,30.35,31.52,12537000,15.76 +2004-08-09,29.85,30.45,29.81,30.30,10387400,15.15 +2004-08-06,30.90,31.10,29.70,29.78,17581800,14.89 +2004-08-05,31.81,32.30,31.25,31.39,8732200,15.69 +2004-08-04,31.19,32.12,31.17,31.79,9874600,15.90 +2004-08-03,31.45,31.72,31.15,31.29,7558200,15.65 +2004-08-02,31.18,32.20,31.13,31.58,13039000,15.79 +2004-07-30,32.65,33.00,32.00,32.34,8679400,16.17 +2004-07-29,32.47,32.82,32.13,32.64,7934200,16.32 +2004-07-28,32.31,32.41,31.16,32.27,10180400,16.14 +2004-07-27,31.80,32.75,31.57,32.43,15178800,16.22 +2004-07-26,30.85,31.45,30.78,31.26,14069000,15.63 +2004-07-23,31.53,31.75,30.48,30.70,9770400,15.35 +2004-07-22,31.25,31.73,31.06,31.68,11932800,15.84 +2004-07-21,32.42,32.71,31.34,31.62,10759200,15.81 +2004-07-20,31.95,32.20,31.55,32.20,11562400,16.10 +2004-07-19,32.01,32.22,31.66,31.97,19041800,15.98 +2004-07-16,32.80,32.92,32.12,32.20,17442200,16.10 +2004-07-15,32.66,33.63,32.11,32.93,63133000,16.47 +2004-07-14,28.86,29.97,28.74,29.58,29850000,14.79 +2004-07-13,29.25,29.60,29.02,29.22,11292000,14.61 +2004-07-12,30.02,30.04,28.93,29.14,18272200,14.57 +2004-07-09,30.27,30.50,30.03,30.03,7459400,15.02 +2004-07-08,30.13,30.68,29.95,30.14,8335000,15.07 +2004-07-07,30.85,31.36,30.13,30.39,14214000,15.19 +2004-07-06,31.27,31.42,30.80,30.95,12463600,15.48 +2004-07-02,30.48,31.18,29.73,31.08,32524400,15.54 +2004-07-01,32.10,32.48,31.90,32.30,12212200,16.15 +2004-06-30,32.56,32.97,31.89,32.54,13323000,16.27 +2004-06-29,32.07,32.99,31.41,32.50,21091200,16.25 +2004-06-28,34.18,34.19,32.21,32.49,18610600,16.25 +2004-06-25,33.07,33.70,33.00,33.70,11551000,16.85 +2004-06-24,33.51,33.70,32.98,33.18,9018400,16.59 +2004-06-23,33.00,33.83,32.89,33.70,13959600,16.85 +2004-06-22,32.30,33.09,32.29,33.00,12875400,16.50 +2004-06-21,33.12,33.50,32.12,32.33,13936200,16.17 +2004-06-18,32.66,33.41,32.43,32.91,14509000,16.45 +2004-06-17,32.56,33.13,32.21,32.81,19690000,16.41 +2004-06-16,30.66,33.32,30.53,32.74,32487200,16.37 +2004-06-15,30.54,31.14,30.26,30.69,15879800,15.35 +2004-06-14,30.65,30.68,29.50,30.12,8713800,15.06 +2004-06-10,30.20,30.97,30.20,30.74,9199200,15.37 +2004-06-09,30.09,30.71,30.00,30.20,12471600,15.10 +2004-06-08,29.99,30.44,29.83,30.35,14843600,15.18 +2004-06-07,29.04,29.98,28.81,29.81,10567000,14.90 +2004-06-04,28.56,29.25,28.51,28.78,14254000,14.39 +2004-06-03,28.72,28.99,28.29,28.40,8961800,14.20 +2004-06-02,28.03,29.17,27.80,28.92,11382600,14.46 +2004-06-01,27.79,28.20,27.61,28.06,6504800,14.03 +2004-05-28,28.08,28.27,27.80,28.06,5204200,14.03 +2004-05-27,28.46,28.60,27.82,28.17,8427600,14.09 +2004-05-26,28.33,28.78,28.00,28.51,11506000,14.26 +2004-05-25,27.50,28.51,27.29,28.41,11427800,14.20 +2004-05-24,27.29,27.90,27.11,27.34,8414400,13.67 +2004-05-21,26.90,27.20,26.73,27.11,6424800,13.56 +2004-05-20,26.63,27.00,26.47,26.71,7010600,13.35 +2004-05-19,27.40,27.50,26.42,26.47,13414000,13.23 +2004-05-18,26.97,27.29,26.80,27.06,7359400,13.53 +2004-05-17,26.70,27.06,26.36,26.64,10730200,13.32 +2004-05-14,27.25,27.32,26.45,27.06,9207200,13.53 +2004-05-13,27.10,27.72,26.90,27.19,8209000,13.60 +2004-05-12,26.79,27.34,26.24,27.30,8765000,13.65 +2004-05-11,26.40,27.19,26.40,27.14,10899000,13.57 +2004-05-10,26.27,26.60,25.94,26.28,8927800,13.14 +2004-05-07,26.55,27.57,26.55,26.67,14965600,13.34 +2004-05-06,26.40,26.75,25.90,26.58,9412800,13.29 +2004-05-05,26.20,26.75,25.96,26.65,8503800,13.32 +2004-05-04,25.97,26.55,25.50,26.14,9999400,13.07 +2004-05-03,26.00,26.33,25.74,26.07,10629800,13.03 +2004-04-30,26.71,26.96,25.49,25.78,16660800,12.89 +2004-04-29,26.45,27.00,25.98,26.77,16456800,13.39 +2004-04-28,26.82,27.01,26.34,26.45,8256000,13.23 +2004-04-27,27.24,27.44,26.69,26.94,10138000,13.47 +2004-04-26,27.58,27.64,27.00,27.13,8254600,13.56 +2004-04-23,27.70,28.00,27.05,27.70,11279600,13.85 +2004-04-22,27.56,28.18,27.11,27.78,12306600,13.89 +2004-04-21,27.60,28.12,27.37,27.73,11638400,13.86 +2004-04-20,28.21,28.41,27.56,27.73,12661400,13.86 +2004-04-19,28.12,28.75,27.83,28.35,25441200,14.18 +2004-04-16,29.15,29.31,28.50,29.18,14390400,14.59 +2004-04-15,28.82,29.58,28.16,29.30,62908800,14.65 +2004-04-14,26.74,27.07,26.31,26.64,22847600,13.32 +2004-04-13,27.98,28.03,26.84,26.93,15585600,13.47 +2004-04-12,27.50,28.10,27.49,28.04,8233600,14.02 +2004-04-08,27.88,28.00,27.20,27.53,8604200,13.77 +2004-04-07,27.61,27.70,26.92,27.31,9111400,13.65 +2004-04-06,27.71,28.15,27.43,27.83,9214000,13.91 +2004-04-05,27.48,28.37,27.44,28.32,13774000,14.16 +2004-04-02,27.75,27.93,27.23,27.50,9802800,13.75 +2004-04-01,26.89,27.27,26.62,27.11,11369000,13.56 +2004-03-31,27.92,27.98,26.95,27.04,13956200,13.52 +2004-03-30,27.74,27.95,27.34,27.92,12845600,13.96 +2004-03-29,27.37,27.99,27.20,27.91,12526000,13.95 +2004-03-26,27.00,27.36,26.91,27.04,14996200,13.52 +2004-03-25,26.14,26.91,25.89,26.87,20230200,13.44 +2004-03-24,25.27,25.75,25.27,25.50,15293400,12.75 +2004-03-23,25.88,26.00,25.22,25.29,13768400,12.65 +2004-03-22,25.37,26.17,25.25,25.86,14965400,12.93 +2004-03-19,25.56,26.94,25.54,25.86,14592000,12.93 +2004-03-18,25.94,26.06,25.59,25.67,11467200,12.84 +2004-03-17,25.96,26.38,25.78,26.19,14694000,13.10 +2004-03-16,26.55,26.61,25.39,25.82,21622600,12.91 +2004-03-15,27.03,27.35,26.26,26.45,17204200,13.23 +2004-03-12,27.32,27.78,27.17,27.56,11758000,13.78 +2004-03-11,27.27,28.04,27.09,27.15,21280400,13.57 +2004-03-10,27.04,28.14,26.94,27.68,35963000,13.84 +2004-03-09,25.90,27.23,25.75,27.10,22084400,13.55 +2004-03-08,26.62,26.79,25.80,26.00,18674000,13.00 +2004-03-05,24.95,27.49,24.90,26.74,55021400,13.37 +2004-03-04,23.93,25.22,23.91,25.16,23579400,12.58 +2004-03-03,23.60,24.19,23.60,23.92,8040400,11.96 +2004-03-02,24.00,24.10,23.77,23.81,9167400,11.90 +2004-03-01,24.10,24.30,23.87,24.02,11488600,12.01 +2004-02-27,22.96,24.02,22.95,23.92,16744200,11.96 +2004-02-26,22.88,23.18,22.80,23.04,7086000,11.52 +2004-02-25,22.28,22.90,22.21,22.81,9867000,11.40 +2004-02-24,22.14,22.74,22.00,22.36,9252000,11.18 +2004-02-23,22.34,22.46,21.89,22.19,6931400,11.10 +2004-02-20,22.50,22.51,22.21,22.40,9914400,11.20 +2004-02-19,23.33,23.64,22.41,22.47,11538600,11.23 +2004-02-18,23.18,23.44,23.05,23.26,5058400,11.63 +2004-02-17,23.10,23.49,23.10,23.16,6105600,11.58 +2004-02-13,23.85,24.10,22.83,23.00,11285000,11.50 +2004-02-12,23.61,23.99,23.60,23.73,6571000,11.86 +2004-02-11,23.09,23.87,23.05,23.80,12448000,11.90 +2004-02-10,22.62,23.12,22.44,22.98,9119400,11.49 +2004-02-09,22.62,22.86,22.50,22.67,6723600,11.34 +2004-02-06,22.45,22.89,22.40,22.71,6905000,11.35 +2004-02-05,21.82,22.91,21.81,22.42,12601600,11.21 +2004-02-04,22.00,22.09,21.70,21.79,10912600,10.90 +2004-02-03,22.30,22.40,22.00,22.26,6457600,11.13 +2004-02-02,22.46,22.81,22.08,22.32,10265400,11.16 +2004-01-30,22.65,22.87,22.42,22.56,6617800,11.28 +2004-01-29,22.63,22.80,22.19,22.68,7596400,11.34 +2004-01-28,22.84,23.38,22.41,22.52,9835800,11.26 +2004-01-27,23.04,23.25,22.80,23.07,10966800,11.53 +2004-01-26,22.46,23.06,22.43,23.01,9688200,11.51 +2004-01-23,22.42,22.74,22.25,22.56,8113200,11.28 +2004-01-22,22.56,22.83,22.18,22.18,7321600,11.09 +2004-01-21,22.70,22.97,22.43,22.61,8095000,11.31 +2004-01-20,22.67,22.80,22.25,22.73,11283800,11.36 +2004-01-16,22.89,23.04,22.61,22.72,13315000,11.36 +2004-01-15,22.91,23.40,22.50,22.85,36364600,11.43 +2004-01-14,24.40,24.54,23.78,24.20,22144400,12.10 +2004-01-13,24.70,24.84,23.86,24.12,24250600,12.06 +2004-01-12,23.25,24.00,23.10,23.73,17412400,11.86 +2004-01-09,23.23,24.13,22.79,23.00,15266400,11.50 +2004-01-08,22.84,23.73,22.65,23.36,16439400,11.68 +2004-01-07,22.10,22.83,21.93,22.59,20959800,11.30 +2004-01-06,22.25,22.42,21.71,22.09,18191000,11.05 +2004-01-05,21.42,22.39,21.42,22.17,14107800,11.09 +2004-01-02,21.55,21.75,21.18,21.28,5165800,10.64 +2003-12-31,21.35,21.53,21.18,21.37,6230400,10.69 +2003-12-30,21.18,21.50,21.15,21.28,7316200,10.64 +2003-12-29,20.91,21.16,20.86,21.15,8337800,10.57 +2003-12-26,20.35,20.91,20.34,20.78,3703400,10.39 +2003-12-24,19.72,20.59,19.65,20.41,6338400,10.20 +2003-12-23,19.92,19.95,19.60,19.81,11017800,9.90 +2003-12-22,19.65,19.89,19.25,19.85,13466600,9.93 +2003-12-19,20.19,20.42,19.62,19.70,16198600,9.85 +2003-12-18,19.90,20.18,19.90,20.04,11818400,10.02 +2003-12-17,20.08,20.13,19.79,19.88,9795000,9.94 +2003-12-16,20.19,20.49,20.01,20.12,13355600,10.06 +2003-12-15,21.49,21.49,20.07,20.17,13889600,10.09 +2003-12-12,21.32,21.32,20.70,20.89,6881200,10.44 +2003-12-11,20.25,21.34,20.21,21.21,6540600,10.60 +2003-12-10,20.45,20.61,19.96,20.38,9690600,10.19 +2003-12-09,21.17,21.25,20.40,20.45,4826600,10.23 +2003-12-08,20.78,21.08,20.41,21.05,5294200,10.52 +2003-12-05,20.90,21.15,20.73,20.85,6649200,10.43 +2003-12-04,20.94,21.17,20.77,21.15,6355000,10.57 +2003-12-03,21.54,21.84,20.96,21.03,6832000,10.52 +2003-12-02,21.60,21.90,21.41,21.54,7332000,10.77 +2003-12-01,21.04,21.85,21.00,21.71,12912000,10.85 +2003-11-28,20.78,21.07,20.52,20.91,2717800,10.45 +2003-11-26,20.89,21.15,20.25,20.72,8754600,10.36 +2003-11-25,21.23,21.25,20.61,20.68,9594800,10.34 +2003-11-24,20.50,21.27,20.45,21.15,13636600,10.57 +2003-11-21,20.34,20.58,19.85,20.28,8637000,10.14 +2003-11-20,20.10,21.08,20.10,20.38,8556800,10.19 +2003-11-19,20.56,20.65,20.26,20.42,12306600,10.21 +2003-11-18,21.21,21.34,20.35,20.41,9542600,10.20 +2003-11-17,21.35,21.37,20.95,21.13,8152000,10.56 +2003-11-14,22.48,22.61,21.28,21.46,8466000,10.73 +2003-11-13,22.07,22.56,21.92,22.42,7599000,11.21 +2003-11-12,21.48,22.72,21.48,22.33,10714400,11.16 +2003-11-11,21.90,22.02,21.48,21.54,7681200,10.77 +2003-11-10,22.45,22.65,21.84,21.90,8367000,10.95 +2003-11-07,23.19,23.24,22.45,22.50,7505200,11.25 +2003-11-06,22.91,23.15,22.65,23.12,14181200,11.56 +2003-11-05,22.82,23.13,22.47,23.03,11516800,11.52 +2003-11-04,23.07,23.10,22.59,22.91,8901200,11.45 +2003-11-03,22.83,23.30,22.78,23.15,10815800,11.57 +2003-10-31,23.30,23.35,22.78,22.89,7791200,11.44 +2003-10-30,23.99,24.00,22.87,23.09,9305600,11.55 +2003-10-29,23.51,23.90,23.34,23.69,9538600,11.85 +2003-10-28,22.56,23.77,22.40,23.72,8989800,11.86 +2003-10-27,22.75,22.89,22.49,22.60,5786200,11.30 +2003-10-24,22.56,22.85,22.23,22.60,7852000,11.30 +2003-10-23,22.73,23.15,22.59,22.99,5900400,11.49 +2003-10-22,22.94,23.20,22.68,22.76,5771400,11.38 +2003-10-21,23.31,23.40,22.75,23.18,6302200,11.59 +2003-10-20,22.60,23.34,22.38,23.22,9969000,11.61 +2003-10-17,23.38,23.49,22.43,22.75,12850400,11.38 +2003-10-16,23.80,23.84,22.41,23.25,34845800,11.62 +2003-10-15,24.85,25.01,24.58,24.82,21789400,12.41 +2003-10-14,24.32,24.74,24.19,24.55,9836400,12.27 +2003-10-13,23.73,24.41,23.72,24.35,9995200,12.18 +2003-10-10,23.50,23.81,23.37,23.68,6244200,11.84 +2003-10-09,23.30,23.67,22.79,23.45,12419600,11.73 +2003-10-08,23.25,23.54,22.73,23.06,15309600,11.53 +2003-10-07,22.05,23.41,21.91,23.22,14934800,11.61 +2003-10-06,21.67,22.33,21.58,22.29,9583200,11.15 +2003-10-03,20.99,21.86,20.88,21.69,10700000,10.85 +2003-10-02,20.80,20.80,20.28,20.57,7287800,10.28 +2003-10-01,20.71,21.10,20.19,20.79,8432600,10.40 +2003-09-30,21.09,21.22,20.44,20.72,10193800,10.36 +2003-09-29,21.49,21.67,20.65,21.30,13060800,10.65 +2003-09-26,20.30,21.70,20.15,20.69,12401800,10.35 +2003-09-25,21.34,21.37,20.25,20.43,20513600,10.22 +2003-09-24,22.21,22.31,21.08,21.32,10760200,10.66 +2003-09-23,22.02,22.46,21.88,22.43,4730400,11.22 +2003-09-22,22.18,22.50,21.92,22.08,6422200,11.04 +2003-09-19,22.88,23.05,22.43,22.58,7355600,11.29 +2003-09-18,22.10,22.99,21.95,22.88,9032400,11.44 +2003-09-17,22.37,22.38,21.85,22.12,10335600,11.06 +2003-09-16,22.21,22.69,22.20,22.36,9607400,11.18 +2003-09-15,22.81,22.90,22.12,22.21,8101600,11.10 +2003-09-12,22.51,23.14,22.31,23.10,6428200,11.55 +2003-09-11,22.25,22.79,22.10,22.56,7631600,11.28 +2003-09-10,22.25,22.61,22.11,22.18,8031800,11.09 +2003-09-09,22.53,22.67,22.12,22.37,6441800,11.19 +2003-09-08,22.48,22.79,22.47,22.74,5973000,11.37 +2003-09-05,22.73,23.15,22.41,22.50,8576200,11.25 +2003-09-04,23.16,23.25,22.77,22.83,7135000,11.41 +2003-09-03,22.80,23.32,22.76,22.95,9601000,11.48 +2003-09-02,22.66,22.90,22.40,22.85,8647600,11.43 +2003-08-29,22.20,22.85,22.05,22.61,9398400,11.31 +2003-08-28,21.33,22.22,21.33,22.19,11415200,11.10 +2003-08-27,20.91,21.48,20.66,21.48,8060800,10.74 +2003-08-26,20.75,21.07,20.35,21.05,5891400,10.52 +2003-08-25,20.78,20.91,20.49,20.86,4920800,10.43 +2003-08-22,21.81,22.00,20.64,20.88,8938000,10.44 +2003-08-21,21.03,21.71,20.95,21.68,9118800,10.84 +2003-08-20,20.18,21.27,20.14,21.01,9757600,10.51 +2003-08-19,20.37,20.45,20.00,20.32,4774600,10.16 +2003-08-18,19.86,20.41,19.72,20.34,6884800,10.17 +2003-08-15,20.02,20.07,19.66,19.71,4495200,9.85 +2003-08-14,20.21,20.33,19.94,19.97,6885000,9.98 +2003-08-13,19.86,20.34,19.58,20.18,10146400,10.09 +2003-08-12,19.76,19.80,19.46,19.70,5872800,9.85 +2003-08-11,19.82,19.93,19.51,19.66,4901000,9.83 +2003-08-08,20.11,20.13,19.60,19.64,4916400,9.82 +2003-08-07,19.73,20.09,19.42,19.93,6227800,9.97 +2003-08-06,20.06,20.17,19.50,19.63,8766600,9.81 +2003-08-05,21.35,21.40,20.10,20.38,8908600,10.19 +2003-08-04,20.53,21.50,20.28,21.21,8218400,10.60 +2003-08-01,21.00,21.27,20.64,20.73,5343000,10.36 +2003-07-31,20.74,21.35,20.57,21.08,10766600,10.54 +2003-07-30,20.77,20.90,20.17,20.28,6199800,10.14 +2003-07-29,20.99,21.08,20.52,20.72,7040000,10.36 +2003-07-28,21.50,21.50,20.86,20.99,6084200,10.49 +2003-07-25,20.41,21.57,20.40,21.54,7738800,10.77 +2003-07-24,21.04,21.50,20.38,20.51,8187000,10.26 +2003-07-23,20.95,20.96,20.46,20.79,5108400,10.40 +2003-07-22,20.87,20.96,20.50,20.80,7086600,10.40 +2003-07-21,20.69,20.80,20.30,20.61,6564600,10.31 +2003-07-18,20.90,21.18,20.40,20.86,10672800,10.43 +2003-07-17,20.19,20.95,20.13,20.90,26829000,10.45 +2003-07-16,19.97,20.00,19.38,19.87,8961800,9.94 +2003-07-15,20.02,20.24,19.43,19.61,7380200,9.81 +2003-07-14,20.01,20.40,19.87,19.90,6728800,9.95 +2003-07-11,19.66,20.00,19.53,19.85,4887800,9.93 +2003-07-10,19.88,19.94,19.37,19.58,6104800,9.79 +2003-07-09,20.21,20.45,19.89,19.89,7630200,9.94 +2003-07-08,19.52,20.50,19.49,20.40,9169200,10.20 +2003-07-07,19.27,20.18,19.13,19.87,10224000,9.94 +2003-07-03,19.00,19.55,18.98,19.13,4920400,9.56 +2003-07-02,19.03,19.40,19.02,19.27,11617800,9.64 +2003-07-01,18.87,19.18,18.51,19.09,6464000,9.55 +2003-06-30,18.68,19.21,18.59,19.06,7934000,9.53 +2003-06-27,19.30,19.31,18.48,18.73,13064000,9.36 +2003-06-26,18.70,19.32,18.70,19.29,5775200,9.65 +2003-06-25,18.86,19.40,18.71,19.09,11779000,9.55 +2003-06-24,19.47,19.67,18.72,18.78,18370800,9.39 +2003-06-23,19.30,19.69,18.75,19.06,10977200,9.53 +2003-06-20,19.35,19.58,18.90,19.20,12733800,9.60 +2003-06-19,19.36,19.61,18.77,19.14,13626000,9.57 +2003-06-18,18.45,19.48,18.31,19.12,16249400,9.56 +2003-06-17,18.41,18.50,17.99,18.19,6338000,9.10 +2003-06-16,17.60,18.27,17.45,18.27,8518800,9.14 +2003-06-13,17.75,17.95,17.13,17.42,6830200,8.71 +2003-06-12,17.55,17.88,17.45,17.77,9021000,8.89 +2003-06-11,17.15,17.51,16.81,17.45,8039800,8.73 +2003-06-10,16.89,17.29,16.75,17.18,6308800,8.59 +2003-06-09,16.94,17.04,16.63,16.79,9284000,8.40 +2003-06-06,17.74,18.04,17.14,17.15,8621000,8.57 +2003-06-05,17.45,17.74,17.33,17.64,7339200,8.82 +2003-06-04,17.30,17.79,17.14,17.60,9685800,8.80 +2003-06-03,17.44,17.67,17.02,17.31,12887800,8.65 +2003-06-02,18.10,18.29,17.27,17.45,14949600,8.73 +2003-05-30,18.12,18.18,17.53,17.95,13669600,8.98 +2003-05-29,18.29,18.50,17.90,18.10,11920200,9.05 +2003-05-28,18.50,18.66,18.15,18.28,12131400,9.14 +2003-05-27,17.96,18.90,17.91,18.88,10361800,9.44 +2003-05-23,18.21,18.46,17.96,18.32,7382800,9.16 +2003-05-22,17.89,18.40,17.74,18.24,6373600,9.12 +2003-05-21,17.79,18.09,17.67,17.85,10893200,8.93 +2003-05-20,18.10,18.16,17.60,17.79,14865000,8.90 +2003-05-19,18.53,18.65,18.06,18.10,15924600,9.05 +2003-05-16,18.59,19.01,18.28,18.80,12201000,9.40 +2003-05-15,18.60,18.85,18.47,18.73,10178400,9.36 +2003-05-14,18.83,18.84,18.43,18.55,12696000,9.27 +2003-05-13,18.43,18.97,17.95,18.67,15957000,9.34 +2003-05-12,18.15,18.74,18.13,18.56,14977600,9.28 +2003-05-09,18.33,18.40,17.88,18.30,21013800,9.15 +2003-05-08,17.70,18.07,17.29,18.00,24562000,9.00 +2003-05-07,17.33,18.24,17.11,17.65,37656400,8.82 +2003-05-06,16.12,17.90,16.10,17.50,54089000,8.75 +2003-05-05,14.77,16.88,14.75,16.09,55561000,8.05 +2003-05-02,14.46,14.59,14.34,14.45,11470800,7.22 +2003-05-01,14.25,14.39,14.00,14.36,12241400,7.18 +2003-04-30,13.93,14.35,13.85,14.22,16363400,7.11 +2003-04-29,13.98,14.16,13.58,14.06,16365600,7.03 +2003-04-28,13.48,13.96,13.43,13.86,22742800,6.93 +2003-04-25,13.46,13.58,13.23,13.35,7332800,6.68 +2003-04-24,13.52,13.61,13.00,13.44,11611000,6.72 +2003-04-23,13.53,13.63,13.36,13.58,7488600,6.79 +2003-04-22,13.18,13.62,13.09,13.51,10734600,6.76 +2003-04-21,13.13,13.19,12.98,13.14,5440000,6.57 +2003-04-17,13.20,13.25,12.72,13.12,22009200,6.56 +2003-04-16,12.99,13.67,12.92,13.24,36292000,6.62 +2003-04-15,13.59,13.60,13.30,13.39,10856000,6.70 +2003-04-14,13.71,13.75,13.50,13.58,17962800,6.79 +2003-04-11,14.05,14.44,12.93,13.20,49739600,6.60 +2003-04-10,14.20,14.39,14.20,14.37,3825000,7.18 +2003-04-09,14.52,14.62,14.14,14.19,5240200,7.09 +2003-04-08,14.51,14.65,14.36,14.45,4604800,7.22 +2003-04-07,14.85,14.95,14.41,14.49,7030800,7.24 +2003-04-04,14.52,14.67,14.39,14.41,5215000,7.20 +2003-04-03,14.56,14.70,14.35,14.46,5204000,7.23 +2003-04-02,14.36,14.69,14.27,14.60,6120400,7.30 +2003-04-01,14.20,14.31,14.07,14.16,5512200,7.08 +2003-03-31,14.33,14.53,14.04,14.14,9166400,7.07 +2003-03-28,14.40,14.62,14.37,14.57,5189400,7.28 +2003-03-27,14.32,14.70,14.32,14.49,4371200,7.24 +2003-03-26,14.55,14.56,14.30,14.41,6369400,7.20 +2003-03-25,14.41,14.83,14.37,14.55,5989200,7.28 +2003-03-24,14.67,14.80,14.35,14.37,5753600,7.18 +2003-03-21,15.09,15.15,14.82,15.00,10641000,7.50 +2003-03-20,14.93,14.99,14.60,14.91,5827800,7.45 +2003-03-19,15.07,15.15,14.79,14.95,5047000,7.47 +2003-03-18,15.00,15.09,14.82,15.00,8213600,7.50 +2003-03-17,14.89,15.07,14.71,15.01,14282600,7.51 +2003-03-14,14.68,15.01,14.64,14.78,5467800,7.39 +2003-03-13,14.47,14.80,14.17,14.72,11980200,7.36 +2003-03-12,14.17,14.39,14.06,14.22,7948600,7.11 +2003-03-11,14.36,14.49,14.12,14.23,5756800,7.11 +2003-03-10,14.51,14.67,14.30,14.37,4806200,7.18 +2003-03-07,14.47,14.71,14.31,14.53,7178000,7.26 +2003-03-06,14.58,14.60,14.40,14.56,3566400,7.28 +2003-03-05,14.61,14.80,14.52,14.62,4524400,7.31 +2003-03-04,14.74,14.81,14.44,14.56,4514800,7.28 +2003-03-03,15.01,15.16,14.55,14.65,7277200,7.32 +2003-02-28,14.86,15.09,14.77,15.01,6967800,7.51 +2003-02-27,14.57,15.00,14.51,14.86,5512200,7.43 +2003-02-26,14.99,15.02,14.48,14.50,7753400,7.25 +2003-02-25,14.68,15.08,14.58,15.02,6737200,7.51 +2003-02-24,14.86,15.03,13.80,14.74,6437600,7.37 +2003-02-21,14.82,15.06,14.65,15.00,5623000,7.50 +2003-02-20,14.85,14.96,14.71,14.77,8012600,7.39 +2003-02-19,15.07,15.15,14.68,14.85,8584600,7.43 +2003-02-18,14.75,15.30,14.72,15.27,10389200,7.64 +2003-02-14,14.61,14.72,14.35,14.67,8689200,7.34 +2003-02-13,14.41,14.64,14.24,14.54,7446200,7.27 +2003-02-12,14.27,14.60,14.27,14.39,8167400,7.20 +2003-02-11,14.50,14.63,14.20,14.35,5885000,7.18 +2003-02-10,14.26,14.57,14.06,14.35,5996000,7.18 +2003-02-07,14.55,14.60,14.07,14.15,9632200,7.07 +2003-02-06,14.36,14.59,14.22,14.43,6398200,7.22 +2003-02-05,14.71,14.93,14.44,14.45,7914800,7.22 +2003-02-04,14.45,14.65,14.31,14.60,11336200,7.30 +2003-02-03,14.41,14.91,14.35,14.66,9456600,7.33 +2003-01-31,14.19,14.55,14.05,14.36,12186600,7.18 +2003-01-30,14.98,15.07,14.29,14.32,14537800,7.16 +2003-01-29,14.55,15.10,14.30,14.93,13323000,7.47 +2003-01-28,14.24,14.69,14.16,14.58,10223400,7.29 +2003-01-27,13.68,14.50,13.65,14.13,13978800,7.07 +2003-01-24,14.24,14.24,13.56,13.80,10909600,6.90 +2003-01-23,14.05,14.36,13.95,14.17,8152000,7.09 +2003-01-22,13.98,14.15,13.80,13.88,7683600,6.94 +2003-01-21,14.21,14.41,14.00,14.02,9052000,7.01 +2003-01-17,14.56,14.56,14.08,14.10,9527200,7.05 +2003-01-16,14.21,14.76,14.21,14.62,19966800,7.31 +2003-01-15,14.59,14.70,14.26,14.43,13254600,7.22 +2003-01-14,14.69,14.82,14.49,14.61,6673600,7.30 +2003-01-13,14.90,14.90,14.36,14.63,6390800,7.32 +2003-01-10,14.58,14.82,14.49,14.72,6253600,7.36 +2003-01-09,14.62,14.92,14.50,14.68,7687600,7.34 +2003-01-08,14.58,14.71,14.44,14.55,8201600,7.28 +2003-01-07,14.79,15.00,14.47,14.85,12226600,7.43 +2003-01-06,15.03,15.38,14.88,14.90,13947600,7.45 +2003-01-03,14.80,14.93,14.59,14.90,5266200,7.45 +2003-01-02,14.36,14.92,14.35,14.80,6479600,7.40 +2002-12-31,14.00,14.36,13.95,14.33,7168800,7.16 +2002-12-30,14.08,14.15,13.84,14.07,5537200,7.03 +2002-12-27,14.31,14.38,14.01,14.06,2858400,7.03 +2002-12-26,14.42,14.81,14.28,14.40,3050800,7.20 +2002-12-24,14.44,14.47,14.30,14.36,1405000,7.18 +2002-12-23,14.16,14.55,14.12,14.49,4493800,7.24 +2002-12-20,14.29,14.56,13.78,14.14,11360600,7.07 +2002-12-19,14.53,14.92,14.10,14.20,12411400,7.10 +2002-12-18,14.80,14.86,14.50,14.57,5382200,7.28 +2002-12-17,14.85,15.19,14.66,15.08,7952200,7.54 +2002-12-16,14.81,15.10,14.61,14.85,8986600,7.43 +2002-12-13,15.14,15.15,14.65,14.79,5885000,7.39 +2002-12-12,15.51,15.55,15.01,15.19,5333600,7.59 +2002-12-11,15.30,15.49,15.08,15.49,9053600,7.74 +2002-12-10,14.75,15.45,14.73,15.28,11021800,7.64 +2002-12-09,14.94,14.95,14.67,14.75,8431600,7.38 +2002-12-06,14.65,15.19,14.52,14.95,8762800,7.47 +2002-12-05,15.03,15.08,14.53,14.63,8692800,7.32 +2002-12-04,15.18,15.19,14.50,14.97,11634200,7.49 +2002-12-03,15.20,15.34,15.10,15.16,8138200,7.58 +2002-12-02,15.90,16.10,15.01,15.18,14240800,7.59 +2002-11-29,15.79,15.88,15.41,15.50,5122600,7.75 +2002-11-27,15.60,15.86,15.45,15.72,10242800,7.86 +2002-11-26,15.85,15.90,15.27,15.41,8580800,7.70 +2002-11-25,16.03,16.14,15.71,15.97,7122400,7.99 +2002-11-22,16.09,16.30,15.90,16.01,8137800,8.01 +2002-11-21,15.90,16.44,15.75,16.35,14945800,8.18 +2002-11-20,15.30,15.70,15.25,15.53,7455000,7.76 +2002-11-19,15.55,15.75,15.01,15.27,7534000,7.64 +2002-11-18,16.19,16.20,15.52,15.65,5877800,7.82 +2002-11-15,16.23,16.24,15.76,15.95,5749800,7.97 +2002-11-14,15.90,16.41,15.78,16.30,5061200,8.15 +2002-11-13,15.50,16.07,15.28,15.59,8276400,7.80 +2002-11-12,15.32,16.04,15.28,15.64,7992600,7.82 +2002-11-11,15.74,15.89,15.12,15.16,5463400,7.58 +2002-11-08,16.01,16.20,15.52,15.84,6788000,7.92 +2002-11-07,16.94,17.10,15.81,16.00,12006400,8.00 +2002-11-06,17.08,17.32,16.70,17.22,7728200,8.61 +2002-11-05,16.75,16.96,16.35,16.90,7524800,8.45 +2002-11-04,16.50,17.38,16.35,16.89,13457800,8.44 +2002-11-01,15.94,16.50,15.89,16.36,6779600,8.18 +2002-10-31,15.99,16.44,15.92,16.07,10565600,8.03 +2002-10-30,15.49,16.37,15.48,15.98,9667000,7.99 +2002-10-29,15.57,15.88,14.96,15.44,9256400,7.72 +2002-10-28,15.55,15.95,15.25,15.61,12475000,7.80 +2002-10-25,14.69,15.45,14.59,15.42,9966800,7.71 +2002-10-24,15.02,15.21,14.55,14.69,6241000,7.34 +2002-10-23,14.63,14.98,14.50,14.88,7465600,7.44 +2002-10-22,14.47,14.88,14.26,14.70,7791000,7.35 +2002-10-21,14.26,14.63,14.00,14.56,8518600,7.28 +2002-10-18,14.00,14.35,13.93,14.34,10296400,7.17 +2002-10-17,14.21,14.38,13.98,14.11,16760600,7.05 +2002-10-16,14.86,15.13,13.90,14.56,10986600,7.28 +2002-10-15,15.22,15.25,14.78,15.16,14482800,7.58 +2002-10-14,14.55,14.98,14.44,14.77,6943000,7.39 +2002-10-11,14.25,14.78,14.10,14.51,10524200,7.26 +2002-10-10,13.63,14.22,13.58,14.11,11484800,7.05 +2002-10-09,13.54,13.85,13.41,13.59,12738800,6.80 +2002-10-08,13.90,13.96,13.36,13.68,16201600,6.84 +2002-10-07,13.97,14.21,13.76,13.77,8739200,6.89 +2002-10-04,14.36,14.40,13.99,14.03,6815200,7.01 +2002-10-03,14.18,14.60,14.06,14.30,7782000,7.15 +2002-10-02,14.33,14.63,14.10,14.17,8191000,7.09 +2002-10-01,14.59,14.60,14.00,14.51,12229400,7.26 +2002-09-30,14.40,14.57,14.14,14.50,8489200,7.25 +2002-09-27,14.49,14.85,14.48,14.72,7362600,7.36 +2002-09-26,15.10,15.19,14.55,14.70,7451600,7.35 +2002-09-25,14.69,15.17,14.65,14.93,9095800,7.47 +2002-09-24,14.40,14.82,14.40,14.64,8952200,7.32 +2002-09-23,14.76,14.96,14.45,14.85,9418200,7.43 +2002-09-20,14.62,14.94,14.52,14.87,12599600,7.43 +2002-09-19,14.75,14.80,14.48,14.58,7355200,7.29 +2002-09-18,14.69,15.09,14.52,15.02,11737200,7.51 +2002-09-17,14.57,15.03,14.57,14.80,15285600,7.40 +2002-09-16,14.14,14.61,14.12,14.50,10237200,7.25 +2002-09-13,14.13,14.34,14.05,14.17,10105400,7.09 +2002-09-12,14.20,14.51,14.12,14.14,9636800,7.07 +2002-09-11,14.34,14.60,14.15,14.29,7229000,7.14 +2002-09-10,14.41,14.49,14.12,14.33,8909600,7.16 +2002-09-09,14.28,14.53,14.15,14.37,5651600,7.18 +2002-09-06,14.51,14.65,14.23,14.38,6485400,7.19 +2002-09-05,14.22,14.36,14.05,14.18,8077800,7.09 +2002-09-04,14.20,14.78,14.17,14.48,15023600,7.24 +2002-09-03,14.49,14.55,14.05,14.05,9890600,7.03 +2002-08-30,14.73,15.14,14.58,14.75,6911400,7.38 +2002-08-29,14.65,15.08,14.51,14.70,5863200,7.35 +2002-08-28,14.80,15.12,14.65,14.70,8856200,7.35 +2002-08-27,15.71,15.74,14.71,14.85,9365400,7.43 +2002-08-26,15.95,15.95,15.16,15.53,6784600,7.76 +2002-08-23,15.90,15.93,15.45,15.73,5830200,7.86 +2002-08-22,16.20,16.25,15.66,15.97,9225400,7.99 +2002-08-21,16.01,16.24,15.45,16.12,7229600,8.06 +2002-08-20,15.97,16.09,15.53,15.91,6665200,7.95 +2002-08-19,15.78,16.25,15.72,15.98,7734200,7.99 +2002-08-16,15.45,16.10,15.28,15.81,8758000,7.91 +2002-08-15,15.25,15.75,15.01,15.61,11502800,7.80 +2002-08-14,14.67,15.35,14.54,15.17,14253000,7.59 +2002-08-13,14.90,15.21,14.55,14.59,9638200,7.30 +2002-08-12,14.90,15.02,14.69,14.99,6420200,7.49 +2002-08-09,15.25,15.25,14.75,15.00,7347000,7.50 +2002-08-08,14.77,15.38,14.77,15.30,8119600,7.65 +2002-08-07,15.09,15.36,14.35,15.03,11909800,7.51 +2002-08-06,14.21,15.23,14.08,14.74,9716200,7.37 +2002-08-05,14.51,14.70,13.97,13.99,7286600,6.99 +2002-08-02,14.74,15.00,14.25,14.45,6395000,7.22 +2002-08-01,15.11,15.42,14.73,14.80,8177000,7.40 +2002-07-31,15.40,15.42,14.90,15.26,11096400,7.63 +2002-07-30,14.85,15.51,14.56,15.43,12672800,7.72 +2002-07-29,14.48,15.10,14.37,15.02,9820000,7.51 +2002-07-26,14.46,14.53,13.80,14.34,7418000,7.17 +2002-07-25,14.93,14.95,14.01,14.36,17119800,7.18 +2002-07-24,14.33,15.22,14.25,15.20,14521200,7.60 +2002-07-23,14.90,15.13,14.44,14.47,14281800,7.24 +2002-07-22,14.75,15.19,14.61,14.92,15389200,7.46 +2002-07-19,14.70,15.17,14.53,14.96,13757400,7.48 +2002-07-18,15.50,15.56,14.75,14.99,19980800,7.49 +2002-07-17,16.13,16.20,15.19,15.63,43410200,7.82 +2002-07-16,18.15,18.57,17.61,17.86,15956000,8.93 +2002-07-15,17.43,18.60,16.81,18.23,10571200,9.11 +2002-07-12,18.55,18.79,17.26,17.51,15839000,8.76 +2002-07-11,17.26,18.35,16.97,18.30,13345600,9.15 +2002-07-10,17.71,18.17,17.25,17.32,7388600,8.66 +2002-07-09,18.09,18.29,17.46,17.53,8098200,8.77 +2002-07-08,18.52,18.61,17.68,18.01,7543000,9.01 +2002-07-05,17.71,18.75,17.71,18.74,5773200,9.37 +2002-07-03,16.81,17.68,16.75,17.55,7108200,8.77 +2002-07-02,17.03,17.16,16.83,16.94,10899600,8.47 +2002-07-01,17.71,17.88,17.05,17.06,7953200,8.53 +2002-06-28,17.10,17.82,17.00,17.72,9637800,8.86 +2002-06-27,16.79,17.27,16.42,17.06,8987800,8.53 +2002-06-26,16.80,17.29,15.98,16.55,19962600,8.27 +2002-06-25,17.40,17.68,16.86,17.14,10757200,8.57 +2002-06-24,16.77,17.73,16.70,17.27,15426200,8.64 +2002-06-21,16.97,17.49,16.79,16.85,15899200,8.43 +2002-06-20,17.17,17.60,16.85,17.11,14165600,8.56 +2002-06-19,17.37,17.60,16.88,17.12,61052400,8.56 +2002-06-18,20.42,20.59,19.98,20.15,12620000,10.07 +2002-06-17,20.24,20.63,19.85,20.54,11593200,10.27 +2002-06-14,19.24,20.36,18.11,20.10,15175000,10.05 +2002-06-13,20.02,20.05,19.38,19.54,12574400,9.77 +2002-06-12,20.41,20.75,19.94,20.09,18882800,10.05 +2002-06-11,21.64,21.70,20.41,20.46,12482000,10.23 +2002-06-10,21.48,21.84,21.34,21.48,9913400,10.74 +2002-06-07,21.76,21.94,20.93,21.40,21870600,10.70 +2002-06-06,22.96,23.23,22.04,22.16,9285600,11.08 +2002-06-05,22.83,22.83,22.35,22.72,9895800,11.36 +2002-06-04,22.88,23.04,22.18,22.78,12422200,11.39 +2002-06-03,23.39,23.45,22.58,22.91,8396800,11.45 +2002-05-31,24.09,24.25,23.28,23.30,13053400,11.65 +2002-05-30,23.77,24.38,23.51,24.20,7013400,12.10 +2002-05-29,23.92,24.44,23.45,23.98,7921200,11.99 +2002-05-28,23.69,24.20,23.43,23.98,5347000,11.99 +2002-05-24,24.99,24.99,23.96,24.15,5934800,12.07 +2002-05-23,24.45,25.24,24.07,25.18,13192800,12.59 +2002-05-22,23.37,24.37,23.32,24.32,10388400,12.16 +2002-05-21,24.83,25.00,23.40,23.46,10035400,11.73 +2002-05-20,24.57,24.93,24.53,24.74,9639800,12.37 +2002-05-17,25.49,25.78,24.61,25.01,8446200,12.51 +2002-05-16,25.06,25.45,24.75,25.21,8109000,12.60 +2002-05-15,25.37,25.98,24.84,25.28,11993800,12.64 +2002-05-14,24.45,25.68,24.22,25.61,18803800,12.81 +2002-05-13,23.52,24.09,22.94,23.94,9486000,11.97 +2002-05-10,24.29,24.29,22.98,23.32,8407000,11.66 +2002-05-09,24.25,24.35,23.80,24.19,8022000,12.10 +2002-05-08,23.20,24.52,23.04,24.37,15595800,12.19 +2002-05-07,22.94,22.95,22.14,22.47,8669600,11.23 +2002-05-06,23.35,23.50,22.46,22.65,8916600,11.32 +2002-05-03,23.57,24.02,23.43,23.51,8242200,11.76 +2002-05-02,23.81,24.34,23.60,23.69,8548000,11.85 +2002-05-01,24.29,24.29,23.36,23.98,7668000,11.99 +2002-04-30,23.89,24.38,23.75,24.27,10034400,12.14 +2002-04-29,23.16,24.06,23.09,23.96,9724600,11.98 +2002-04-26,24.28,24.37,23.00,23.01,10892200,11.51 +2002-04-25,23.56,24.34,23.55,24.12,6935800,12.06 +2002-04-24,24.30,24.50,23.68,23.77,5016000,11.89 +2002-04-23,24.54,24.78,24.09,24.25,8338200,12.12 +2002-04-22,24.84,24.93,24.23,24.53,9622400,12.27 +2002-04-19,25.49,25.49,24.93,24.98,13407400,12.49 +2002-04-18,25.50,25.52,24.88,25.41,14346800,12.70 +2002-04-17,25.93,26.17,25.38,26.11,14151800,13.06 +2002-04-16,25.15,25.99,25.12,25.74,21949200,12.87 +2002-04-15,25.06,25.15,24.80,25.00,10691800,12.50 +2002-04-12,25.01,25.17,24.57,25.06,11437200,12.53 +2002-04-11,25.03,25.20,24.75,24.86,14544800,12.43 +2002-04-10,24.21,24.95,24.01,24.66,8035000,12.33 +2002-04-09,24.59,25.00,24.01,24.10,6840400,12.05 +2002-04-08,24.16,24.68,23.78,24.56,9339800,12.28 +2002-04-05,24.95,25.19,24.10,24.74,9941000,12.37 +2002-04-04,23.67,25.05,23.67,24.90,12089200,12.45 +2002-04-03,24.05,24.49,23.60,23.75,7661800,11.88 +2002-04-02,24.00,24.30,23.87,24.07,7278400,12.03 +2002-04-01,23.38,24.70,23.28,24.46,7108800,12.23 +2002-03-28,23.70,23.88,23.46,23.67,3873400,11.84 +2002-03-27,23.35,23.72,23.26,23.47,4560800,11.73 +2002-03-26,23.20,23.64,23.00,23.46,9208600,11.73 +2002-03-25,24.07,24.09,23.24,23.35,9386800,11.68 +2002-03-22,24.22,24.56,23.87,24.09,7221200,12.05 +2002-03-21,23.86,24.30,23.26,24.27,22012600,12.14 +2002-03-20,24.66,25.14,24.50,24.92,10511400,12.46 +2002-03-19,24.69,25.30,24.30,24.85,8655200,12.43 +2002-03-18,24.95,25.05,24.32,24.74,10877000,12.37 +2002-03-15,24.46,24.96,24.25,24.95,8603600,12.48 +2002-03-14,24.30,24.60,23.87,24.43,7760600,12.22 +2002-03-13,24.37,24.85,24.15,24.49,7170200,12.24 +2002-03-12,24.51,24.74,24.10,24.72,9073400,12.36 +2002-03-11,24.60,25.14,24.10,25.06,9385200,12.53 +2002-03-08,24.74,25.09,24.30,24.66,9634800,12.33 +2002-03-07,24.06,24.53,23.61,24.38,9223200,12.19 +2002-03-06,23.48,24.34,22.93,24.07,8078800,12.03 +2002-03-05,24.15,24.43,23.40,23.53,9810800,11.77 +2002-03-04,23.26,24.58,22.76,24.29,12437800,12.15 +2002-03-01,21.93,23.50,21.82,23.45,12464000,11.73 +2002-02-28,22.15,22.59,21.35,21.70,16319200,10.85 +2002-02-27,23.94,24.25,20.94,21.96,36791400,10.98 +2002-02-26,23.91,24.37,23.25,23.67,9290400,11.84 +2002-02-25,22.85,24.72,22.36,23.81,15244600,11.90 +2002-02-22,21.66,22.95,21.50,22.74,14517000,11.37 +2002-02-21,22.92,23.00,21.45,21.50,15955400,10.75 +2002-02-20,22.77,23.20,22.35,23.13,10194400,11.56 +2002-02-19,23.76,23.87,22.48,22.62,13937800,11.31 +2002-02-15,24.53,24.98,23.85,23.90,9292400,11.95 +2002-02-14,25.05,25.23,24.38,24.60,9291800,12.30 +2002-02-13,24.73,25.24,24.65,25.01,11174000,12.51 +2002-02-12,24.66,25.04,24.45,24.71,8010000,12.35 +2002-02-11,23.93,25.00,23.74,24.98,14235800,12.49 +2002-02-08,24.40,24.64,23.37,24.03,12690400,12.02 +2002-02-07,24.65,25.29,24.08,24.30,12422600,12.15 +2002-02-06,25.60,25.98,24.15,24.67,21342000,12.34 +2002-02-05,25.09,25.98,25.08,25.45,16317400,12.73 +2002-02-04,24.32,25.52,24.20,25.35,18656200,12.68 +2002-02-01,24.34,24.96,24.34,24.41,14225200,12.20 +2002-01-31,24.16,24.73,24.11,24.72,16730200,12.36 +2002-01-30,23.07,24.14,22.94,24.09,16842000,12.05 +2002-01-29,23.22,23.54,22.85,23.07,8583000,11.53 +2002-01-28,23.40,23.55,22.72,23.27,6658800,11.64 +2002-01-25,22.89,23.42,22.66,23.25,6639800,11.62 +2002-01-24,22.91,23.51,22.90,23.21,12285800,11.60 +2002-01-23,21.80,23.04,21.59,23.02,15831400,11.51 +2002-01-22,22.27,22.37,21.82,21.82,11689800,10.91 +2002-01-18,22.00,22.60,21.96,22.17,12100400,11.09 +2002-01-17,21.96,22.74,21.87,22.48,23592000,11.24 +2002-01-16,21.41,21.41,20.50,20.78,20246200,10.39 +2002-01-15,21.32,21.76,21.21,21.70,10368600,10.85 +2002-01-14,21.01,21.40,20.90,21.15,14857000,10.57 +2002-01-11,21.39,21.84,20.60,21.05,12457200,10.52 +2002-01-10,21.22,21.46,20.25,21.23,16169200,10.61 +2002-01-09,22.80,22.93,21.28,21.65,11708400,10.82 +2002-01-08,22.75,23.05,22.46,22.61,16072800,11.31 +2002-01-07,23.72,24.00,22.75,22.90,15878000,11.45 +2002-01-04,23.34,23.95,22.99,23.69,14642000,11.85 +2002-01-03,23.00,23.75,22.77,23.58,21857400,11.79 +2002-01-02,22.05,23.30,21.96,23.30,18910600,11.65 +2001-12-31,22.51,22.66,21.83,21.90,4920800,10.95 +2001-12-28,21.97,23.00,21.96,22.43,10683000,11.22 +2001-12-27,21.58,22.25,21.58,22.07,6839600,11.03 +2001-12-26,21.35,22.30,21.14,21.49,5228600,10.74 +2001-12-24,20.90,21.45,20.90,21.36,1808200,10.68 +2001-12-21,21.01,21.54,20.80,21.00,9154800,10.50 +2001-12-20,21.40,21.47,20.62,20.67,7888000,10.34 +2001-12-19,20.58,21.68,20.47,21.62,10355600,10.81 +2001-12-18,20.89,21.33,20.22,21.01,8401400,10.51 +2001-12-17,20.40,21.00,20.19,20.62,6204000,10.31 +2001-12-14,20.73,20.83,20.09,20.39,6781600,10.19 +2001-12-13,21.49,21.55,20.50,21.00,7065800,10.50 +2001-12-12,21.87,21.92,21.25,21.49,6873600,10.74 +2001-12-11,22.67,22.85,21.65,21.78,7338400,10.89 +2001-12-10,22.29,22.99,22.23,22.54,6071800,11.27 +2001-12-07,22.46,22.71,22.00,22.54,7268400,11.27 +2001-12-06,23.48,23.50,22.14,22.78,12104800,11.39 +2001-12-05,22.36,24.03,22.17,23.76,20306400,11.88 +2001-12-04,21.05,22.56,20.72,22.40,13586400,11.20 +2001-12-03,21.06,21.28,20.60,21.05,6470200,10.52 +2001-11-30,20.47,21.44,20.25,21.30,10854000,10.65 +2001-11-29,20.60,20.70,20.19,20.42,7241600,10.21 +2001-11-28,20.85,21.21,20.41,20.53,8950400,10.27 +2001-11-27,21.20,21.52,20.50,21.00,9591200,10.50 +2001-11-26,19.94,21.55,19.88,21.37,16453200,10.69 +2001-11-23,19.71,19.95,19.57,19.84,2143000,9.92 +2001-11-21,19.61,19.80,19.26,19.68,7199400,9.84 +2001-11-20,19.82,20.20,19.50,19.53,9878000,9.77 +2001-11-19,19.00,20.05,18.96,20.00,11878200,10.00 +2001-11-16,19.27,19.29,18.40,18.97,8238000,9.48 +2001-11-15,19.45,19.90,19.23,19.45,7608200,9.73 +2001-11-14,19.59,19.90,19.15,19.61,7898200,9.81 +2001-11-13,19.08,19.39,18.71,19.37,8024000,9.69 +2001-11-12,18.66,19.17,17.96,18.75,7196400,9.38 +2001-11-09,18.60,19.25,18.55,18.71,4796200,9.35 +2001-11-08,19.63,19.89,18.57,18.71,12219400,9.35 +2001-11-07,19.46,20.13,19.33,19.59,13678200,9.80 +2001-11-06,18.96,19.62,18.53,19.57,11286400,9.78 +2001-11-05,18.84,19.25,18.61,19.07,8421200,9.53 +2001-11-02,18.52,18.86,18.16,18.57,7043000,9.28 +2001-11-01,17.65,18.78,17.25,18.59,11178400,9.30 +2001-10-31,17.73,18.40,17.44,17.56,9776800,8.78 +2001-10-30,17.38,18.00,17.06,17.60,9884400,8.80 +2001-10-29,18.57,18.67,17.60,17.63,8542200,8.81 +2001-10-26,18.86,19.25,18.62,18.67,9963000,9.34 +2001-10-25,18.44,19.25,18.16,19.19,9105400,9.60 +2001-10-24,18.06,19.09,17.75,18.95,13372400,9.48 +2001-10-23,19.12,19.42,17.87,18.14,24463600,9.07 +2001-10-22,18.21,19.07,18.09,19.02,13997800,9.51 +2001-10-19,17.94,18.40,17.88,18.30,5956800,9.15 +2001-10-18,17.29,18.23,17.29,18.00,21877600,9.00 +2001-10-17,18.34,18.41,16.96,16.99,10197800,8.49 +2001-10-16,18.09,18.20,17.77,18.01,7248200,9.01 +2001-10-15,17.95,18.38,17.95,17.99,11384000,8.99 +2001-10-12,17.31,18.08,16.86,18.01,10279000,9.01 +2001-10-11,16.92,17.74,16.85,17.74,11934400,8.87 +2001-10-10,16.10,16.85,15.95,16.82,10991400,8.41 +2001-10-09,16.05,16.20,15.63,16.00,6215200,8.00 +2001-10-08,15.57,16.35,15.50,16.20,7428000,8.10 +2001-10-05,15.40,16.15,14.99,16.14,12238800,8.07 +2001-10-04,15.35,16.25,14.99,15.88,14325800,7.94 +2001-10-03,14.95,15.36,14.83,14.98,24394400,7.49 +2001-10-02,15.43,15.83,14.88,15.05,8424400,7.53 +2001-10-01,15.49,15.99,15.23,15.54,7436000,7.77 +2001-09-28,15.71,15.91,15.39,15.51,13039600,7.76 +2001-09-27,15.25,15.75,15.20,15.51,11508600,7.76 +2001-09-26,15.81,15.89,14.93,15.15,17635600,7.57 +2001-09-25,16.14,16.22,15.35,15.54,13371600,7.77 +2001-09-24,16.11,16.84,15.95,16.45,10519200,8.23 +2001-09-21,14.80,16.25,14.68,15.73,20375600,7.86 +2001-09-20,16.29,16.95,15.50,15.68,14684800,7.84 +2001-09-19,16.50,17.10,15.60,17.02,13332800,8.51 +2001-09-18,16.90,17.72,16.17,16.28,11682200,8.14 +2001-09-17,16.00,17.07,15.73,16.99,16357400,8.49 +2001-09-10,17.00,17.50,16.92,17.37,11030200,8.69 +2001-09-07,17.50,18.10,17.20,17.28,8636800,8.64 +2001-09-06,18.40,18.93,17.65,17.72,10084600,8.86 +2001-09-05,18.24,18.95,18.12,18.55,12859200,9.27 +2001-09-04,18.50,19.08,18.18,18.25,12436200,9.12 +2001-08-31,17.73,18.60,17.65,18.55,7746600,9.27 +2001-08-30,17.74,18.18,17.28,17.83,13167600,8.91 +2001-08-29,18.44,18.83,17.83,17.83,8570400,8.91 +2001-08-28,18.90,19.14,18.40,18.40,6133400,9.20 +2001-08-27,18.60,19.30,18.16,18.92,6273000,9.46 +2001-08-24,18.00,18.62,17.65,18.57,10369000,9.28 +2001-08-23,18.20,18.34,17.58,17.81,7752800,8.90 +2001-08-22,17.94,18.25,17.61,18.21,6213400,9.10 +2001-08-21,18.14,18.14,17.70,17.92,6632200,8.96 +2001-08-20,18.14,18.23,17.81,18.12,9010800,9.06 +2001-08-17,18.00,18.45,17.99,18.07,7443800,9.03 +2001-08-16,18.27,18.75,17.97,18.65,10289000,9.32 +2001-08-15,18.76,18.94,18.20,18.44,10331400,9.22 +2001-08-14,19.20,19.36,18.67,18.73,8176800,9.36 +2001-08-13,19.10,19.33,18.76,19.09,5285600,9.55 +2001-08-10,19.04,19.32,18.59,19.02,6677200,9.51 +2001-08-09,18.96,19.15,18.72,19.05,7166600,9.52 +2001-08-08,19.26,19.70,18.54,18.90,9863200,9.45 +2001-08-07,19.33,19.67,18.98,19.25,6019600,9.62 +2001-08-06,19.04,19.66,19.00,19.13,3559000,9.56 +2001-08-03,19.89,19.90,19.00,19.50,6644800,9.75 +2001-08-02,19.65,19.87,19.26,19.82,9003200,9.91 +2001-08-01,19.01,19.78,18.95,19.06,10862000,9.53 +2001-07-31,19.27,19.42,18.51,18.79,8393800,9.40 +2001-07-30,19.12,19.36,18.51,18.93,8691400,9.47 +2001-07-27,18.75,19.25,18.50,18.96,11933400,9.48 +2001-07-26,18.48,18.80,17.85,18.59,13183600,9.30 +2001-07-25,19.12,19.30,17.97,18.47,15852800,9.23 +2001-07-24,19.39,19.92,18.73,19.09,12442000,9.55 +2001-07-23,20.09,20.50,19.51,19.54,8620000,9.77 +2001-07-20,19.70,20.06,19.49,19.98,15878000,9.99 +2001-07-19,21.23,21.42,19.75,19.96,30755000,9.98 +2001-07-18,21.78,22.78,20.42,20.79,40607600,10.40 +2001-07-17,23.98,25.22,23.01,25.10,23136800,12.55 +2001-07-16,24.88,25.10,23.91,23.96,9952400,11.98 +2001-07-13,24.13,25.01,23.84,24.85,16240800,12.43 +2001-07-12,23.30,24.81,23.30,24.36,21957200,12.18 +2001-07-11,21.03,22.55,21.00,22.54,16803800,11.27 +2001-07-10,22.95,23.07,20.84,21.14,14116800,10.57 +2001-07-09,22.09,23.00,21.68,22.70,12052400,11.35 +2001-07-06,22.76,22.96,21.72,22.03,10818600,11.02 +2001-07-05,23.60,23.77,23.01,23.19,5439000,11.60 +2001-07-03,23.51,24.18,23.50,23.84,4019400,11.92 +2001-07-02,23.64,24.23,23.14,23.90,8216000,11.95 +2001-06-29,23.66,25.10,23.20,23.25,18406800,11.62 +2001-06-28,23.05,23.91,22.94,23.54,12443200,11.77 +2001-06-27,23.83,24.00,22.50,23.34,13361800,11.67 +2001-06-26,23.34,23.77,23.01,23.75,9742200,11.88 +2001-06-25,22.50,24.00,22.45,23.99,15698200,11.99 +2001-06-22,22.48,23.00,21.76,22.26,10215200,11.13 +2001-06-21,21.55,23.00,21.10,22.49,12190400,11.24 +2001-06-20,20.00,21.85,19.98,21.67,15415000,10.84 +2001-06-19,20.85,21.40,20.01,20.19,11467400,10.10 +2001-06-18,20.41,20.85,20.00,20.33,12354000,10.16 +2001-06-15,20.10,20.75,19.35,20.44,16236600,10.22 +2001-06-14,20.04,20.45,19.77,19.88,10619600,9.94 +2001-06-13,21.42,21.73,20.06,20.47,18267400,10.23 +2001-06-12,19.77,20.69,19.76,20.31,10849800,10.15 +2001-06-11,21.05,21.07,19.95,20.04,10500000,10.02 +2001-06-08,21.65,21.65,20.71,21.32,12236600,10.66 +2001-06-07,20.71,21.70,20.45,21.66,11613600,10.83 +2001-06-06,20.93,20.93,20.33,20.73,7970600,10.36 +2001-06-05,20.80,21.10,20.35,20.94,16849800,10.47 +2001-06-04,21.08,21.11,20.46,20.66,10068600,10.33 +2001-06-01,20.13,21.09,19.98,20.89,16288400,10.44 +2001-05-31,19.80,20.24,19.49,19.95,15817600,9.98 +2001-05-30,20.76,20.76,19.30,19.78,27752800,9.89 +2001-05-29,22.32,22.50,20.81,21.47,18428200,10.73 +2001-05-25,23.20,23.29,22.50,22.76,5669400,11.38 +2001-05-24,23.29,23.30,22.62,23.20,9705600,11.60 +2001-05-23,23.75,23.75,22.86,23.23,10037200,11.61 +2001-05-22,24.00,24.13,23.40,23.50,14747000,11.75 +2001-05-21,23.63,23.91,23.05,23.56,16464200,11.78 +2001-05-18,23.36,23.64,23.12,23.53,5680400,11.77 +2001-05-17,24.23,24.33,23.25,23.55,11861400,11.77 +2001-05-16,23.26,24.50,22.85,24.10,11511800,12.05 +2001-05-15,23.37,25.50,23.04,23.18,8465200,11.59 +2001-05-14,22.89,23.68,22.75,23.29,11043600,11.65 +2001-05-11,23.01,23.49,22.76,22.85,7251600,11.43 +2001-05-10,24.21,24.50,22.95,23.00,10320600,11.50 +2001-05-09,24.14,24.55,23.67,23.98,11603200,11.99 +2001-05-08,25.35,25.45,23.95,24.57,11265600,12.28 +2001-05-07,25.62,25.76,24.84,24.96,9876800,12.48 +2001-05-04,24.24,25.85,23.96,25.75,10037600,12.88 +2001-05-03,25.97,26.25,24.73,24.96,10769400,12.48 +2001-05-02,26.34,26.70,25.76,26.59,13161600,13.30 +2001-05-01,25.41,26.50,25.20,25.93,15259000,12.97 +2001-04-30,26.70,27.12,24.87,25.49,17670600,12.74 +2001-04-27,25.20,26.29,24.75,26.20,16179000,13.10 +2001-04-26,25.17,26.10,24.68,24.69,28560600,12.35 +2001-04-25,24.21,24.86,23.57,24.72,11813600,12.36 +2001-04-24,24.33,24.75,23.51,24.03,13469200,12.02 +2001-04-23,24.34,25.00,24.00,24.25,19340200,12.12 +2001-04-20,24.93,25.63,24.60,25.04,24764400,12.52 +2001-04-19,25.55,25.75,23.60,25.72,66916800,12.86 +2001-04-18,21.57,24.08,21.08,22.79,39315800,11.40 +2001-04-17,21.20,21.21,19.60,20.40,24471400,10.20 +2001-04-16,22.09,22.40,20.86,21.44,10186600,10.72 +2001-04-12,21.42,23.02,21.15,22.42,10676200,11.21 +2001-04-11,22.98,23.00,21.28,21.80,11932000,10.90 +2001-04-10,20.90,22.70,20.78,22.04,16334800,11.02 +2001-04-09,20.69,21.34,20.06,20.54,9520800,10.27 +2001-04-06,20.80,21.04,19.90,20.59,11603200,10.30 +2001-04-05,20.60,22.50,20.00,20.87,15955800,10.44 +2001-04-04,19.76,20.25,18.75,19.50,24481600,9.75 +2001-04-03,21.36,21.40,20.13,20.24,13167400,10.12 +2001-04-02,22.09,22.66,21.40,21.59,12175400,10.80 +2001-03-30,22.55,22.72,21.34,22.07,14298200,11.03 +2001-03-29,21.77,23.45,21.50,22.53,21895200,11.27 +2001-03-28,22.08,22.50,21.50,22.17,20880800,11.09 +2001-03-27,21.94,23.05,21.90,22.87,19422200,11.44 +2001-03-26,23.13,23.75,21.13,21.78,26230400,10.89 +2001-03-23,22.06,23.56,22.00,23.00,33749400,11.50 +2001-03-22,20.37,21.75,20.19,21.62,25839000,10.81 +2001-03-21,19.78,20.87,19.37,20.12,13265400,10.06 +2001-03-20,20.72,20.94,19.69,19.69,17833800,9.85 +2001-03-19,19.75,20.62,19.50,20.56,12722800,10.28 +2001-03-16,19.00,20.31,18.87,19.62,16806600,9.81 +2001-03-15,20.87,21.37,19.69,19.69,18906600,9.85 +2001-03-14,18.50,20.50,18.44,20.44,17065400,10.22 +2001-03-13,18.87,19.56,18.19,19.56,15840600,9.78 +2001-03-12,19.69,19.87,18.12,18.62,13967800,9.31 +2001-03-09,20.62,20.69,20.00,20.25,10685400,10.12 +2001-03-08,20.69,21.12,20.44,20.81,7325600,10.40 +2001-03-07,21.31,21.62,20.75,21.25,14985600,10.62 +2001-03-06,20.72,22.06,20.69,21.50,26144600,10.75 +2001-03-05,19.37,20.50,19.25,20.37,11587600,10.19 +2001-03-02,18.31,20.44,18.25,19.25,14511200,9.62 +2001-03-01,17.81,18.75,17.19,18.75,11803400,9.38 +2001-02-28,19.37,19.44,18.12,18.25,18157600,9.12 +2001-02-27,19.28,19.44,18.69,19.37,12451000,9.69 +2001-02-26,19.06,19.69,18.56,19.50,7380000,9.75 +2001-02-23,18.62,18.87,18.25,18.81,10503800,9.40 +2001-02-22,19.06,19.37,18.00,18.81,15431200,9.40 +2001-02-21,18.25,19.94,18.25,18.87,13947800,9.44 +2001-02-20,19.19,19.44,18.19,18.31,11249600,9.15 +2001-02-16,19.00,19.50,18.75,19.00,9428400,9.50 +2001-02-15,19.69,20.56,19.69,20.06,11123200,10.03 +2001-02-14,19.19,19.62,18.50,19.50,11040000,9.75 +2001-02-13,19.94,20.44,19.00,19.12,8470600,9.56 +2001-02-12,19.06,20.00,18.81,19.69,9795600,9.85 +2001-02-09,20.50,20.81,18.69,19.12,21082600,9.56 +2001-02-08,20.56,21.06,20.19,20.75,21585000,10.38 +2001-02-07,20.66,20.87,19.81,20.75,14071600,10.38 +2001-02-06,20.16,21.39,20.00,21.12,16528400,10.56 +2001-02-05,20.50,20.56,19.75,20.19,10228800,10.10 +2001-02-02,21.12,21.94,20.50,20.62,15263400,10.31 +2001-02-01,20.69,21.50,20.50,21.12,13205400,10.56 +2001-01-31,21.50,22.50,21.44,21.62,26106000,10.81 +2001-01-30,21.56,22.00,20.87,21.75,24734600,10.88 +2001-01-29,19.56,21.75,19.56,21.69,30562800,10.85 +2001-01-26,19.50,19.81,19.06,19.56,17245600,9.78 +2001-01-25,20.56,20.56,19.75,19.94,17495000,9.97 +2001-01-24,20.62,20.69,19.56,20.50,25616200,10.25 +2001-01-23,19.31,20.94,19.06,20.50,31418400,10.25 +2001-01-22,19.06,19.62,18.44,19.25,18551600,9.62 +2001-01-19,19.44,19.56,18.69,19.50,27748200,9.75 +2001-01-18,17.81,18.75,17.62,18.69,43822800,9.35 +2001-01-17,17.56,17.56,16.50,16.81,30037600,8.40 +2001-01-16,17.44,18.25,17.00,17.12,10940000,8.56 +2001-01-12,17.87,18.00,17.06,17.19,15121000,8.60 +2001-01-11,16.25,18.50,16.25,18.00,28707600,9.00 +2001-01-10,16.69,17.00,16.06,16.56,20743400,8.28 +2001-01-09,16.81,17.64,16.56,17.19,21040600,8.60 +2001-01-08,16.94,16.98,15.94,16.56,13350000,8.28 +2001-01-05,16.94,17.37,16.06,16.37,14731000,8.19 +2001-01-04,18.14,18.50,16.81,17.06,26411000,8.53 +2001-01-03,14.50,16.69,14.44,16.37,29181800,8.19 +2001-01-02,14.88,15.25,14.56,14.88,16161800,7.44 +2000-12-29,14.69,15.00,14.50,14.88,22518800,7.44 +2000-12-28,14.38,14.94,14.31,14.81,10910000,7.41 +2000-12-27,14.34,14.81,14.19,14.81,11626000,7.41 +2000-12-26,14.88,15.00,14.25,14.69,7745400,7.34 +2000-12-22,14.13,15.00,14.13,15.00,11369600,7.50 +2000-12-21,14.25,15.00,13.88,14.06,13102600,7.03 +2000-12-20,13.78,14.63,13.63,14.38,20196200,7.19 +2000-12-19,14.38,15.25,14.00,14.00,13367200,7.00 +2000-12-18,14.56,14.63,13.94,14.25,11645000,7.12 +2000-12-15,14.56,14.69,14.00,14.06,18363800,7.03 +2000-12-14,15.03,15.25,14.44,14.44,9406600,7.22 +2000-12-13,15.56,15.56,14.88,15.00,12327200,7.50 +2000-12-12,15.25,16.00,15.00,15.38,13803400,7.69 +2000-12-11,15.19,15.38,14.88,15.19,11884000,7.59 +2000-12-08,14.81,15.31,14.44,15.06,15568200,7.53 +2000-12-07,14.44,14.88,14.00,14.31,14606600,7.16 +2000-12-06,14.63,15.00,14.00,14.31,49092400,7.16 +2000-12-05,16.94,17.44,16.37,17.00,21932200,8.50 +2000-12-04,17.19,17.19,16.44,16.69,13273400,8.35 +2000-12-01,17.00,17.50,16.81,17.06,13783800,8.53 +2000-11-30,16.69,17.00,16.12,16.50,28922200,8.25 +2000-11-29,18.09,18.31,17.25,17.56,17586200,8.78 +2000-11-28,18.69,19.00,17.94,18.03,9618200,9.02 +2000-11-27,19.87,19.94,18.50,18.69,9244000,9.35 +2000-11-24,18.86,19.50,18.81,19.31,5751800,9.65 +2000-11-22,18.81,19.12,18.37,18.50,10029600,9.25 +2000-11-21,19.19,19.50,18.75,18.81,10786200,9.40 +2000-11-20,18.59,19.50,18.25,18.94,14581600,9.47 +2000-11-17,19.19,19.25,18.25,18.50,15943400,9.25 +2000-11-16,19.50,19.81,18.87,19.00,8554000,9.50 +2000-11-15,20.03,20.19,19.25,19.87,10086600,9.94 +2000-11-14,19.94,20.50,19.56,20.25,14611200,10.12 +2000-11-13,18.75,20.00,18.25,19.37,15423200,9.69 +2000-11-10,19.36,19.87,19.06,19.06,15080600,9.53 +2000-11-09,19.87,20.50,19.06,20.19,17035400,10.10 +2000-11-08,21.37,21.44,19.81,20.06,15082800,10.03 +2000-11-07,21.50,21.81,20.81,21.31,10786800,10.65 +2000-11-06,22.44,22.62,20.87,21.44,14060000,10.72 +2000-11-03,23.00,23.00,21.94,22.25,18423400,11.12 +2000-11-02,21.12,22.44,21.06,22.31,21105400,11.15 +2000-11-01,19.44,20.87,19.44,20.50,20553800,10.25 +2000-10-31,19.75,20.25,19.25,19.56,31649000,9.78 +2000-10-30,19.12,19.94,18.75,19.31,22832800,9.65 +2000-10-27,18.87,19.19,17.87,18.56,26594600,9.28 +2000-10-26,18.81,18.87,17.50,18.50,25780600,9.25 +2000-10-25,19.06,19.19,18.44,18.50,23720600,9.25 +2000-10-24,20.69,20.87,18.81,18.87,28736200,9.44 +2000-10-23,20.27,20.56,19.44,20.37,19694000,10.19 +2000-10-20,19.06,20.37,18.94,19.50,28270400,9.75 +2000-10-19,19.16,19.81,18.31,18.94,53818200,9.47 +2000-10-18,19.44,21.06,18.75,20.12,29803800,10.06 +2000-10-17,21.69,21.94,19.69,20.12,21495600,10.06 +2000-10-16,22.31,23.25,21.37,21.50,29298800,10.75 +2000-10-13,20.25,22.12,20.00,22.06,44564000,11.03 +2000-10-12,20.31,20.81,19.50,20.00,42548200,10.00 +2000-10-11,20.12,21.00,19.12,19.62,42801200,9.81 +2000-10-10,21.62,22.44,20.50,20.87,24683400,10.44 +2000-10-09,22.62,22.87,21.12,21.75,21342600,10.88 +2000-10-06,22.69,22.94,21.00,22.19,21881000,11.10 +2000-10-05,23.50,24.50,22.00,22.06,31189400,11.03 +2000-10-04,22.37,23.75,21.87,23.62,52368200,11.81 +2000-10-03,24.94,25.00,22.19,22.31,72795600,11.15 +2000-10-02,26.69,26.75,23.50,24.25,86610600,12.12 +2000-09-29,28.19,29.00,25.37,25.75,265069000,12.88 +2000-09-28,49.31,53.81,48.13,53.50,34988200,26.75 +2000-09-27,51.75,52.75,48.25,48.94,14370000,24.47 +2000-09-26,53.31,54.75,51.38,51.44,10396600,25.72 +2000-09-25,52.75,55.50,52.06,53.50,15564000,26.75 +2000-09-22,50.31,52.44,50.00,52.19,25961200,26.09 +2000-09-21,58.50,59.63,55.25,56.69,18238400,28.34 +2000-09-20,59.41,61.44,58.56,61.05,8121600,30.52 +2000-09-19,59.75,60.50,58.56,59.94,9706200,29.97 +2000-09-18,55.25,60.75,55.06,60.66,15163200,30.33 +2000-09-15,57.75,58.19,54.25,55.23,14095400,27.61 +2000-09-14,58.56,59.63,56.81,56.86,15241800,28.43 +2000-09-13,56.75,59.50,56.75,58.00,10932600,29.00 +2000-09-12,57.34,60.06,57.00,57.75,6722200,28.88 +2000-09-11,58.69,60.38,58.13,58.44,6699000,29.22 +2000-09-08,61.63,61.63,58.50,58.88,6984400,29.44 +2000-09-07,59.13,62.56,58.25,62.00,7770400,31.00 +2000-09-06,61.38,62.38,57.75,58.44,12700400,29.22 +2000-09-05,62.66,64.12,62.25,62.44,10669000,31.22 +2000-09-01,61.31,63.63,61.13,63.44,9181800,31.72 +2000-08-31,58.97,61.50,58.94,60.94,14988800,30.47 +2000-08-30,59.00,60.00,58.70,59.50,10199600,29.75 +2000-08-29,57.88,59.44,57.69,59.19,9546200,29.59 +2000-08-28,57.25,59.00,57.06,58.06,12822600,29.03 +2000-08-25,56.50,57.50,56.38,56.81,11947800,28.41 +2000-08-24,54.67,56.63,53.38,56.11,11109400,28.06 +2000-08-23,51.47,54.75,51.06,54.31,8470400,27.16 +2000-08-22,50.63,52.81,50.38,51.69,9889000,25.84 +2000-08-21,50.25,51.56,49.63,50.50,4803800,25.25 +2000-08-18,51.38,51.81,49.88,50.00,6798800,25.00 +2000-08-17,48.38,52.44,48.31,51.44,9683400,25.72 +2000-08-16,46.88,49.00,46.81,48.50,5137600,24.25 +2000-08-15,47.25,47.94,46.50,46.69,4089000,23.34 +2000-08-14,47.59,47.69,46.31,47.06,5603400,23.53 +2000-08-11,46.84,48.00,45.56,47.69,8503200,23.84 +2000-08-10,48.00,48.44,47.38,47.56,8995400,23.78 +2000-08-09,48.13,48.44,47.25,47.50,13569000,23.75 +2000-08-08,47.94,48.00,46.31,46.75,6315400,23.38 +2000-08-07,47.88,49.06,47.19,47.94,6697200,23.97 +2000-08-04,49.47,51.25,46.31,47.38,9406800,23.69 +2000-08-03,45.56,48.06,44.25,48.00,12150000,24.00 +2000-08-02,49.00,49.94,47.19,47.25,5808800,23.62 +2000-08-01,50.31,51.16,49.25,49.31,4904600,24.66 +2000-07-31,49.16,51.63,48.75,50.81,5550000,25.41 +2000-07-28,52.28,52.50,46.88,48.31,8505400,24.16 +2000-07-27,50.00,53.25,49.88,52.00,10543800,26.00 +2000-07-26,49.84,51.25,49.25,50.06,7526200,25.03 +2000-07-25,50.31,50.63,49.06,50.06,7567200,25.03 +2000-07-24,52.56,52.88,47.50,48.69,14720600,24.34 +2000-07-21,54.36,55.63,52.94,53.56,7013200,26.78 +2000-07-20,55.00,57.06,54.13,55.13,16631800,27.57 +2000-07-19,55.19,56.81,51.75,52.69,16359600,26.34 +2000-07-18,58.50,58.88,56.88,57.25,11378200,28.62 +2000-07-17,58.25,58.81,57.13,58.31,9289000,29.16 +2000-07-14,57.13,59.00,56.88,57.69,6804400,28.84 +2000-07-13,58.50,60.63,54.75,56.50,15925600,28.25 +2000-07-12,58.13,58.94,56.38,58.88,8057600,29.44 +2000-07-11,57.00,59.25,55.44,56.94,12783200,28.47 +2000-07-10,54.09,58.25,53.75,57.13,14211000,28.57 +2000-07-07,52.59,54.81,52.13,54.44,9422600,27.22 +2000-07-06,52.50,52.94,49.63,51.81,11063800,25.91 +2000-07-05,53.25,55.19,50.75,51.63,9478800,25.82 +2000-07-03,52.13,54.31,52.13,53.31,2535000,26.66 +2000-06-30,52.81,54.94,51.69,52.38,11550000,26.19 +2000-06-29,53.06,53.94,51.06,51.25,7281200,25.62 +2000-06-28,53.31,55.38,51.50,54.44,10235000,27.22 +2000-06-27,53.78,55.50,51.63,51.75,7270600,25.88 +2000-06-26,52.50,54.75,52.13,54.13,6631000,27.07 +2000-06-23,53.78,54.63,50.81,51.69,7320400,25.84 +2000-06-22,55.75,57.63,53.56,53.75,16706200,26.88 +2000-06-21,50.50,56.94,50.31,55.63,17500000,27.82 +2000-06-20,98.50,103.94,98.37,101.25,17922000,25.31 +2000-06-19,90.56,97.87,89.81,96.62,14089200,24.16 +2000-06-16,93.50,93.75,89.06,91.19,10842400,22.80 +2000-06-15,91.25,93.37,89.00,92.37,8898800,23.09 +2000-06-14,94.69,96.25,90.12,90.44,9925200,22.61 +2000-06-13,91.19,94.69,88.19,94.50,12570000,23.62 +2000-06-12,96.37,96.44,90.87,91.19,10374400,22.80 +2000-06-09,96.75,97.94,94.37,95.75,9020000,23.94 +2000-06-08,97.62,98.50,93.12,94.81,8540800,23.70 +2000-06-07,93.62,97.00,91.62,96.56,12056800,24.14 +2000-06-06,91.97,96.75,90.31,92.87,18771200,23.22 +2000-06-05,93.31,95.25,89.69,91.31,11582000,22.83 +2000-06-02,93.75,99.75,89.00,92.56,28336400,23.14 +2000-06-01,81.75,89.56,80.37,89.12,32280000,22.28 +2000-05-31,86.87,91.25,83.81,84.00,15483600,21.00 +2000-05-30,87.62,88.12,81.75,87.56,25481200,21.89 +2000-05-26,88.00,89.87,85.25,86.37,6486400,21.59 +2000-05-25,88.50,92.66,86.00,87.27,14530800,21.82 +2000-05-24,86.19,89.75,83.00,87.69,24248000,21.92 +2000-05-23,90.50,93.37,85.62,85.81,18488000,21.45 +2000-05-22,93.75,93.75,86.00,89.94,26995200,22.49 +2000-05-19,99.25,99.25,93.37,94.00,26459200,23.50 +2000-05-18,103.00,104.94,100.62,100.75,13365600,25.19 +2000-05-17,103.62,103.69,100.37,101.37,14227600,25.34 +2000-05-16,104.52,109.06,102.75,105.69,15736400,26.42 +2000-05-15,108.06,108.06,100.12,101.00,24252000,25.25 +2000-05-12,106.00,110.50,104.77,107.62,10962000,26.91 +2000-05-11,101.37,104.25,99.00,102.81,17852400,25.70 +2000-05-10,104.06,105.00,98.75,99.31,19127600,24.83 +2000-05-09,110.31,111.25,104.87,105.44,11685600,26.36 +2000-05-08,112.09,113.69,110.00,110.12,6605600,27.53 +2000-05-05,110.81,114.75,110.72,113.12,10160000,28.28 +2000-05-04,115.12,115.25,110.56,110.69,14284400,27.67 +2000-05-03,118.94,121.25,111.62,115.06,17500000,28.76 +2000-05-02,123.25,126.25,117.50,117.87,8446400,29.47 +2000-05-01,124.87,125.12,121.87,124.31,8100000,31.08 +2000-04-28,127.12,127.50,121.31,124.06,8932400,31.01 +2000-04-27,117.19,127.00,116.58,126.75,11678000,31.69 +2000-04-26,126.62,128.00,120.00,121.31,13117600,30.33 +2000-04-25,122.12,128.75,122.06,128.31,14002400,32.08 +2000-04-24,115.00,120.50,114.75,120.50,15845600,30.12 +2000-04-20,123.69,124.75,117.06,118.87,25806800,29.72 +2000-04-19,126.19,130.25,119.75,121.12,18586400,30.28 +2000-04-18,123.50,126.87,119.37,126.87,13962400,31.72 +2000-04-17,109.50,123.94,109.06,123.87,14642400,30.97 +2000-04-14,109.31,118.00,109.00,111.87,23845600,27.97 +2000-04-13,111.50,120.00,108.50,113.81,18923600,28.45 +2000-04-12,119.00,119.00,104.87,109.25,33618800,27.31 +2000-04-11,123.50,124.87,118.06,119.44,19368000,29.86 +2000-04-10,131.69,132.75,124.75,125.00,7592400,31.25 +2000-04-07,127.25,131.88,125.50,131.75,8668800,32.94 +2000-04-06,130.63,134.50,123.25,125.19,9290800,31.30 +2000-04-05,126.47,132.88,124.00,130.38,16359200,32.60 +2000-04-04,132.63,133.00,116.75,127.31,23596400,31.83 +2000-04-03,135.50,139.50,129.44,133.31,11742400,33.33 +2000-03-31,127.44,137.25,126.00,135.81,14457600,33.95 +2000-03-30,133.56,137.69,125.44,125.75,14800000,31.44 +2000-03-29,139.38,139.44,133.83,135.94,8568800,33.99 +2000-03-28,137.25,142.00,137.13,139.13,7253600,34.78 +2000-03-27,137.63,144.75,136.88,139.56,9976800,34.89 +2000-03-24,142.44,143.94,135.50,138.69,15962000,34.67 +2000-03-23,142.00,150.38,140.00,141.31,20098000,35.33 +2000-03-22,132.78,144.38,131.56,144.19,20288800,36.05 +2000-03-21,122.56,136.75,121.62,134.94,18729200,33.74 +2000-03-20,123.50,126.25,122.37,123.00,7316400,30.75 +2000-03-17,120.12,125.00,119.62,125.00,10902400,31.25 +2000-03-16,117.31,122.00,114.50,121.56,13516800,30.39 +2000-03-15,115.62,120.25,114.12,116.25,15845200,29.06 +2000-03-14,121.22,124.25,114.00,114.25,15321200,28.56 +2000-03-13,122.12,126.50,119.50,121.31,10864400,30.33 +2000-03-10,121.69,127.94,121.00,125.75,8900800,31.44 +2000-03-09,120.87,125.00,118.25,122.25,9884400,30.56 +2000-03-08,122.87,123.94,118.56,122.00,9690800,30.50 +2000-03-07,126.44,127.44,121.12,122.87,9767600,30.72 +2000-03-06,126.00,129.13,125.00,125.69,7520000,31.42 +2000-03-03,124.87,128.23,120.00,128.00,11565200,32.00 +2000-03-02,127.00,127.94,120.69,122.00,11136800,30.50 +2000-03-01,118.56,132.06,118.50,130.31,38478000,32.58 +2000-02-29,113.56,117.25,112.56,114.62,13186800,28.66 +2000-02-28,110.12,115.00,108.37,113.25,11729200,28.31 +2000-02-25,114.81,117.00,110.12,110.37,8908000,27.59 +2000-02-24,117.31,119.12,111.75,115.20,13446400,28.80 +2000-02-23,113.23,119.00,111.00,116.25,16905600,29.06 +2000-02-22,110.12,116.94,106.69,113.81,15083200,28.45 +2000-02-18,114.62,115.37,110.87,111.25,8346800,27.81 +2000-02-17,115.19,115.50,113.12,114.87,10350000,28.72 +2000-02-16,117.75,118.12,112.12,114.12,13525200,28.53 +2000-02-15,115.25,119.94,115.19,119.00,17363600,29.75 +2000-02-14,109.31,115.87,108.62,115.81,13130000,28.95 +2000-02-11,113.62,114.12,108.25,108.75,7592000,27.19 +2000-02-10,112.87,113.87,110.00,113.50,10832400,28.38 +2000-02-09,114.12,117.12,112.44,112.62,10698000,28.16 +2000-02-08,114.00,116.12,111.25,114.87,14613600,28.72 +2000-02-07,108.00,114.25,105.94,114.06,15770800,28.51 +2000-02-04,103.94,110.00,103.62,108.00,15206800,27.00 +2000-02-03,100.31,104.25,100.25,103.31,16977600,25.83 +2000-02-02,100.75,102.12,97.00,98.81,16588800,24.70 +2000-02-01,104.00,105.00,100.00,100.25,11380000,25.06 +2000-01-31,101.00,103.87,94.50,103.75,25071200,25.94 +2000-01-28,108.19,110.87,100.62,101.62,15142000,25.41 +2000-01-27,108.81,113.00,107.00,110.00,12163600,27.50 +2000-01-26,110.00,114.19,109.75,110.19,13131200,27.55 +2000-01-25,105.00,113.12,102.37,112.25,17775200,28.06 +2000-01-24,108.44,112.75,105.12,106.25,15760000,26.56 +2000-01-21,114.25,114.25,110.19,111.31,17729200,27.83 +2000-01-20,115.50,121.50,113.50,113.50,65418800,28.38 +2000-01-19,105.62,108.75,103.37,106.56,21358000,26.64 +2000-01-18,101.00,106.00,100.44,103.94,16421200,25.99 +2000-01-14,100.00,102.25,99.37,100.44,13954400,25.11 +2000-01-13,94.48,98.75,92.50,96.75,36882400,24.19 +2000-01-12,95.00,95.50,86.50,87.19,34870800,21.80 +2000-01-11,95.94,99.37,90.50,92.75,15775200,23.19 +2000-01-10,102.00,102.25,94.75,97.75,18059200,24.44 +2000-01-07,96.50,101.00,95.50,99.50,16463200,24.88 +2000-01-06,106.12,107.00,95.00,95.00,27443200,23.75 +2000-01-05,103.75,110.56,103.00,104.00,27818000,26.00 +2000-01-04,108.25,110.62,101.19,102.50,18310000,25.62 +2000-01-03,104.87,112.50,101.69,111.94,19144400,27.99 +1999-12-31,100.94,102.87,99.50,102.81,5856400,25.70 +1999-12-30,102.19,104.12,99.62,100.31,7419200,25.08 +1999-12-29,96.81,102.19,95.50,100.69,10161200,25.17 +1999-12-28,99.12,99.62,95.00,98.19,8843200,24.55 +1999-12-27,104.37,104.44,99.25,99.31,6022000,24.83 +1999-12-23,101.81,104.25,101.06,103.50,8218800,25.88 +1999-12-22,102.87,104.56,98.75,99.94,11682000,24.99 +1999-12-21,98.19,103.06,97.94,102.50,11000000,25.62 +1999-12-20,99.56,99.62,96.62,98.00,10155200,24.50 +1999-12-17,100.87,102.00,98.50,100.00,17700800,25.00 +1999-12-16,98.00,98.37,94.00,98.31,16568000,24.58 +1999-12-15,93.25,97.25,91.06,97.00,22254400,24.25 +1999-12-14,98.37,99.75,94.75,94.87,15570800,23.72 +1999-12-13,102.39,102.50,98.94,99.00,18931200,24.75 +1999-12-10,105.31,109.25,99.00,103.00,22786800,25.75 +1999-12-09,111.00,111.00,100.87,105.25,30555600,26.31 +1999-12-08,116.25,117.87,109.50,110.06,14730800,27.51 +1999-12-07,116.56,118.00,114.00,117.81,15901200,29.45 +1999-12-06,114.56,117.31,111.44,116.00,16688000,29.00 +1999-12-03,112.19,115.56,111.87,115.00,23151200,28.75 +1999-12-02,103.12,110.62,101.75,110.19,20275600,27.55 +1999-12-01,101.00,104.50,100.06,103.06,22098000,25.76 +1999-11-30,98.12,103.75,97.37,97.87,30132400,24.47 +1999-11-29,94.25,99.75,93.25,94.56,16586800,23.64 +1999-11-26,94.75,95.50,94.12,95.06,4737600,23.76 +1999-11-24,93.00,95.00,91.69,94.69,7683600,23.67 +1999-11-23,91.75,95.25,88.50,92.81,19406400,23.20 +1999-11-22,91.75,91.75,89.25,90.62,7242400,22.66 +1999-11-19,89.50,92.87,88.06,92.44,11162000,23.11 +1999-11-18,91.06,91.12,88.44,89.62,13043600,22.41 +1999-11-17,90.69,94.75,90.00,90.25,13032000,22.56 +1999-11-16,90.00,91.75,88.50,91.19,8370000,22.80 +1999-11-15,89.62,92.87,88.50,89.44,9283600,22.36 +1999-11-12,91.94,92.00,87.37,90.62,9970000,22.66 +1999-11-11,91.59,92.62,89.87,92.25,9660000,23.06 +1999-11-10,88.25,93.25,88.12,91.44,20661200,22.86 +1999-11-09,94.37,94.50,88.00,89.62,28910000,22.41 +1999-11-08,87.75,97.73,86.75,96.37,33962400,24.09 +1999-11-05,84.62,88.37,84.00,88.31,14889200,22.08 +1999-11-04,82.06,85.37,80.62,83.62,13549200,20.91 +1999-11-03,81.62,83.25,81.00,81.50,11736800,20.38 +1999-11-02,78.00,81.69,77.31,80.25,14268800,20.06 +1999-11-01,80.00,80.69,77.37,77.62,9965600,19.41 +1999-10-29,78.81,81.06,78.81,80.12,18680800,20.03 +1999-10-28,77.06,79.00,76.06,77.87,18005200,19.47 +1999-10-27,74.37,76.62,73.44,76.37,15837600,19.09 +1999-10-26,74.94,75.50,73.31,75.06,12924400,18.76 +1999-10-25,74.25,76.12,73.75,74.50,11677600,18.62 +1999-10-22,77.12,77.25,73.37,73.94,14995200,18.49 +1999-10-21,72.56,77.06,72.37,76.12,28347600,19.03 +1999-10-20,70.00,75.25,70.00,75.12,38633600,18.78 +1999-10-19,71.62,75.00,68.44,68.50,36521200,17.12 +1999-10-18,73.87,74.25,71.12,73.25,27733600,18.31 +1999-10-15,71.12,75.81,70.19,74.56,41910000,18.64 +1999-10-14,69.25,73.31,69.00,73.19,67822400,18.30 +1999-10-13,66.62,69.50,63.75,64.03,22752000,16.01 +1999-10-12,67.87,69.62,67.00,67.69,20142000,16.92 +1999-10-11,66.00,68.25,66.00,66.69,9418000,16.67 +1999-10-08,66.19,66.31,63.50,65.56,13689200,16.39 +1999-10-07,68.44,68.62,64.87,66.37,21660800,16.59 +1999-10-06,69.37,69.62,67.00,67.19,28726400,16.80 +1999-10-05,65.62,68.12,64.75,67.94,29100800,16.99 +1999-10-04,62.38,64.87,62.38,64.56,16408800,16.14 +1999-10-01,62.13,62.44,59.50,61.72,21977600,15.43 +1999-09-30,59.56,64.19,59.25,63.31,32449200,15.83 +1999-09-29,60.25,61.25,58.00,59.06,23493600,14.77 +1999-09-28,61.50,62.00,57.44,59.63,50542400,14.91 +1999-09-27,66.37,66.75,61.19,61.31,33877600,15.33 +1999-09-24,63.38,67.02,63.00,64.94,42148800,16.24 +1999-09-23,71.12,71.25,63.00,63.31,40853200,15.83 +1999-09-22,69.75,71.62,69.02,70.31,40132000,17.58 +1999-09-21,73.19,73.25,69.00,69.25,119931200,17.31 +1999-09-20,77.00,80.12,76.87,79.06,16326400,19.76 +1999-09-17,77.31,77.75,76.25,76.94,9915600,19.24 +1999-09-16,76.06,78.06,73.87,76.81,15793600,19.20 +1999-09-15,78.87,79.12,75.25,75.37,12843200,18.84 +1999-09-14,74.72,78.50,74.69,77.81,13883200,19.45 +1999-09-13,77.06,77.06,74.81,75.00,9000000,18.75 +1999-09-10,76.00,77.69,74.69,77.44,16398000,19.36 +1999-09-09,75.50,75.94,73.87,75.56,19093600,18.89 +1999-09-08,76.19,77.69,74.50,74.50,27233600,18.62 +1999-09-07,73.75,77.94,73.50,76.37,35177600,19.09 +1999-09-03,71.94,75.25,70.50,73.50,58403600,18.38 +1999-09-02,67.62,71.44,66.87,70.56,31975200,17.64 +1999-09-01,67.00,68.81,66.00,68.62,28168000,17.16 +1999-08-31,62.59,65.87,62.06,65.25,22675200,16.31 +1999-08-30,65.00,65.00,62.00,62.06,12033200,15.52 +1999-08-27,62.75,65.00,62.69,64.75,15980000,16.19 +1999-08-26,61.13,63.13,61.13,62.13,14449200,15.53 +1999-08-25,60.69,61.50,60.13,61.38,10553600,15.35 +1999-08-24,60.38,60.75,59.94,60.38,17948000,15.10 +1999-08-23,59.38,61.38,59.31,60.75,12709200,15.19 +1999-08-20,59.25,59.38,58.19,59.19,11730800,14.80 +1999-08-19,59.81,60.50,58.56,58.75,19645600,14.69 +1999-08-18,60.06,62.00,59.63,60.13,16743200,15.03 +1999-08-17,60.31,60.38,58.94,60.31,11474400,15.08 +1999-08-16,59.81,60.69,59.50,60.50,9896400,15.12 +1999-08-13,60.63,62.00,59.88,60.06,10668800,15.02 +1999-08-12,59.06,61.38,58.63,60.00,23806400,15.00 +1999-08-11,56.00,59.75,55.94,59.69,30374400,14.92 +1999-08-10,54.00,56.00,53.63,55.38,14879200,13.85 +1999-08-09,54.34,55.19,54.25,54.44,8338000,13.61 +1999-08-06,54.06,55.31,53.50,54.13,15575600,13.53 +1999-08-05,53.50,54.88,52.13,54.75,11541200,13.69 +1999-08-04,55.19,55.88,53.25,53.81,13279200,13.45 +1999-08-03,56.75,57.44,53.63,55.25,13176800,13.81 +1999-08-02,55.63,58.00,55.50,55.75,12958000,13.94 +1999-07-30,54.50,56.13,54.50,55.69,13685600,13.92 +1999-07-29,53.38,55.25,53.13,53.88,9860000,13.47 +1999-07-28,53.88,55.38,53.00,54.38,11762000,13.60 +1999-07-27,52.63,53.94,52.50,53.69,14150800,13.42 +1999-07-26,52.88,53.00,50.88,50.94,12555200,12.73 +1999-07-23,52.81,53.75,52.69,53.31,8192000,13.33 +1999-07-22,53.63,53.88,51.13,52.38,14529200,13.10 +1999-07-21,54.06,55.44,52.88,54.06,25653600,13.52 +1999-07-20,54.56,55.50,52.75,52.88,15804400,13.22 +1999-07-19,53.94,55.81,52.31,54.44,20050000,13.61 +1999-07-16,53.63,54.50,53.00,53.06,14705600,13.27 +1999-07-15,55.88,55.94,51.31,53.25,60433600,13.31 +1999-07-14,54.50,56.63,54.50,55.94,22320000,13.98 +1999-07-13,53.50,54.19,52.88,53.69,10136800,13.42 +1999-07-12,55.50,55.63,54.19,54.50,10862000,13.62 +1999-07-09,54.50,55.63,53.00,55.63,21750000,13.91 +1999-07-08,51.13,55.06,50.88,54.50,58058000,13.62 +1999-07-07,47.38,50.75,47.00,49.88,39264400,12.47 +1999-07-06,45.94,47.63,45.81,47.38,16212000,11.85 +1999-07-02,45.53,46.88,45.19,46.31,4426800,11.58 +1999-07-01,46.31,46.56,45.25,45.31,5334400,11.33 +1999-06-30,45.69,46.94,44.94,46.31,12270800,11.58 +1999-06-29,42.72,45.56,42.63,45.38,13599200,11.35 +1999-06-28,42.44,42.94,42.38,42.56,9938800,10.64 +1999-06-25,42.50,42.69,42.06,42.19,10518800,10.55 +1999-06-24,43.63,43.63,42.25,42.31,15498000,10.58 +1999-06-23,45.06,45.09,43.56,43.69,18994400,10.92 +1999-06-22,46.31,46.94,45.38,45.38,5415600,11.35 +1999-06-21,47.00,47.25,46.00,46.50,4842000,11.62 +1999-06-18,45.38,47.25,45.19,47.13,7448000,11.78 +1999-06-17,47.63,48.00,45.75,46.38,8022400,11.60 +1999-06-16,46.38,48.06,46.38,47.94,8056800,11.98 +1999-06-15,45.19,46.75,45.13,46.06,4666400,11.52 +1999-06-14,46.50,46.63,45.13,45.44,5615600,11.36 +1999-06-11,48.13,48.50,46.25,46.44,6613600,11.61 +1999-06-10,47.88,48.25,47.31,48.13,11325200,12.03 +1999-06-09,47.44,48.50,47.44,48.44,12655200,12.11 +1999-06-08,48.75,48.81,47.56,47.69,11203200,11.92 +1999-06-07,48.13,49.00,47.50,48.94,14949200,12.23 +1999-06-04,47.63,48.19,47.25,48.13,13171200,12.03 +1999-06-03,46.88,48.00,46.81,47.44,17450800,11.86 +1999-06-02,44.50,47.94,44.00,46.56,18614400,11.64 +1999-06-01,45.00,45.31,44.38,44.81,16479200,11.20 +1999-05-28,43.31,44.31,43.13,44.06,7196400,11.02 +1999-05-27,43.19,43.75,42.69,43.50,12042400,10.88 +1999-05-26,41.75,44.38,41.25,44.06,15642000,11.02 +1999-05-25,41.56,42.44,40.94,41.50,13095200,10.38 +1999-05-24,43.63,44.31,41.88,41.94,9340800,10.48 +1999-05-21,43.00,44.31,42.56,43.94,16555200,10.98 +1999-05-20,45.44,45.75,42.50,42.50,14940000,10.62 +1999-05-19,45.50,45.75,43.50,45.19,10660000,11.30 +1999-05-18,44.81,46.00,44.38,45.25,14954400,11.31 +1999-05-17,43.75,44.69,43.00,44.38,7531200,11.10 +1999-05-14,45.13,45.81,44.38,44.38,8102000,11.10 +1999-05-13,46.44,46.81,45.50,46.19,10573600,11.55 +1999-05-12,44.88,46.50,44.13,46.50,14129200,11.62 +1999-05-11,44.88,46.19,43.56,44.75,16388800,11.19 +1999-05-10,46.75,46.94,44.63,45.25,14055600,11.31 +1999-05-07,44.63,45.88,42.75,45.88,15528800,11.47 +1999-05-06,46.56,46.88,44.00,44.50,15486400,11.12 +1999-05-05,46.31,47.00,44.63,47.00,20694400,11.75 +1999-05-04,48.25,48.63,46.19,46.50,28980000,11.62 +1999-05-03,46.06,50.00,45.75,49.56,52535600,12.39 +1999-04-30,44.00,47.13,44.00,46.00,52596400,11.50 +1999-04-29,43.25,44.38,41.78,43.00,28206400,10.75 +1999-04-28,44.63,45.69,43.63,44.06,34122000,11.02 +1999-04-27,43.00,45.81,43.00,45.75,75225200,11.44 +1999-04-26,39.50,41.25,39.25,40.94,33152000,10.23 +1999-04-23,36.25,39.44,36.25,39.19,37402400,9.80 +1999-04-22,35.06,36.63,35.06,36.38,26454400,9.10 +1999-04-21,34.00,34.38,33.50,34.38,12566800,8.60 +1999-04-20,33.88,34.75,33.50,34.06,18725600,8.52 +1999-04-19,35.69,36.00,33.50,33.88,32923200,8.47 +1999-04-16,35.88,36.06,35.25,35.44,17945600,8.86 +1999-04-15,35.38,36.19,34.31,35.75,61960000,8.94 +1999-04-14,35.25,37.06,35.00,35.53,24323600,8.88 +1999-04-13,36.31,36.81,34.50,34.63,14732400,8.66 +1999-04-12,35.00,36.88,34.88,36.25,14145600,9.06 +1999-04-09,36.25,37.25,35.94,36.75,9608000,9.19 +1999-04-08,36.88,37.06,36.00,36.88,10600800,9.22 +1999-04-07,38.06,38.25,36.38,37.13,14723200,9.28 +1999-04-06,36.81,38.31,36.81,38.00,22455200,9.50 +1999-04-05,36.00,37.88,36.00,37.06,16474400,9.27 +1999-04-01,36.06,36.69,35.75,36.06,9381200,9.02 +1999-03-31,36.38,37.13,35.88,35.94,15086400,8.98 +1999-03-30,35.00,36.38,35.00,35.88,19806800,8.97 +1999-03-29,33.50,35.44,33.44,35.38,20337600,8.85 +1999-03-26,33.75,33.81,33.00,33.25,9080000,8.31 +1999-03-25,34.38,34.88,33.38,33.81,14286800,8.45 +1999-03-24,33.25,33.75,32.50,33.69,14297600,8.42 +1999-03-23,34.44,34.44,32.75,33.00,14842000,8.25 +1999-03-22,34.00,35.19,32.94,35.06,21200800,8.77 +1999-03-19,35.94,36.00,32.88,33.50,19161200,8.38 +1999-03-18,34.38,35.63,34.25,35.50,8126800,8.88 +1999-03-17,35.94,36.06,33.94,34.06,13084400,8.52 +1999-03-16,35.00,35.56,34.94,35.50,14302000,8.88 +1999-03-15,33.31,35.00,33.25,34.06,12586800,8.52 +1999-03-12,32.31,33.50,32.31,33.19,9700000,8.30 +1999-03-11,32.25,33.88,32.00,32.19,16936800,8.05 +1999-03-10,34.19,34.19,32.44,32.56,19526800,8.14 +1999-03-09,34.31,34.38,33.50,34.13,11427600,8.53 +1999-03-08,33.25,34.69,33.19,34.38,19682000,8.60 +1999-03-05,34.31,34.31,32.38,33.19,16735600,8.30 +1999-03-04,34.50,34.50,32.38,33.44,13137600,8.36 +1999-03-03,34.75,35.13,33.50,34.19,10497600,8.55 +1999-03-02,34.13,35.31,33.75,34.63,24414400,8.66 +1999-03-01,34.81,34.81,33.63,33.75,17435200,8.44 +1999-02-26,36.50,37.00,34.50,34.81,23847600,8.70 +1999-02-25,37.31,37.69,36.50,36.94,9455600,9.23 +1999-02-24,38.81,39.00,37.38,37.44,7620000,9.36 +1999-02-23,38.56,39.56,37.94,38.44,11521200,9.61 +1999-02-22,37.38,38.88,37.25,38.44,10682000,9.61 +1999-02-19,36.25,37.69,36.19,37.19,12938800,9.30 +1999-02-18,37.56,37.88,35.56,36.00,17876400,9.00 +1999-02-17,38.13,38.69,36.94,37.00,10581200,9.25 +1999-02-16,38.88,38.88,37.88,38.31,10723600,9.58 +1999-02-12,39.13,39.13,37.00,37.69,15339200,9.42 +1999-02-11,38.75,39.75,38.56,39.63,20200000,9.91 +1999-02-10,36.88,38.69,36.00,38.31,20135200,9.58 +1999-02-09,37.94,39.06,37.06,37.19,25042000,9.30 +1999-02-08,36.69,37.94,36.25,37.75,16723600,9.44 +1999-02-05,38.25,38.38,35.50,36.31,27778000,9.08 +1999-02-04,40.19,40.25,37.75,37.88,16565600,9.47 +1999-02-03,39.00,40.56,38.75,40.19,12108000,10.05 +1999-02-02,40.38,40.75,39.00,39.19,10975600,9.80 +1999-02-01,41.69,41.94,40.31,40.94,9962000,10.23 +1999-01-29,41.19,41.56,40.00,41.19,8684400,10.30 +1999-01-28,40.88,41.25,40.31,40.88,12015600,10.22 +1999-01-27,41.00,41.38,39.94,40.13,13053200,10.03 +1999-01-26,39.94,40.88,39.63,40.50,20002400,10.12 +1999-01-25,39.25,39.56,38.81,39.38,13763200,9.85 +1999-01-22,37.69,39.50,37.06,38.75,12365200,9.69 +1999-01-21,40.44,40.56,37.50,38.81,21449200,9.70 +1999-01-20,41.06,42.00,40.50,40.56,27806800,10.14 +1999-01-19,41.94,42.31,40.38,40.88,19116400,10.22 +1999-01-15,41.81,42.13,40.00,41.31,35933600,10.33 +1999-01-14,45.50,46.00,41.06,41.38,61570000,10.35 +1999-01-13,42.88,47.31,42.25,46.50,37434400,11.62 +1999-01-12,46.31,46.63,44.13,46.13,29330000,11.53 +1999-01-11,45.75,46.06,44.88,45.88,20054400,11.47 +1999-01-08,46.56,46.88,44.00,45.00,24246400,11.25 +1999-01-07,42.25,45.06,42.13,45.00,51056800,11.25 +1999-01-06,44.13,44.13,41.00,41.75,48165200,10.44 +1999-01-05,41.94,43.94,41.50,43.31,50362000,10.83 +1999-01-04,42.13,42.25,40.00,41.25,34049200,10.31 +1998-12-31,40.50,41.38,39.50,40.94,9716400,10.23 +1998-12-30,40.13,41.13,40.00,40.06,8498000,10.02 +1998-12-29,41.13,41.50,40.25,40.81,13853200,10.20 +1998-12-28,39.00,41.13,39.00,40.88,25917600,10.22 +1998-12-24,39.88,40.00,39.19,39.25,7155200,9.81 +1998-12-23,38.63,40.50,38.38,39.81,44124400,9.95 +1998-12-22,36.38,38.13,36.00,38.00,41111200,9.50 +1998-12-21,35.38,35.63,34.25,35.06,12769200,8.77 +1998-12-18,33.38,35.38,33.25,35.19,28283200,8.80 +1998-12-17,32.94,33.75,32.75,33.44,11812000,8.36 +1998-12-16,33.75,34.19,32.63,32.81,13375200,8.20 +1998-12-15,32.75,33.63,32.75,33.56,9462000,8.39 +1998-12-14,32.88,33.31,32.25,32.50,17925200,8.12 +1998-12-11,32.25,34.00,32.00,33.75,24644400,8.44 +1998-12-10,32.69,32.94,31.87,32.00,13980800,8.00 +1998-12-09,32.69,32.88,31.62,32.00,21184400,8.00 +1998-12-08,33.94,33.94,32.00,32.06,24295200,8.02 +1998-12-07,33.38,33.75,32.75,33.75,20255600,8.44 +1998-12-04,34.31,34.44,32.00,32.75,25765200,8.19 +1998-12-03,36.31,36.50,33.63,33.69,22380800,8.42 +1998-12-02,34.13,36.88,33.50,36.00,34382400,9.00 +1998-12-01,32.00,34.81,31.62,34.13,30941200,8.53 +1998-11-30,34.56,34.81,31.75,31.94,20060800,7.99 +1998-11-27,35.06,35.13,34.75,35.06,5483600,8.77 +1998-11-25,35.88,36.06,34.94,35.13,10855600,8.78 +1998-11-24,36.13,36.75,35.75,35.94,11430800,8.98 +1998-11-23,35.56,36.81,35.19,36.25,20642000,9.06 +1998-11-20,36.44,36.75,34.75,35.31,14268000,8.83 +1998-11-19,35.50,37.19,35.44,35.75,12385200,8.94 +1998-11-18,35.19,36.00,34.88,35.44,11781200,8.86 +1998-11-17,35.75,35.81,34.75,34.81,7529200,8.70 +1998-11-16,35.94,36.75,35.44,36.00,13740800,9.00 +1998-11-13,34.94,36.06,34.69,35.69,28301200,8.92 +1998-11-12,33.13,34.44,32.88,34.00,21261200,8.50 +1998-11-11,35.75,35.81,32.75,33.56,33895200,8.39 +1998-11-10,36.19,36.25,35.00,35.13,31576800,8.78 +1998-11-09,37.69,38.13,35.50,36.63,23622000,9.16 +1998-11-06,37.88,38.25,37.25,38.06,28496800,9.52 +1998-11-05,38.38,39.38,38.06,38.19,21684400,9.55 +1998-11-04,38.56,39.13,38.13,38.69,22438000,9.67 +1998-11-03,37.38,38.25,37.31,37.81,13247600,9.45 +1998-11-02,37.50,37.75,37.25,37.63,9076400,9.41 +1998-10-30,36.81,37.50,36.25,37.13,11358000,9.28 +1998-10-29,36.44,37.44,35.81,36.44,12321200,9.11 +1998-10-28,35.25,37.00,35.13,36.81,13006400,9.20 +1998-10-27,38.00,38.94,35.06,35.25,19233200,8.81 +1998-10-26,36.06,37.75,35.50,37.44,17013600,9.36 +1998-10-23,36.75,36.88,35.13,35.50,12732400,8.88 +1998-10-22,36.88,37.63,36.25,36.75,11343200,9.19 +1998-10-21,36.75,37.44,35.75,37.13,15390000,9.28 +1998-10-20,37.94,38.19,36.00,36.06,13649200,9.02 +1998-10-19,36.69,38.06,35.88,37.50,17010000,9.38 +1998-10-16,37.13,38.06,36.50,36.69,21998000,9.17 +1998-10-15,36.25,37.25,35.50,36.63,30037600,9.16 +1998-10-14,39.75,41.31,36.81,37.38,81445600,9.35 +1998-10-13,38.06,39.19,36.00,38.75,33646400,9.69 +1998-10-12,37.50,38.44,36.56,37.44,22250000,9.36 +1998-10-09,31.75,35.25,30.75,35.13,23880000,8.78 +1998-10-08,31.00,31.19,28.50,30.81,24623200,7.70 +1998-10-07,32.38,33.31,31.87,31.94,16920000,7.99 +1998-10-06,33.69,34.31,32.50,32.56,14281200,8.14 +1998-10-05,34.00,34.56,31.50,32.19,19726800,8.05 +1998-10-02,35.50,36.25,34.13,35.06,16998800,8.77 +1998-10-01,36.75,38.00,35.38,35.69,13234400,8.92 +1998-09-30,38.75,39.25,38.00,38.13,5976800,9.53 +1998-09-29,39.06,40.00,38.13,39.50,10907600,9.88 +1998-09-28,39.75,40.19,38.00,39.06,14501200,9.77 +1998-09-25,38.19,39.19,37.63,38.75,8172000,9.69 +1998-09-24,37.88,39.56,37.75,38.50,17246800,9.62 +1998-09-23,37.25,38.38,36.56,38.31,10284400,9.58 +1998-09-22,37.13,37.63,36.38,37.00,9218800,9.25 +1998-09-21,35.69,36.94,35.31,36.94,10570800,9.23 +1998-09-18,36.06,36.75,35.56,36.75,10904400,9.19 +1998-09-17,36.06,37.13,35.88,36.00,9627600,9.00 +1998-09-16,38.63,38.75,37.00,37.31,9248800,9.33 +1998-09-15,36.75,38.56,36.50,38.19,15492000,9.55 +1998-09-14,38.25,38.81,37.13,37.19,8837600,9.30 +1998-09-11,38.50,39.63,36.88,37.63,12593600,9.41 +1998-09-10,36.25,38.25,35.75,38.13,18826800,9.53 +1998-09-09,38.06,38.13,37.00,37.38,12683200,9.35 +1998-09-08,38.00,38.25,36.75,38.25,14400000,9.56 +1998-09-04,35.50,36.44,33.75,35.13,13493200,8.78 +1998-09-03,35.00,35.13,34.00,34.63,14653200,8.66 +1998-09-02,35.50,37.38,35.25,35.56,30122400,8.89 +1998-09-01,31.37,35.38,30.62,34.13,31060000,8.53 +1998-08-31,34.75,34.88,31.00,31.19,31012400,7.80 +1998-08-28,37.13,38.50,34.13,34.19,33303200,8.55 +1998-08-27,39.25,39.25,35.63,37.50,39813600,9.38 +1998-08-26,39.88,41.13,39.50,40.38,14538000,10.10 +1998-08-25,42.38,42.38,40.31,40.81,17709200,10.20 +1998-08-24,43.44,43.50,40.13,41.19,21810000,10.30 +1998-08-21,40.00,43.56,39.00,43.00,29054400,10.75 +1998-08-20,41.00,41.13,40.25,40.63,14018000,10.16 +1998-08-19,43.50,43.75,41.00,41.00,17377600,10.25 +1998-08-18,42.44,43.38,42.25,42.56,21642000,10.64 +1998-08-17,41.00,42.81,39.88,41.94,33248800,10.48 +1998-08-14,40.69,40.75,39.50,40.50,16110000,10.12 +1998-08-13,39.94,40.75,39.38,39.44,13976800,9.86 +1998-08-12,39.75,40.94,39.48,40.06,24654400,10.02 +1998-08-11,37.75,41.00,37.38,39.00,62860000,9.75 +1998-08-10,36.31,38.06,36.25,37.94,17455600,9.48 +1998-08-07,37.19,37.38,36.00,36.50,10645600,9.12 +1998-08-06,35.06,36.88,34.88,36.88,15678800,9.22 +1998-08-05,33.75,36.00,33.50,36.00,16226800,9.00 +1998-08-04,35.50,36.00,34.00,34.19,10506800,8.55 +1998-08-03,34.25,35.56,33.25,35.13,10786800,8.78 +1998-07-31,36.63,36.75,34.50,34.63,6550800,8.66 +1998-07-30,35.81,36.75,35.50,36.50,12950000,9.12 +1998-07-29,33.75,35.88,33.69,35.13,16006800,8.78 +1998-07-28,34.06,34.63,33.00,33.63,8054400,8.41 +1998-07-27,34.25,34.88,33.25,34.44,7657600,8.61 +1998-07-24,35.38,35.50,33.81,34.69,9693600,8.67 +1998-07-23,34.81,35.63,34.75,34.94,9040800,8.73 +1998-07-22,34.94,35.63,34.25,35.00,10040800,8.75 +1998-07-21,36.13,37.00,35.56,35.63,11772400,8.91 +1998-07-20,36.56,36.63,35.50,36.25,13727600,9.06 +1998-07-17,37.25,37.25,36.19,36.88,22486400,9.22 +1998-07-16,37.88,38.13,35.75,37.50,91497600,9.38 +1998-07-15,33.69,34.69,33.50,34.44,21253600,8.61 +1998-07-14,33.94,34.00,33.13,33.44,19607600,8.36 +1998-07-13,31.94,34.13,31.87,33.94,25566400,8.48 +1998-07-10,32.19,32.63,31.75,32.06,10806800,8.02 +1998-07-09,32.94,33.63,31.44,31.69,20256400,7.92 +1998-07-08,30.75,32.94,30.69,32.56,33334400,8.14 +1998-07-07,30.37,30.87,30.00,30.50,8637600,7.62 +1998-07-06,29.50,30.37,29.12,30.37,9697600,7.59 +1998-07-02,29.69,30.06,29.00,29.00,10650800,7.25 +1998-07-01,28.87,30.00,28.50,29.94,11228800,7.49 +1998-06-30,28.62,28.81,28.12,28.69,4681200,7.17 +1998-06-29,28.25,28.81,28.06,28.69,5943600,7.17 +1998-06-26,28.50,28.62,27.75,28.19,3973200,7.05 +1998-06-25,28.56,28.81,28.31,28.56,6856400,7.14 +1998-06-24,27.75,28.62,27.31,28.25,9788800,7.06 +1998-06-23,27.44,28.12,27.25,27.81,8258800,6.95 +1998-06-22,27.00,27.56,26.75,27.37,4809200,6.84 +1998-06-19,27.37,27.44,26.75,27.06,4931200,6.76 +1998-06-18,27.75,28.06,27.19,27.31,4288800,6.83 +1998-06-17,28.00,28.56,27.94,28.12,6687600,7.03 +1998-06-16,27.69,28.12,27.31,28.00,4649200,7.00 +1998-06-15,27.25,28.25,27.25,27.50,4881200,6.88 +1998-06-12,27.62,28.25,27.37,28.12,8014400,7.03 +1998-06-11,28.19,28.62,27.81,27.81,6451200,6.95 +1998-06-10,28.00,29.00,27.62,28.06,8202000,7.01 +1998-06-09,27.37,28.50,27.37,28.25,9852400,7.06 +1998-06-08,27.00,27.69,26.81,27.25,4523600,6.81 +1998-06-05,26.87,27.25,26.37,26.87,4406800,6.72 +1998-06-04,26.62,26.87,25.81,26.81,5585600,6.70 +1998-06-03,27.12,27.25,26.19,26.31,5196800,6.58 +1998-06-02,26.44,27.31,26.00,26.87,6405600,6.72 +1998-06-01,26.50,27.62,25.62,26.25,11427600,6.56 +1998-05-29,27.50,27.56,26.44,26.62,7751200,6.66 +1998-05-28,26.75,27.87,26.75,27.44,10672000,6.86 +1998-05-27,25.69,26.81,25.62,26.75,13233200,6.69 +1998-05-26,28.06,28.25,26.62,26.69,11143200,6.67 +1998-05-22,28.75,28.75,27.31,27.87,9522000,6.97 +1998-05-21,29.56,29.69,28.62,28.87,4700000,7.22 +1998-05-20,29.62,29.87,28.75,29.56,6810000,7.39 +1998-05-19,28.94,29.44,28.81,29.37,7815200,7.34 +1998-05-18,29.37,29.56,28.37,28.50,8310800,7.12 +1998-05-15,30.06,30.37,29.25,29.56,9743600,7.39 +1998-05-14,30.37,30.44,29.75,30.06,5815600,7.51 +1998-05-13,30.06,30.81,29.62,30.44,11245600,7.61 +1998-05-12,30.56,30.75,29.94,30.12,9212000,7.53 +1998-05-11,30.87,31.62,30.75,30.94,23768000,7.74 +1998-05-08,30.06,30.50,29.94,30.44,9690000,7.61 +1998-05-07,30.56,30.62,29.87,30.19,19761200,7.55 +1998-05-06,29.87,30.44,29.25,30.31,32056400,7.58 +1998-05-05,29.25,29.87,29.12,29.69,14982400,7.42 +1998-05-04,28.87,29.50,28.87,29.06,20419200,7.26 +1998-05-01,27.50,28.25,26.87,28.00,6582000,7.00 +1998-04-30,27.37,27.62,27.06,27.37,6442000,6.84 +1998-04-29,26.94,27.44,26.75,27.00,6774400,6.75 +1998-04-28,27.87,28.00,26.25,26.94,8487600,6.74 +1998-04-27,26.75,27.75,26.75,27.75,14655600,6.94 +1998-04-24,27.75,28.25,27.50,27.94,7708000,6.99 +1998-04-23,27.44,29.00,27.19,27.69,16983200,6.92 +1998-04-22,28.75,29.00,27.50,27.50,10186400,6.88 +1998-04-21,29.06,29.12,28.50,29.00,12446400,7.25 +1998-04-20,27.62,29.50,27.56,29.00,18498800,7.25 +1998-04-17,28.56,28.62,27.69,27.94,21165200,6.99 +1998-04-16,29.25,29.62,28.19,28.62,65642000,7.16 +1998-04-15,27.19,27.50,26.62,27.44,19928800,6.86 +1998-04-14,26.37,27.25,26.37,26.94,11725200,6.74 +1998-04-13,25.62,26.69,25.00,26.44,10305600,6.61 +1998-04-09,25.06,25.87,25.00,25.62,6083600,6.41 +1998-04-08,25.25,25.37,24.69,25.00,8044400,6.25 +1998-04-07,25.81,26.00,24.87,25.50,10461200,6.38 +1998-04-06,27.00,27.00,26.19,26.25,12422000,6.56 +1998-04-03,27.12,27.25,26.81,27.06,7259200,6.76 +1998-04-02,27.31,27.44,26.94,27.31,6950800,6.83 +1998-04-01,27.44,27.81,27.06,27.50,6693600,6.88 +1998-03-31,27.44,27.81,27.25,27.50,9538800,6.88 +1998-03-30,26.75,27.50,26.75,27.44,8972400,6.86 +1998-03-27,26.62,27.31,26.37,26.94,9133200,6.74 +1998-03-26,26.75,27.00,26.44,26.56,7253600,6.64 +1998-03-25,27.62,27.75,26.37,27.16,13854400,6.79 +1998-03-24,26.37,28.00,26.25,28.00,24152000,7.00 +1998-03-23,25.94,26.25,24.62,26.12,14818800,6.53 +1998-03-20,26.69,26.87,26.00,26.37,7704400,6.59 +1998-03-19,26.87,26.94,26.56,26.75,5736800,6.69 +1998-03-18,26.00,26.94,26.00,26.94,9900000,6.74 +1998-03-17,26.50,26.69,25.87,26.34,14658800,6.59 +1998-03-16,27.12,27.25,26.19,26.69,14375600,6.67 +1998-03-13,27.25,27.25,26.25,27.12,20231200,6.78 +1998-03-12,26.12,27.00,25.56,27.00,26598000,6.75 +1998-03-11,25.12,26.19,24.56,26.12,43374400,6.53 +1998-03-10,23.00,24.50,22.94,24.06,25472400,6.01 +1998-03-09,23.75,24.31,22.50,22.75,20540800,5.69 +1998-03-06,23.87,24.50,23.37,24.44,23803600,6.11 +1998-03-05,23.25,24.25,23.12,24.06,24129200,6.01 +1998-03-04,22.87,24.75,22.87,24.44,29212400,6.11 +1998-03-03,21.87,23.19,21.62,23.12,11937600,5.78 +1998-03-02,23.56,23.56,22.25,22.75,14313600,5.69 +1998-02-27,23.31,23.87,22.56,23.62,18578000,5.91 +1998-02-26,22.31,23.56,21.87,23.50,21263200,5.88 +1998-02-25,21.31,22.75,20.94,22.31,25459200,5.58 +1998-02-24,21.31,21.37,20.75,21.31,16322000,5.33 +1998-02-23,20.12,21.62,20.00,21.25,17060800,5.31 +1998-02-20,20.50,20.56,19.81,20.00,11634400,5.00 +1998-02-19,20.87,20.94,20.00,20.44,14292400,5.11 +1998-02-18,19.56,20.75,19.56,20.56,17677600,5.14 +1998-02-17,19.50,19.75,19.50,19.62,6530800,4.91 +1998-02-13,19.19,19.87,19.00,19.50,7444400,4.88 +1998-02-12,19.12,19.44,19.06,19.37,7297600,4.84 +1998-02-11,19.50,19.50,18.87,19.00,7582000,4.75 +1998-02-10,19.12,19.56,19.06,19.44,15090000,4.86 +1998-02-09,18.37,19.50,18.37,19.19,17682000,4.80 +1998-02-06,18.37,18.69,18.25,18.50,7241200,4.62 +1998-02-05,18.25,18.50,18.00,18.31,8526400,4.58 +1998-02-04,18.06,18.50,18.00,18.25,6100000,4.56 +1998-02-03,17.69,18.62,17.69,18.31,14390000,4.58 +1998-02-02,18.50,18.50,17.37,17.69,22752400,4.42 +1998-01-30,18.31,18.87,18.25,18.31,5802400,4.58 +1998-01-29,18.94,19.12,18.50,18.50,7571200,4.62 +1998-01-28,19.19,19.37,18.62,19.19,5418000,4.80 +1998-01-27,19.19,19.69,19.00,19.12,4013200,4.78 +1998-01-26,19.44,19.56,18.81,19.44,5246800,4.86 +1998-01-23,19.37,19.69,19.25,19.50,8331200,4.88 +1998-01-22,18.69,19.75,18.62,19.25,11785200,4.81 +1998-01-21,18.75,19.06,18.56,18.91,6812000,4.73 +1998-01-20,19.06,19.31,18.62,19.06,8642400,4.76 +1998-01-16,19.44,19.44,18.69,18.81,8820000,4.70 +1998-01-15,19.19,19.75,18.62,19.19,19982000,4.80 +1998-01-14,19.87,19.94,19.25,19.75,21048000,4.94 +1998-01-13,18.62,19.62,18.50,19.50,22758800,4.88 +1998-01-12,17.44,18.62,17.12,18.25,18444400,4.56 +1998-01-09,18.12,19.37,17.50,18.19,31675200,4.55 +1998-01-08,17.44,18.62,16.94,18.19,27645600,4.55 +1998-01-07,18.81,19.00,17.31,17.50,37201200,4.38 +1998-01-06,15.94,20.00,14.75,18.94,64737600,4.74 +1998-01-05,16.50,16.56,15.19,15.88,23282000,3.97 +1998-01-02,13.63,16.25,13.50,16.25,25650800,4.06 +1997-12-31,13.13,13.63,12.94,13.13,14531200,3.28 +1997-12-30,13.00,13.44,12.75,13.19,12250800,3.30 +1997-12-29,13.31,13.44,12.88,13.13,9944400,3.28 +1997-12-26,13.06,13.38,13.00,13.31,3860000,3.33 +1997-12-24,13.00,13.25,13.00,13.13,3502000,3.28 +1997-12-23,13.13,13.31,12.94,12.94,16402000,3.23 +1997-12-22,13.88,14.00,13.19,13.31,5704400,3.33 +1997-12-19,13.56,13.88,13.25,13.69,6812000,3.42 +1997-12-18,14.00,14.00,13.75,13.81,7225200,3.45 +1997-12-17,14.31,14.56,13.94,13.94,9494400,3.48 +1997-12-16,14.00,14.38,14.00,14.31,6646400,3.58 +1997-12-15,14.13,14.25,13.75,13.94,5927600,3.48 +1997-12-12,14.75,14.88,14.00,14.13,5742400,3.53 +1997-12-11,14.44,14.56,13.88,14.56,9185600,3.64 +1997-12-10,15.06,15.06,14.50,14.75,6960000,3.69 +1997-12-09,15.50,15.69,15.00,15.25,8680800,3.81 +1997-12-08,15.56,15.75,15.38,15.56,4776800,3.89 +1997-12-05,15.56,16.00,15.56,15.81,7926400,3.95 +1997-12-04,16.00,16.00,15.63,15.63,7135600,3.91 +1997-12-03,16.06,16.12,15.69,15.75,12258800,3.94 +1997-12-02,17.37,17.50,15.88,15.88,14178800,3.97 +1997-12-01,17.69,17.94,17.25,17.75,3135600,4.44 +1997-11-28,17.62,17.87,17.44,17.75,1495600,4.44 +1997-11-26,17.37,17.69,17.25,17.50,2178800,4.38 +1997-11-25,17.69,17.87,16.87,17.37,7346400,4.34 +1997-11-24,17.56,18.00,17.50,17.62,5630800,4.41 +1997-11-21,18.62,18.69,18.00,18.19,3498800,4.55 +1997-11-20,18.19,18.62,18.12,18.50,4587600,4.62 +1997-11-19,17.87,18.31,17.87,18.25,2843600,4.56 +1997-11-18,18.50,18.50,18.06,18.06,5258000,4.51 +1997-11-17,18.87,18.94,18.33,18.50,7323600,4.62 +1997-11-14,18.25,18.50,18.00,18.44,4835600,4.61 +1997-11-13,18.00,18.06,17.50,18.00,9218000,4.50 +1997-11-12,18.06,18.50,17.56,17.62,7448000,4.41 +1997-11-11,19.00,19.00,18.12,18.37,11893600,4.59 +1997-11-10,21.00,21.50,18.50,18.69,49946800,4.67 +1997-11-07,18.87,20.00,18.75,19.75,28423200,4.94 +1997-11-06,18.87,19.50,18.87,19.00,22060800,4.75 +1997-11-05,18.25,18.62,18.06,18.37,13840000,4.59 +1997-11-04,17.75,18.12,17.50,17.94,6033200,4.49 +1997-11-03,17.56,17.75,17.06,17.37,4512000,4.34 +1997-10-31,17.37,17.37,16.62,17.03,9549200,4.26 +1997-10-30,17.06,17.56,16.50,16.50,6764400,4.12 +1997-10-29,18.44,18.50,17.25,17.50,6355200,4.38 +1997-10-28,16.00,18.50,15.88,18.12,12273200,4.53 +1997-10-27,16.75,18.12,16.75,16.75,11764400,4.19 +1997-10-24,18.12,18.37,16.50,16.56,13880000,4.14 +1997-10-23,18.00,18.19,17.75,17.75,6688000,4.44 +1997-10-22,19.06,19.25,18.50,18.56,5421200,4.64 +1997-10-21,18.87,19.31,18.69,19.06,16982000,4.76 +1997-10-20,20.12,20.19,18.62,18.69,14724400,4.67 +1997-10-17,21.12,21.12,19.87,20.12,15682000,5.03 +1997-10-16,21.12,22.06,20.87,21.50,26422000,5.38 +1997-10-15,22.12,24.75,22.12,23.81,28982000,5.95 +1997-10-14,22.69,22.75,22.19,22.69,5923200,5.67 +1997-10-13,22.75,22.87,22.19,22.69,5679200,5.67 +1997-10-10,21.50,22.75,21.50,22.69,9666800,5.67 +1997-10-09,21.25,22.50,21.19,21.75,6696400,5.44 +1997-10-08,21.75,21.81,21.31,21.50,3891200,5.38 +1997-10-07,21.87,22.00,21.81,21.81,3916400,5.45 +1997-10-06,22.19,22.25,21.69,21.94,3338800,5.49 +1997-10-03,22.00,22.25,21.69,22.12,5813200,5.53 +1997-10-02,21.44,22.00,21.37,21.94,4856400,5.49 +1997-10-01,21.69,21.75,21.37,21.53,4670800,5.38 +1997-09-30,22.00,22.31,21.69,21.69,5032000,5.42 +1997-09-29,21.69,22.25,21.56,22.06,5980000,5.51 +1997-09-26,21.50,21.94,21.12,21.31,7440000,5.33 +1997-09-25,21.31,21.75,21.00,21.12,7988000,5.28 +1997-09-24,21.69,21.75,21.37,21.50,7957600,5.38 +1997-09-23,22.25,22.25,21.69,21.75,7163200,5.44 +1997-09-22,22.12,23.06,22.00,22.81,7176400,5.70 +1997-09-19,22.19,22.19,21.75,21.94,3407600,5.49 +1997-09-18,21.50,22.50,21.50,22.31,6042400,5.58 +1997-09-17,22.00,22.00,21.69,21.81,3109200,5.45 +1997-09-16,22.06,22.14,21.75,21.94,4812400,5.49 +1997-09-15,21.87,22.12,21.50,21.50,3473200,5.38 +1997-09-12,22.19,22.25,21.44,22.06,4071200,5.51 +1997-09-11,22.87,23.00,22.06,22.37,7504400,5.59 +1997-09-10,21.75,23.12,21.69,22.94,9803600,5.74 +1997-09-09,21.31,21.87,21.25,21.81,5702000,5.45 +1997-09-08,22.25,22.25,21.44,21.50,6264400,5.38 +1997-09-05,22.62,22.87,22.00,22.19,4883600,5.55 +1997-09-04,22.56,22.87,22.25,22.50,4385600,5.62 +1997-09-03,22.37,23.25,22.31,22.50,10163200,5.62 +1997-09-02,22.00,22.56,21.94,22.37,6646800,5.59 +1997-08-29,21.81,22.00,21.50,21.75,3937600,5.44 +1997-08-28,22.12,22.50,22.00,22.00,3426400,5.50 +1997-08-27,22.37,22.75,21.87,22.69,6813200,5.67 +1997-08-26,22.62,23.00,22.12,22.25,8100800,5.56 +1997-08-25,23.62,23.69,22.94,23.06,4968800,5.76 +1997-08-22,23.44,24.00,23.37,23.62,8135200,5.91 +1997-08-21,24.50,24.69,23.87,24.00,9271200,6.00 +1997-08-20,24.44,25.12,24.19,24.62,11595200,6.16 +1997-08-19,23.69,24.50,23.31,24.44,10331200,6.11 +1997-08-18,23.31,23.75,22.75,23.62,7791200,5.91 +1997-08-15,23.12,23.44,22.81,23.25,9320000,5.81 +1997-08-14,23.62,24.25,22.69,23.00,15536400,5.75 +1997-08-13,22.25,23.87,20.44,23.62,42923600,5.91 +1997-08-12,24.06,24.25,21.87,22.06,37444400,5.51 +1997-08-11,26.31,26.44,23.50,24.56,55411200,6.14 +1997-08-08,27.81,28.37,26.12,26.81,64809200,6.70 +1997-08-07,28.75,29.56,28.37,29.19,134124400,7.30 +1997-08-06,25.25,27.75,25.00,26.31,149671200,6.58 +1997-08-05,19.94,20.00,19.48,19.75,8840800,4.94 +1997-08-04,19.19,19.81,19.19,19.75,21851200,4.94 +1997-08-01,17.62,19.19,17.56,19.19,17217600,4.80 +1997-07-31,17.37,17.75,17.25,17.50,9434400,4.38 +1997-07-30,16.94,17.69,16.75,17.37,13372400,4.34 +1997-07-29,16.44,16.62,16.37,16.50,2558000,4.12 +1997-07-28,16.44,16.50,16.25,16.44,3962000,4.11 +1997-07-25,15.88,16.56,15.75,16.25,7798000,4.06 +1997-07-24,16.12,16.12,15.63,15.81,4772000,3.95 +1997-07-23,16.75,16.87,16.00,16.12,5049200,4.03 +1997-07-22,16.37,16.69,16.31,16.56,8274400,4.14 +1997-07-21,17.56,17.69,16.00,16.16,12695600,4.04 +1997-07-18,17.87,17.94,17.06,17.34,11353600,4.34 +1997-07-17,17.00,18.12,16.44,17.50,26659200,4.38 +1997-07-16,15.81,16.50,15.63,16.44,15947600,4.11 +1997-07-15,15.75,16.00,15.63,15.94,14953200,3.98 +1997-07-14,15.25,15.63,14.88,15.63,14700800,3.91 +1997-07-11,13.38,15.50,13.31,15.19,26252400,3.80 +1997-07-10,12.88,13.38,12.75,13.25,17606400,3.31 +1997-07-09,13.81,13.88,13.63,13.69,5090000,3.42 +1997-07-08,13.88,14.00,13.69,13.75,3427600,3.44 +1997-07-07,13.94,14.25,13.75,13.81,6860000,3.45 +1997-07-03,13.13,13.88,13.00,13.69,6688000,3.42 +1997-07-02,13.25,13.38,13.00,13.06,8931200,3.27 +1997-07-01,13.94,14.00,13.13,13.19,16104400,3.30 +1997-06-30,14.75,14.75,14.00,14.25,6132400,3.56 +1997-06-27,14.69,14.81,14.63,14.69,5642000,3.67 +1997-06-26,15.13,15.13,14.63,14.69,13643600,3.67 +1997-06-25,15.31,15.38,15.00,15.13,7102000,3.78 +1997-06-24,15.44,15.56,15.25,15.31,3974800,3.83 +1997-06-23,15.50,15.63,15.38,15.38,3574800,3.85 +1997-06-20,15.69,15.75,15.50,15.56,3943600,3.89 +1997-06-19,16.00,16.00,15.69,15.75,4323600,3.94 +1997-06-18,16.12,16.25,15.75,15.94,3936400,3.98 +1997-06-17,15.56,16.50,15.50,16.34,5080800,4.09 +1997-06-16,15.88,15.88,15.38,15.50,4800800,3.88 +1997-06-13,16.06,16.12,15.75,15.81,4737600,3.95 +1997-06-12,16.37,16.37,16.00,16.06,2816400,4.01 +1997-06-11,16.31,16.44,16.25,16.31,3766800,4.08 +1997-06-10,16.75,16.75,16.06,16.25,4969200,4.06 +1997-06-09,16.69,16.94,16.62,16.62,2689200,4.16 +1997-06-06,16.62,16.75,16.50,16.75,1893200,4.19 +1997-06-05,16.62,17.12,16.56,16.69,2323200,4.17 +1997-06-04,16.62,16.75,16.50,16.62,2889200,4.16 +1997-06-03,16.75,16.94,16.62,16.69,2335600,4.17 +1997-06-02,17.00,17.00,16.75,16.94,1488000,4.24 +1997-05-30,16.50,17.00,16.37,16.62,6340800,4.16 +1997-05-29,17.12,17.12,16.62,16.62,3976800,4.16 +1997-05-28,17.37,17.50,17.00,17.00,3130000,4.25 +1997-05-27,16.75,17.37,16.75,17.25,2938000,4.31 +1997-05-23,16.62,17.00,16.62,16.87,2413200,4.22 +1997-05-22,16.75,16.87,16.50,16.62,2753600,4.16 +1997-05-21,17.12,17.12,16.50,16.87,4369200,4.22 +1997-05-20,17.00,17.44,16.75,17.25,3046400,4.31 +1997-05-19,17.50,17.62,17.00,17.00,1881200,4.25 +1997-05-16,17.50,17.62,17.25,17.25,3338800,4.31 +1997-05-15,17.75,18.00,17.50,17.75,3544800,4.44 +1997-05-14,17.87,18.00,17.50,17.69,4846800,4.42 +1997-05-13,17.50,17.87,17.00,17.56,7056800,4.39 +1997-05-12,17.25,17.62,17.00,17.56,5898800,4.39 +1997-05-09,17.00,17.50,17.00,17.06,6732000,4.26 +1997-05-08,16.62,17.12,16.50,17.00,2963200,4.25 +1997-05-07,16.87,17.00,16.37,16.50,4101200,4.12 +1997-05-06,17.00,17.12,16.75,16.87,2974800,4.22 +1997-05-05,17.00,17.12,16.75,17.00,3538800,4.25 +1997-05-02,17.00,17.12,16.75,17.00,3643600,4.25 +1997-05-01,16.87,17.12,16.75,17.00,2596800,4.25 +1997-04-30,17.00,17.25,16.75,17.00,9202000,4.25 +1997-04-29,18.00,18.00,17.50,17.69,1853200,4.42 +1997-04-28,17.75,17.87,17.50,17.62,1687600,4.41 +1997-04-25,17.62,17.87,17.37,17.50,3121200,4.38 +1997-04-24,18.50,18.50,17.75,17.87,2696800,4.47 +1997-04-23,18.37,18.50,18.12,18.12,1960800,4.53 +1997-04-22,18.12,18.50,17.87,18.50,3392000,4.62 +1997-04-21,18.62,18.62,18.00,18.00,3197600,4.50 +1997-04-18,19.12,19.12,18.37,18.37,5058000,4.59 +1997-04-17,18.25,19.12,18.12,19.00,7859200,4.75 +1997-04-16,18.62,19.00,18.37,18.56,3101200,4.64 +1997-04-15,19.12,19.25,18.12,18.44,4869200,4.61 +1997-04-14,18.37,18.87,18.00,18.75,4020000,4.69 +1997-04-11,18.87,18.87,18.12,18.25,2842400,4.56 +1997-04-10,19.00,19.12,18.50,18.87,4188000,4.72 +1997-04-09,19.25,19.25,18.87,19.00,8766400,4.75 +1997-04-08,19.62,19.62,18.62,19.12,6923600,4.78 +1997-04-07,19.75,19.87,19.25,19.50,9136800,4.88 +1997-04-04,19.12,19.62,19.00,19.25,16980800,4.81 +1997-04-03,18.50,19.12,18.25,18.87,19603200,4.72 +1997-04-02,17.87,18.06,17.62,18.00,7957600,4.50 +1997-04-01,17.62,17.81,17.37,17.50,7881200,4.38 +1997-03-31,18.62,19.37,17.25,18.25,34658000,4.56 +1997-03-27,17.50,19.25,17.25,18.62,40695200,4.66 +1997-03-26,16.37,16.87,16.25,16.75,3824400,4.19 +1997-03-25,16.62,16.62,16.08,16.50,4031200,4.12 +1997-03-24,16.50,16.62,16.25,16.50,2556800,4.12 +1997-03-21,17.50,17.50,16.37,16.62,4892400,4.16 +1997-03-20,16.00,17.50,15.88,17.25,11324400,4.31 +1997-03-19,16.37,16.37,15.88,16.12,7457600,4.03 +1997-03-18,16.37,16.50,16.12,16.25,4548800,4.06 +1997-03-17,16.25,16.50,16.00,16.50,6886400,4.12 +1997-03-14,16.37,16.75,16.25,16.56,8245600,4.14 +1997-03-13,16.37,16.37,16.12,16.37,3772000,4.09 +1997-03-12,16.25,16.75,16.12,16.25,2544400,4.06 +1997-03-11,16.62,16.62,16.00,16.37,3539200,4.09 +1997-03-10,16.62,16.75,16.44,16.62,3554800,4.16 +1997-03-07,16.75,16.75,16.37,16.50,2523200,4.12 +1997-03-06,17.00,17.00,16.50,16.62,4172000,4.16 +1997-03-05,16.62,17.00,16.50,17.00,3453600,4.25 +1997-03-04,16.25,16.50,16.00,16.50,3688800,4.12 +1997-03-03,16.50,16.50,16.00,16.12,4670000,4.03 +1997-02-28,16.87,16.87,16.25,16.25,4371200,4.06 +1997-02-27,17.00,17.12,16.75,17.00,3700000,4.25 +1997-02-26,17.00,17.12,16.75,17.12,3687600,4.28 +1997-02-25,17.00,17.37,16.87,16.87,4938000,4.22 +1997-02-24,16.25,16.87,16.25,16.62,4222000,4.16 +1997-02-21,16.87,17.00,16.00,16.37,7549200,4.09 +1997-02-20,17.62,17.62,17.00,17.00,4474800,4.25 +1997-02-19,17.87,17.87,17.12,17.62,8627600,4.41 +1997-02-18,16.62,17.87,16.25,17.87,13171200,4.47 +1997-02-14,16.25,16.37,16.00,16.31,8492000,4.08 +1997-02-13,15.75,16.12,15.50,16.12,7013200,4.03 +1997-02-12,15.75,15.88,15.50,15.75,6303600,3.94 +1997-02-11,15.88,16.00,15.50,15.69,5004400,3.92 +1997-02-10,16.12,16.12,15.63,15.63,6633600,3.91 +1997-02-07,16.50,16.50,15.75,15.81,8403600,3.95 +1997-02-06,15.25,16.12,15.25,16.00,14283600,4.00 +1997-02-05,15.25,15.63,15.25,15.25,14093600,3.81 +1997-02-04,16.25,16.37,15.13,15.38,25458000,3.85 +1997-02-03,16.87,17.00,16.25,16.31,13162000,4.08 +1997-01-31,16.62,16.62,16.50,16.62,7135200,4.16 +1997-01-30,16.75,16.75,16.50,16.75,5018800,4.19 +1997-01-29,16.62,16.75,16.50,16.62,5428000,4.16 +1997-01-28,17.00,17.00,16.50,16.62,7520000,4.16 +1997-01-27,17.12,17.25,16.62,16.62,7646800,4.16 +1997-01-24,17.25,17.25,16.87,16.87,6726800,4.22 +1997-01-23,17.25,17.37,17.12,17.25,6175200,4.31 +1997-01-22,17.37,17.50,17.00,17.19,7356800,4.30 +1997-01-21,17.00,17.25,16.87,17.25,10179200,4.31 +1997-01-20,16.87,17.12,16.75,16.94,10423600,4.24 +1997-01-17,16.75,17.12,16.62,16.75,11619200,4.19 +1997-01-16,17.12,17.12,16.62,16.75,23983600,4.19 +1997-01-15,18.00,18.00,17.12,17.25,15483200,4.31 +1997-01-14,18.37,18.37,17.75,17.87,9143200,4.47 +1997-01-13,18.50,18.50,18.12,18.12,10942000,4.53 +1997-01-10,17.62,18.25,17.62,18.25,12651200,4.56 +1997-01-09,17.75,17.87,17.50,17.75,15970000,4.44 +1997-01-08,18.25,18.37,17.37,17.62,39296400,4.41 +1997-01-07,18.12,18.25,17.50,17.50,34896400,4.38 +1997-01-06,17.62,18.34,17.25,17.87,67246400,4.47 +1997-01-03,21.12,22.25,21.00,21.75,4295600,5.44 +1997-01-02,21.12,21.25,20.75,21.00,5128800,5.25 +1996-12-31,21.37,21.50,20.75,20.87,13719200,5.22 +1996-12-30,23.12,23.25,21.75,21.75,9366800,5.44 +1996-12-27,22.87,23.75,22.87,23.12,4900000,5.78 +1996-12-26,23.25,23.25,22.87,23.00,3049200,5.75 +1996-12-24,23.25,23.37,22.87,23.12,2067600,5.78 +1996-12-23,24.00,24.25,23.25,23.25,11883600,5.81 +1996-12-20,22.50,23.62,21.37,23.50,19535600,5.88 +1996-12-19,23.00,23.25,22.25,22.25,4893600,5.56 +1996-12-18,22.75,23.12,22.62,23.12,7326400,5.78 +1996-12-17,22.37,22.50,22.25,22.50,5625200,5.62 +1996-12-16,23.50,23.50,22.50,22.62,5335600,5.66 +1996-12-13,23.75,23.87,23.25,23.25,3194400,5.81 +1996-12-12,24.12,24.25,23.87,23.87,3122400,5.97 +1996-12-11,23.75,24.25,23.75,24.00,5853600,6.00 +1996-12-10,24.87,25.00,24.25,24.50,6593600,6.12 +1996-12-09,25.25,25.37,24.81,25.00,5680800,6.25 +1996-12-06,24.37,25.37,24.00,25.12,8210800,6.28 +1996-12-05,25.00,25.25,25.00,25.00,5096800,6.25 +1996-12-04,25.12,25.37,24.87,25.00,6823600,6.25 +1996-12-03,25.25,25.50,25.00,25.12,9840800,6.28 +1996-12-02,24.12,25.12,23.87,25.12,6254400,6.28 +1996-11-29,24.50,24.62,24.00,24.12,1527600,6.03 +1996-11-27,24.12,24.62,24.12,24.50,3191200,6.12 +1996-11-26,24.87,25.00,24.00,24.25,4054800,6.06 +1996-11-25,25.37,25.50,25.00,25.00,2830800,6.25 +1996-11-22,24.50,25.25,24.50,25.25,3732400,6.31 +1996-11-21,24.87,25.00,24.37,24.50,2522400,6.12 +1996-11-20,24.87,25.37,24.87,25.00,3683200,6.25 +1996-11-19,24.87,25.12,24.62,24.87,4446400,6.22 +1996-11-18,25.00,25.12,24.50,24.75,5468800,6.19 +1996-11-15,25.87,26.00,25.00,25.00,4684400,6.25 +1996-11-14,25.50,25.75,25.37,25.62,1740800,6.41 +1996-11-13,25.37,25.87,25.00,25.56,3000800,6.39 +1996-11-12,26.12,26.25,25.12,25.25,5120000,6.31 +1996-11-11,26.37,26.37,25.87,26.00,3318800,6.50 +1996-11-08,25.87,26.25,25.75,26.25,6750800,6.56 +1996-11-07,25.37,26.00,25.25,25.87,5548800,6.47 +1996-11-06,25.62,25.75,24.87,25.50,6462000,6.38 +1996-11-05,24.50,25.87,24.50,25.50,13517600,6.38 +1996-11-04,24.37,24.50,23.75,24.37,3270800,6.09 +1996-11-01,23.37,24.25,23.12,24.25,7563200,6.06 +1996-10-31,23.25,23.37,22.25,23.00,6945600,5.75 +1996-10-30,23.50,24.00,22.87,22.87,9192000,5.72 +1996-10-29,24.62,24.75,23.12,23.25,7135200,5.81 +1996-10-28,25.12,25.12,24.50,24.50,4288800,6.12 +1996-10-25,24.87,25.00,24.50,24.50,2775600,6.12 +1996-10-24,25.00,25.00,24.50,24.75,3020800,6.19 +1996-10-23,24.75,25.25,24.37,24.75,5736800,6.19 +1996-10-22,25.62,25.62,24.25,24.87,7651200,6.22 +1996-10-21,26.50,26.62,25.50,25.62,6712000,6.41 +1996-10-18,26.50,26.62,26.00,26.56,13681200,6.64 +1996-10-17,27.50,27.75,26.37,26.37,36679200,6.59 +1996-10-16,25.25,26.12,24.62,25.75,11975200,6.44 +1996-10-15,25.75,25.87,25.00,25.25,12970000,6.31 +1996-10-14,24.50,25.37,24.25,25.25,9649200,6.31 +1996-10-11,24.37,24.62,24.00,24.25,4327600,6.06 +1996-10-10,23.87,24.50,23.75,24.19,9883200,6.05 +1996-10-09,23.37,23.62,22.87,23.00,3044800,5.75 +1996-10-08,23.50,24.25,23.25,23.25,6802000,5.81 +1996-10-07,23.00,23.37,22.87,23.12,3428800,5.78 +1996-10-04,22.87,23.12,22.12,22.81,4770000,5.70 +1996-10-03,23.62,23.75,22.37,22.37,8140000,5.59 +1996-10-02,23.62,24.62,23.12,23.62,9890000,5.91 +1996-10-01,22.00,24.75,22.00,24.62,19269200,6.16 +1996-09-30,22.12,22.37,22.12,22.19,3058000,5.55 +1996-09-27,22.25,22.37,22.12,22.31,2932000,5.58 +1996-09-26,22.37,22.50,22.25,22.37,3693600,5.59 +1996-09-25,22.50,22.62,22.00,22.37,3902400,5.59 +1996-09-24,22.37,22.87,22.37,22.50,5143600,5.62 +1996-09-23,22.87,22.87,22.37,22.37,1653600,5.59 +1996-09-20,23.37,23.50,22.75,22.87,5330800,5.72 +1996-09-19,23.62,23.62,23.37,23.37,4282000,5.84 +1996-09-18,23.00,24.12,22.87,23.50,12631200,5.88 +1996-09-17,22.87,23.12,22.50,23.00,7487600,5.75 +1996-09-16,21.50,23.00,21.37,22.37,8747600,5.59 +1996-09-13,20.37,21.25,20.37,21.00,5967600,5.25 +1996-09-12,21.00,21.12,20.25,20.37,9340000,5.09 +1996-09-11,21.50,21.75,21.00,21.12,5266800,5.28 +1996-09-10,22.12,22.12,21.50,21.50,5562000,5.38 +1996-09-09,22.62,22.75,21.87,22.00,5302400,5.50 +1996-09-06,23.12,23.25,22.62,23.00,8602000,5.75 +1996-09-05,23.50,23.75,22.87,22.87,9999200,5.72 +1996-09-04,23.87,24.62,23.87,24.12,3636400,6.03 +1996-09-03,24.12,24.37,23.87,24.12,2461200,6.03 +1996-08-30,24.75,24.75,24.25,24.25,3784800,6.06 +1996-08-29,24.87,24.87,24.37,24.50,3829200,6.12 +1996-08-28,24.87,25.00,24.50,24.87,5844400,6.22 +1996-08-27,24.12,25.00,24.00,24.86,10339200,6.22 +1996-08-26,23.87,24.12,23.50,24.12,3204400,6.03 +1996-08-23,23.00,24.00,23.00,23.87,7281200,5.97 +1996-08-22,23.00,23.25,22.87,23.25,3138000,5.81 +1996-08-21,23.50,23.62,22.87,23.00,4052400,5.75 +1996-08-20,23.87,23.87,23.37,23.50,7564400,5.88 +1996-08-19,22.37,23.62,22.37,23.62,8084400,5.91 +1996-08-16,22.62,22.62,22.12,22.50,5075600,5.62 +1996-08-15,22.62,22.75,22.25,22.25,3845600,5.56 +1996-08-14,22.62,23.00,22.62,22.75,2570000,5.69 +1996-08-13,22.87,23.12,22.37,22.50,3706400,5.62 +1996-08-12,23.37,23.62,22.37,23.00,5408000,5.75 +1996-08-09,22.25,23.37,22.12,23.12,8243600,5.78 +1996-08-08,22.37,22.37,21.87,22.12,3640000,5.53 +1996-08-07,21.75,22.62,21.62,22.37,8892400,5.59 +1996-08-06,21.00,21.50,20.75,21.50,3354800,5.38 +1996-08-05,21.62,21.87,20.87,21.00,3612000,5.25 +1996-08-02,21.62,22.00,21.25,21.62,4574800,5.41 +1996-08-01,22.00,22.00,21.12,21.25,3942400,5.31 +1996-07-31,21.25,22.00,21.25,22.00,3332400,5.50 +1996-07-30,22.62,22.75,21.25,21.37,6766800,5.34 +1996-07-29,22.00,22.50,21.75,22.25,7005600,5.56 +1996-07-26,21.50,22.00,21.12,22.00,4426800,5.50 +1996-07-25,21.12,21.37,20.75,21.00,4090800,5.25 +1996-07-24,20.00,21.00,19.87,20.81,9448800,5.20 +1996-07-23,20.50,20.62,20.25,20.50,4651200,5.12 +1996-07-22,20.87,20.87,20.00,20.25,5456400,5.06 +1996-07-19,20.87,21.00,20.75,20.75,9510000,5.19 +1996-07-18,21.50,21.75,20.36,20.87,32058800,5.22 +1996-07-17,17.37,17.50,16.62,16.87,8355600,4.22 +1996-07-16,17.37,17.37,16.00,16.87,10334400,4.22 +1996-07-15,18.12,18.12,17.12,17.19,4779200,4.30 +1996-07-12,18.37,18.37,17.25,18.06,9610800,4.51 +1996-07-11,18.75,18.87,17.37,17.87,10420000,4.47 +1996-07-10,19.12,19.50,18.75,18.75,6055200,4.69 +1996-07-09,19.50,19.62,19.00,19.00,6723600,4.75 +1996-07-08,19.62,19.87,19.00,19.12,6762000,4.78 +1996-07-05,19.37,19.75,19.25,19.50,3808800,4.88 +1996-07-03,20.37,20.37,19.37,19.37,10323200,4.84 +1996-07-02,21.37,21.50,21.00,21.00,3189200,5.25 +1996-07-01,21.12,21.50,21.00,21.50,4732400,5.38 +1996-06-28,20.87,21.00,20.62,21.00,4138000,5.25 +1996-06-27,20.00,21.00,19.75,20.62,8202400,5.16 +1996-06-26,20.62,20.75,19.62,19.87,14440800,4.97 +1996-06-25,22.12,22.25,20.37,20.62,8831200,5.16 +1996-06-24,22.62,22.62,22.12,22.25,4398000,5.56 +1996-06-21,22.87,22.87,22.37,22.62,5792000,5.66 +1996-06-20,23.37,23.37,22.50,22.75,5260800,5.69 +1996-06-19,23.12,23.37,22.62,23.12,4803600,5.78 +1996-06-18,23.62,23.75,22.62,22.75,7979200,5.69 +1996-06-17,24.12,24.12,23.62,23.62,4052000,5.91 +1996-06-14,24.75,24.75,23.87,23.94,5186800,5.99 +1996-06-13,24.37,24.92,24.00,24.62,6856800,6.16 +1996-06-12,24.50,24.50,24.00,24.25,5440000,6.06 +1996-06-11,24.25,24.25,24.00,24.00,5481200,6.00 +1996-06-10,24.37,24.50,24.00,24.12,3820800,6.03 +1996-06-07,24.00,24.37,23.50,24.37,9565200,6.09 +1996-06-06,25.00,25.25,24.12,24.25,12938800,6.06 +1996-06-05,25.37,25.50,24.25,25.12,18228000,6.28 +1996-06-04,24.00,24.37,23.87,24.19,27235600,6.05 +1996-06-03,25.87,26.00,24.75,24.75,4481200,6.19 +1996-05-31,25.62,26.62,25.50,26.12,5813600,6.53 +1996-05-30,24.87,25.75,24.75,25.50,3703600,6.38 +1996-05-29,26.25,26.25,24.75,24.87,7840000,6.22 +1996-05-28,26.75,27.25,26.37,26.37,3658800,6.59 +1996-05-24,26.25,26.87,26.12,26.75,4046800,6.69 +1996-05-23,26.12,26.62,25.75,26.25,4447600,6.56 +1996-05-22,27.37,27.37,25.75,26.06,7215600,6.51 +1996-05-21,28.00,28.12,27.12,27.12,4088000,6.78 +1996-05-20,27.87,28.12,27.62,27.94,3028800,6.99 +1996-05-17,28.37,28.37,27.50,27.62,4405600,6.91 +1996-05-16,28.25,28.62,27.87,28.37,4648800,7.09 +1996-05-15,27.87,28.87,27.75,28.50,10442400,7.12 +1996-05-14,27.75,28.00,27.50,27.50,7068000,6.88 +1996-05-13,27.12,27.62,26.62,27.06,6701200,6.76 +1996-05-10,26.25,27.37,26.00,27.25,3966400,6.81 +1996-05-09,26.37,26.50,25.75,26.12,3515600,6.53 +1996-05-08,27.25,27.25,25.62,26.75,6688800,6.69 +1996-05-07,26.37,27.37,26.25,26.87,12641200,6.72 +1996-05-06,24.87,25.87,24.75,25.62,10349200,6.41 +1996-05-03,24.12,24.12,23.50,23.87,3892400,5.97 +1996-05-02,24.50,24.50,23.50,23.75,6728000,5.94 +1996-05-01,24.37,24.75,24.12,24.37,4039200,6.09 +1996-04-30,24.87,24.87,24.12,24.37,4881200,6.09 +1996-04-29,25.00,25.00,24.50,24.75,4324800,6.19 +1996-04-26,25.00,25.12,24.62,24.75,6759200,6.19 +1996-04-25,24.37,24.87,24.12,24.87,6245200,6.22 +1996-04-24,24.62,24.75,24.19,24.25,4596800,6.06 +1996-04-23,25.12,25.25,24.62,24.75,6086400,6.19 +1996-04-22,25.25,25.50,24.87,25.12,3973200,6.28 +1996-04-19,24.62,25.12,24.62,25.06,3655600,6.26 +1996-04-18,25.37,25.39,24.25,24.75,7780800,6.19 +1996-04-17,25.87,26.00,25.12,25.25,3056400,6.31 +1996-04-16,25.87,26.00,25.62,25.87,3634400,6.47 +1996-04-15,25.50,25.75,25.00,25.75,5515600,6.44 +1996-04-12,25.87,25.87,25.37,25.50,2924400,6.38 +1996-04-11,26.12,26.25,25.50,25.75,3526400,6.44 +1996-04-10,26.12,26.50,25.87,26.00,6242400,6.50 +1996-04-09,24.87,26.50,24.37,26.00,8415600,6.50 +1996-04-08,23.87,24.50,23.75,24.37,6046400,6.09 +1996-04-04,24.62,24.62,24.00,24.12,3092000,6.03 +1996-04-03,25.12,25.12,24.33,24.56,2591200,6.14 +1996-04-02,25.62,25.62,24.87,25.00,3635600,6.25 +1996-04-01,25.12,25.87,24.52,25.50,5680000,6.38 +1996-03-29,24.25,24.75,23.75,24.56,5962400,6.14 +1996-03-28,24.75,25.62,24.12,24.19,10572000,6.05 +1996-03-27,23.25,25.25,23.00,25.25,15338800,6.31 +1996-03-26,24.00,24.50,23.62,23.87,5755600,5.97 +1996-03-25,25.50,25.75,24.00,24.00,5887600,6.00 +1996-03-22,25.25,25.37,24.87,25.37,3842400,6.34 +1996-03-21,25.50,25.50,25.00,25.12,3932400,6.28 +1996-03-20,25.75,25.75,25.12,25.25,4154800,6.31 +1996-03-19,26.37,26.50,25.62,25.75,4442400,6.44 +1996-03-18,25.94,26.12,25.75,26.12,3907600,6.53 +1996-03-15,26.00,26.00,25.50,25.87,3632400,6.47 +1996-03-14,25.87,25.87,25.50,25.62,3342400,6.41 +1996-03-13,25.87,26.12,25.62,25.75,3560000,6.44 +1996-03-12,26.00,26.37,25.62,25.81,3453200,6.45 +1996-03-11,26.25,26.37,25.75,25.87,4544800,6.47 +1996-03-08,25.75,26.25,25.00,26.00,5322400,6.50 +1996-03-07,26.25,26.37,25.37,25.81,9292400,6.45 +1996-03-06,26.75,26.87,26.12,26.19,3547600,6.55 +1996-03-05,26.50,26.75,26.25,26.62,4246800,6.66 +1996-03-04,27.25,27.37,26.25,26.25,6708800,6.56 +1996-03-01,27.62,27.62,26.62,26.87,8263200,6.72 +1996-02-29,27.50,27.75,27.25,27.50,4049200,6.88 +1996-02-28,28.87,28.87,27.62,27.75,6728800,6.94 +1996-02-27,29.87,29.87,28.50,28.62,5331200,7.16 +1996-02-26,30.00,30.12,29.50,29.50,4238000,7.38 +1996-02-23,29.87,30.25,29.62,29.87,6205200,7.47 +1996-02-22,30.00,30.12,29.62,29.87,6588000,7.47 +1996-02-21,29.37,29.75,29.12,29.62,7924400,7.41 +1996-02-20,28.00,29.50,28.00,29.00,13473200,7.25 +1996-02-16,28.12,28.37,27.50,27.50,5602400,6.88 +1996-02-15,27.62,28.12,27.37,28.00,4360000,7.00 +1996-02-14,28.25,28.25,27.44,27.62,5843600,6.91 +1996-02-13,28.00,28.87,27.87,28.12,8161200,7.03 +1996-02-12,28.12,28.50,28.00,28.37,6948800,7.09 +1996-02-09,27.87,28.50,27.62,27.75,7360800,6.94 +1996-02-08,27.50,28.12,27.50,27.87,9420800,6.97 +1996-02-07,29.75,29.75,27.75,28.25,12885200,7.06 +1996-02-06,29.25,30.00,29.25,29.62,8101200,7.41 +1996-02-05,29.69,29.75,29.00,29.25,11396400,7.31 +1996-02-02,28.87,29.62,28.75,29.25,19865600,7.31 +1996-02-01,27.50,28.37,27.50,28.37,11902400,7.09 +1996-01-31,27.75,28.00,27.37,27.62,11736800,6.91 +1996-01-30,27.00,28.12,26.86,27.31,22246800,6.83 +1996-01-29,29.00,29.75,28.75,29.12,11900000,7.28 +1996-01-26,30.37,31.25,28.62,30.62,26297600,7.66 +1996-01-25,31.75,32.00,30.12,30.25,15911200,7.56 +1996-01-24,32.13,32.25,31.75,32.25,23438800,8.06 +1996-01-23,33.75,34.00,31.00,31.62,35305200,7.91 +1996-01-22,29.75,31.00,29.25,30.50,17852400,7.62 +1996-01-19,31.00,31.75,29.37,29.87,29623600,7.47 +1996-01-18,32.88,33.38,30.37,31.94,24955200,7.99 +1996-01-17,34.38,34.38,33.75,34.00,8445200,8.50 +1996-01-16,34.38,34.75,33.63,34.56,12606400,8.64 +1996-01-15,33.75,34.50,33.38,34.13,12971200,8.53 +1996-01-12,34.75,34.75,33.25,33.88,14370000,8.47 +1996-01-11,32.63,35.00,32.38,35.00,27041200,8.75 +1996-01-10,32.50,34.75,32.25,34.25,13057600,8.56 +1996-01-09,34.63,34.63,32.75,32.75,8978800,8.19 +1996-01-08,34.50,35.50,34.00,34.63,4341200,8.66 +1996-01-05,31.62,34.25,31.37,34.25,15929200,8.56 +1996-01-04,32.38,32.38,31.37,31.56,10721200,7.89 +1996-01-03,32.00,32.88,31.87,32.13,15368800,8.03 +1996-01-02,32.25,32.25,31.75,32.13,4983200,8.03 +1995-12-29,32.00,32.38,31.62,31.87,10874400,7.97 +1995-12-28,32.13,32.75,31.87,32.00,8933200,8.00 +1995-12-27,32.13,33.38,31.87,32.38,9609200,8.10 +1995-12-26,32.50,32.50,31.75,32.06,4994800,8.02 +1995-12-22,32.63,32.88,32.13,32.25,8392400,8.06 +1995-12-21,32.75,32.75,31.62,32.50,11893200,8.12 +1995-12-20,33.50,33.63,32.50,32.63,13074400,8.16 +1995-12-19,32.75,33.25,32.25,32.75,15403600,8.19 +1995-12-18,35.13,35.25,31.87,32.25,23807600,8.06 +1995-12-15,35.50,36.63,34.38,35.25,25960000,8.81 +1995-12-14,38.88,39.38,38.00,38.25,11928000,9.56 +1995-12-13,38.25,39.00,36.75,38.38,24472400,9.60 +1995-12-12,38.63,38.63,38.00,38.00,6353200,9.50 +1995-12-11,39.50,39.63,38.38,38.63,4003200,9.66 +1995-12-08,38.75,39.38,37.88,39.38,5053200,9.85 +1995-12-07,38.75,38.75,37.88,38.56,5084800,9.64 +1995-12-06,39.75,39.88,38.38,38.75,7195200,9.69 +1995-12-05,38.50,39.88,38.25,39.50,13000000,9.88 +1995-12-04,40.13,40.13,39.00,39.50,17171200,9.88 +1995-12-01,38.00,38.25,37.13,37.63,7300800,9.41 +1995-11-30,38.88,39.00,38.00,38.13,6247600,9.53 +1995-11-29,40.13,40.13,39.00,39.25,3782000,9.81 +1995-11-28,39.38,40.13,39.25,40.00,6305200,10.00 +1995-11-27,40.63,40.63,39.38,39.38,4148800,9.85 +1995-11-24,38.88,40.38,38.75,40.19,3930800,10.05 +1995-11-22,38.63,39.25,38.50,38.63,3533600,9.66 +1995-11-21,38.75,38.75,37.88,38.63,6845200,9.66 +1995-11-20,40.25,40.25,38.50,38.63,5314400,9.63 +1995-11-17,40.00,40.38,39.75,40.13,4607600,10.00 +1995-11-16,40.88,41.50,39.50,39.94,8102000,9.95 +1995-11-15,42.00,42.00,40.13,41.00,8874400,10.22 +1995-11-14,41.00,42.50,41.00,41.50,14560000,10.34 +1995-11-13,40.25,41.25,40.00,40.88,11343200,10.19 +1995-11-10,39.38,40.25,38.88,39.75,7973200,9.91 +1995-11-09,39.75,40.00,38.88,39.38,9295200,9.81 +1995-11-08,39.75,41.00,38.75,38.88,12823600,9.69 +1995-11-07,37.75,40.50,37.50,39.63,26310800,9.88 +1995-11-06,36.50,38.75,36.38,38.13,11143200,9.50 +1995-11-03,36.75,36.88,35.88,36.50,6413200,9.10 +1995-11-02,36.88,36.88,36.25,36.63,5464400,9.13 +1995-11-01,36.63,37.13,35.50,36.63,6913200,9.13 +1995-10-31,35.25,36.63,35.13,36.31,10334400,9.05 +1995-10-30,34.88,35.25,34.63,35.25,6291200,8.79 +1995-10-27,34.88,34.88,34.13,34.75,5523200,8.66 +1995-10-26,34.88,35.00,34.50,34.88,4503600,8.69 +1995-10-25,35.25,35.38,34.75,34.75,4761200,8.66 +1995-10-24,35.50,35.50,34.88,35.13,7638800,8.76 +1995-10-23,35.13,35.13,34.75,35.13,7078000,8.76 +1995-10-20,35.25,35.25,34.63,35.13,13818800,8.76 +1995-10-19,35.88,36.13,34.75,34.75,33761200,8.66 +1995-10-18,37.00,39.56,36.75,37.38,18311200,9.32 +1995-10-17,36.50,36.88,35.88,36.63,6390000,9.13 +1995-10-16,36.25,37.00,35.88,36.13,6515200,9.00 +1995-10-13,35.75,36.88,35.50,36.00,8422000,8.97 +1995-10-12,35.00,35.38,34.75,35.31,5803200,8.80 +1995-10-11,35.25,35.63,34.13,34.88,11893200,8.69 +1995-10-10,34.38,35.00,33.63,34.69,14303600,8.65 +1995-10-09,35.38,35.75,34.38,34.81,13320800,8.68 +1995-10-06,36.75,37.00,35.63,35.69,11058000,8.89 +1995-10-05,36.25,36.63,35.88,36.50,8737600,9.10 +1995-10-04,36.63,37.00,36.00,36.38,9532000,9.07 +1995-10-03,38.13,38.50,37.13,37.63,10368000,9.38 +1995-10-02,37.75,38.50,37.50,37.63,14000000,9.38 +1995-09-29,38.00,38.25,36.88,37.25,10123200,9.28 +1995-09-28,36.50,37.88,36.50,37.75,11843600,9.41 +1995-09-27,37.50,37.50,34.75,36.25,16135600,9.03 +1995-09-26,37.75,37.88,37.13,37.38,8961200,9.32 +1995-09-25,38.25,38.27,37.38,37.52,11267600,9.35 +1995-09-22,36.88,37.25,36.38,37.06,14258000,9.24 +1995-09-21,36.50,37.50,36.38,37.00,12407600,9.22 +1995-09-20,37.25,37.38,36.50,36.63,11500800,9.13 +1995-09-19,36.75,37.13,36.13,36.75,17512400,9.16 +1995-09-18,36.38,36.81,35.88,36.69,22216400,9.14 +1995-09-15,37.38,39.88,35.50,35.88,43286800,8.94 +1995-09-14,41.38,41.63,39.75,40.00,19675600,9.97 +1995-09-13,42.88,43.38,42.00,42.38,11530800,10.56 +1995-09-12,44.50,44.88,42.63,42.94,11658800,10.70 +1995-09-11,44.88,45.50,44.25,44.25,6160800,11.03 +1995-09-08,44.75,44.88,44.50,44.75,6243200,11.15 +1995-09-07,44.00,45.31,43.75,44.75,9373600,11.15 diff --git a/examples/rec_groupby_demo.py b/examples/rec_groupby_demo.py new file mode 100644 index 000000000000..3513d39a9b1d --- /dev/null +++ b/examples/rec_groupby_demo.py @@ -0,0 +1,48 @@ +import numpy as np +import matplotlib.mlab as mlab + + +r = mlab.csv2rec('data/aapl.csv') +r.sort() + +def daily_return(prices): + g = np.zeros_like(prices) + g[1:] = (prices[1:]-prices[:-1])/prices[:-1] + return g + +def volume_code(volume): + ind = np.searchsorted([1e5,1e6, 5e6,10e6, 1e7], volume) + return ind + +summaryfuncs = ( + ('date', lambda x: [thisdate.year for thisdate in x], 'years'), + ('date', lambda x: [thisdate.month for thisdate in x], 'months'), + ('date', lambda x: [thisdate.weekday() for thisdate in x], 'weekday'), + ('adj_close', daily_return, 'dreturn'), + ('volume', volume_code, 'volcode'), + ) + +rsum = mlab.rec_summarize(r, summaryfuncs) + +stats = ( + ('dreturn', len, 'rcnt'), + ('dreturn', np.mean, 'rmean'), + ('dreturn', np.median, 'rmedian'), + ('dreturn', np.std, 'rsigma'), + ) + +print 'summary by years' +ry = mlab.rec_groupby(rsum, ('years',), stats) +print mlab. rec2txt(ry) + +print 'summary by months' +rm = mlab.rec_groupby(rsum, ('months',), stats) +print mlab.rec2txt(rm) + +print 'summary by year and month' +rym = mlab.rec_groupby(rsum, ('years','months'), stats) +print mlab.rec2txt(rym) + +print 'summary by volume' +rv = mlab.rec_groupby(rsum, ('volcode',), stats) +print mlab.rec2txt(rv) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 113766feb98f..903cb5aad346 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -46,18 +46,18 @@ = record array helper functions = + * rec2txt : pretty print a record array * rec2csv : store record array in CSV file - * rec2excel : store record array in excel worksheet - required pyExcelerator - * csv2rec : import record array from CSV file with type inspection * rec_append_field : add a field/array to record array * rec_drop_fields : drop fields from record array * rec_join : join two record arrays on sequence of fields + * rec_groupby : summarize data by groups (similar to SQL GROUP BY) + * rec_summarize : helper code to filter rec array fields into new fields -For the rec viewer clases (rec2csv, rec2excel), there are -a bunch of Format objects you can pass into the functions that will do -things like color negative values red, set percent formatting and -scaling, etc. +For the rec viewer clases (eg rec2csv), there are a bunch of Format +objects you can pass into the functions that will do things like color +negative values red, set percent formatting and scaling, etc. Example usage: @@ -84,7 +84,7 @@ """ from __future__ import division -import sys, datetime, csv, warnings, copy +import sys, datetime, csv, warnings, copy, os import numpy as npy @@ -2045,6 +2045,139 @@ def key_desc(name): return newrec.view(npy.recarray) +def rec_groupby(r, groupby, stats): + """ + r is a numpy record array + + groupby is a sequence of record array attribute names that + together form the grouping key. eg ('date', 'productcode') + + stats is a sequence of (attr, func, outname) which will call x = + func(attr) and assign x to the record array output with attribute + outname. + Eg, stats = ( ('sales', len, 'numsales'), ('sales', npy.mean, 'avgsale') ) + + return record array has dtype names for each attribute name in in + the the 'groupby' argument, with the associated group values, and + for each outname name in the stats argument, with the associated + stat summary output + """ + # build a dictionary from groupby keys-> list of indices into r with + # those keys + rowd = dict() + for i, row in enumerate(r): + key = tuple([row[attr] for attr in groupby]) + rowd.setdefault(key, []).append(i) + + # sort the output by groupby keys + keys = rowd.keys() + keys.sort() + + rows = [] + for key in keys: + row = list(key) + # get the indices for this groupby key + ind = rowd[key] + thisr = r[ind] + # call each stat function for this groupby slice + row.extend([func(thisr[attr]) for attr, func, outname in stats]) + rows.append(row) + + # build the output record array with groupby and outname attributes + attrs, funcs, outnames = zip(*stats) + names = list(groupby) + names.extend(outnames) + return npy.rec.fromrecords(rows, names=names) + + + +def rec_summarize(r, summaryfuncs): + """ + r is a numpy record array + + summaryfuncs is a list of (attr, func, outname) which will + apply codefunc to the the array r[attr] and assign the output + to a new attribute name outname. The returned record array is + identical to r, with extra arrays for each element in summaryfuncs + """ + + names = list(r.dtype.names) + arrays = [r[name] for name in names] + + for attr, func, outname in summaryfuncs: + names.append(outname) + arrays.append(npy.asarray(func(r[attr]))) + + return npy.rec.fromarrays(arrays, names=names) + +def rec_join(key, r1, r2): + """ + join record arrays r1 and r2 on key; key is a tuple of field + names. if r1 and r2 have equal values on all the keys in the key + tuple, then their fields will be merged into a new record array + containing the intersection of the fields of r1 and r2 + """ + + for name in key: + if name not in r1.dtype.names: + raise ValueError('r1 does not have key field %s'%name) + if name not in r2.dtype.names: + raise ValueError('r2 does not have key field %s'%name) + + def makekey(row): + return tuple([row[name] for name in key]) + + r1d = dict([(makekey(row),i) for i,row in enumerate(r1)]) + r2d = dict([(makekey(row),i) for i,row in enumerate(r2)]) + + r1keys = set(r1d.keys()) + r2keys = set(r2d.keys()) + + keys = r1keys & r2keys + + r1ind = npy.array([r1d[k] for k in keys]) + r2ind = npy.array([r2d[k] for k in keys]) + + # Make sure that the output rows have the same relative order as r1 + sortind = r1ind.argsort() + + r1 = r1[r1ind[sortind]] + r2 = r2[r2ind[sortind]] + + r2 = rec_drop_fields(r2, r1.dtype.names) + + + def key_desc(name): + 'if name is a string key, use the larger size of r1 or r2 before merging' + dt1 = r1.dtype[name] + if dt1.type != npy.string_: + return (name, dt1.descr[0][1]) + + dt2 = r1.dtype[name] + assert dt2==dt1 + if dt1.num>dt2.num: + return (name, dt1.descr[0][1]) + else: + return (name, dt2.descr[0][1]) + + + + keydesc = [key_desc(name) for name in key] + + newdtype = npy.dtype(keydesc + + [desc for desc in r1.dtype.descr if desc[0] not in key ] + + [desc for desc in r2.dtype.descr if desc[0] not in key ] ) + + + newrec = npy.empty(len(r1), dtype=newdtype) + for field in r1.dtype.names: + newrec[field] = r1[field] + + for field in r2.dtype.names: + newrec[field] = r2[field] + + return newrec.view(npy.recarray) + def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',', converterd=None, names=None, missing=None): """ @@ -2334,6 +2467,97 @@ def csvformat_factory(format): format.fmt = '%r' return format +def rec2txt(r, header=None, padding=3, precision=3): + """ + Returns a textual representation of a record array. + + r - numpy recarray + + header - list of column headers + + padding - space between each column + + precision - number of decimal places to use for floats. + Set to an integer to apply to all floats. Set to a + list of integers to apply precision individually. + Precision for non-floats is simply ignored. + + Example: + precision=[0,2,3] + Output: + ID Price Return + ABC 12.54 0.234 + XYZ 6.32 -0.076 + """ + + if cbook.is_numlike(precision): + precision = [precision]*len(r.dtype) + + def get_type(item,atype=int): + tdict = {None:int, int:float, float:str} + try: atype(str(item)) + except: return get_type(item,tdict[atype]) + return atype + + def get_justify(colname, column, precision): + ntype = type(column[0]) + + if ntype==npy.str or ntype==npy.str_ or ntype==npy.string0 or ntype==npy.string_: + length = max(len(colname),column.itemsize) + return 0, length+padding, "%s" # left justify + + if ntype==npy.int or ntype==npy.int16 or ntype==npy.int32 or ntype==npy.int64 or ntype==npy.int8 or ntype==npy.int_: + length = max(len(colname),npy.max(map(len,map(str,column)))) + return 1, length+padding, "%d" # right justify + + if ntype==npy.float or ntype==npy.float32 or ntype==npy.float64 or ntype==npy.float96 or ntype==npy.float_: + fmt = "%." + str(precision) + "f" + length = max(len(colname),npy.max(map(len,map(lambda x:fmt%x,column)))) + return 1, length+padding, fmt # right justify + + return 0, max(len(colname),npy.max(map(len,map(str,column))))+padding, "%s" + + if header is None: + header = r.dtype.names + + justify_pad_prec = [get_justify(header[i],r.__getitem__(colname),precision[i]) for i, colname in enumerate(r.dtype.names)] + + justify_pad_prec_spacer = [] + for i in range(len(justify_pad_prec)): + just,pad,prec = justify_pad_prec[i] + if i == 0: + justify_pad_prec_spacer.append((just,pad,prec,0)) + else: + pjust,ppad,pprec = justify_pad_prec[i-1] + if pjust == 0 and just == 1: + justify_pad_prec_spacer.append((just,pad-padding,prec,0)) + elif pjust == 1 and just == 0: + justify_pad_prec_spacer.append((just,pad,prec,padding)) + else: + justify_pad_prec_spacer.append((just,pad,prec,0)) + + def format(item, just_pad_prec_spacer): + just, pad, prec, spacer = just_pad_prec_spacer + if just == 0: + return spacer*' ' + str(item).ljust(pad) + else: + if get_type(item) == float: + item = (prec%float(item)) + elif get_type(item) == int: + item = (prec%int(item)) + + return item.rjust(pad) + + textl = [] + textl.append(''.join([format(colitem,justify_pad_prec_spacer[j]) for j, colitem in enumerate(header)])) + for i, row in enumerate(r): + textl.append(''.join([format(colitem,justify_pad_prec_spacer[j]) for j, colitem in enumerate(row)])) + if i==0: + textl[0] = textl[0].rstrip() + + text = os.linesep.join(textl) + return text + def rec2csv(r, fname, delimiter=',', formatd=None): """ Save the data from numpy record array r into a comma/space/tab From 14cc2a4f5ac4e75b5afe77b7afa7798d50043b9b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 25 Feb 2008 20:21:39 +0000 Subject: [PATCH 028/324] [ 1901410 ] Newbie bug report: clip_on set to False actually True svn path=/branches/v0_91_maint/; revision=4987 --- lib/matplotlib/axes.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index bda531792470..468dd4591f32 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -2236,7 +2236,7 @@ def text(self, x, y, s, fontdict=None, #if t.get_clip_on(): t.set_clip_box(self.bbox) - if kwargs.has_key('clip_on'): t.set_clip_box(self.bbox) + if kwargs.get('clip_on'): t.set_clip_box(self.bbox) return t text.__doc__ = cbook.dedent(text.__doc__) % martist.kwdocd @@ -4046,22 +4046,22 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None, 'p' : pentagram 'h' : hexagon '8' : octagon - + The marker can also be a tuple (numsides, style, angle), which will create a custom, regular symbol. - + numsides is the number of sides - + style is the style of the regular symbol: 0 : a regular polygon 1 : a star-like symbol 2 : an asterisk - + angle is the angle of rotation of the symbol - + Finally, marker can be (verts, 0), verts is a sequence of (x,y) vertices for a custom scatter symbol. - + s is a size argument in points squared. Any or all of x, y, s, and c may be masked arrays, in which From d0c410037146272dfbd7af5847062610823e3090 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 29 Feb 2008 14:04:48 +0000 Subject: [PATCH 029/324] Fix classic Wx toolbar pan and zoom functions (Thanks Jeff Peery) svn path=/branches/v0_91_maint/; revision=4991 --- CHANGELOG | 3 +++ lib/matplotlib/backends/backend_wx.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index dcff34f7af8c..7d81dacb9c05 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-02-29 Fix class Wx toolbar pan and zoom functions (Thanks Jeff + Peery) - MGD + 2008-02-16 Added some new rec array functionality to mlab (rec_summarize, rec2txt and rec_groupby). See examples/rec_groupby_demo.py. Thanks to Tim M for rec2txt. diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index dd99bbd6be81..b54b4b3e39c2 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -999,7 +999,7 @@ def gui_repaint(self, drawDC=None): def print_bmp(self, filename, *args, **kwargs): return self._print_image(filename, wx.BITMAP_TYPE_BMP, *args, **kwargs) - + def print_jpeg(self, filename, *args, **kwargs): return self._print_image(filename, wx.BITMAP_TYPE_JPEG, *args, **kwargs) print_jpg = print_jpeg @@ -1009,14 +1009,14 @@ def print_pcx(self, filename, *args, **kwargs): def print_png(self, filename, *args, **kwargs): return self._print_image(filename, wx.BITMAP_TYPE_PNG, *args, **kwargs) - + def print_tiff(self, filename, *args, **kwargs): return self._print_image(filename, wx.BITMAP_TYPE_TIF, *args, **kwargs) print_tif = print_tiff def print_xpm(self, filename, *args, **kwargs): return self._print_image(filename, wx.BITMAP_TYPE_XPM, *args, **kwargs) - + def _print_image(self, filename, filetype, *args, **kwargs): origBitmap = self.bitmap @@ -1055,7 +1055,7 @@ def _print_image(self, filename, filetype, *args, **kwargs): def get_default_filetype(self): return 'png' - + def realize(self): """ This method will be called when the system is ready to draw, @@ -1890,28 +1890,28 @@ def panx(self, direction): DEBUG_MSG("panx()", 1, self) for a in self._active: - a.panx(direction) + a.xaxis.pan(direction) self.canvas.draw() self.canvas.Refresh(eraseBackground=False) def pany(self, direction): DEBUG_MSG("pany()", 1, self) for a in self._active: - a.pany(direction) + a.yaxis.pan(direction) self.canvas.draw() self.canvas.Refresh(eraseBackground=False) def zoomx(self, in_out): DEBUG_MSG("zoomx()", 1, self) for a in self._active: - a.zoomx(in_out) + a.xaxis.zoom(in_out) self.canvas.draw() self.canvas.Refresh(eraseBackground=False) def zoomy(self, in_out): DEBUG_MSG("zoomy()", 1, self) for a in self._active: - a.zoomy(in_out) + a.yaxis.zoom(in_out) self.canvas.draw() self.canvas.Refresh(eraseBackground=False) From eda659acb5043130bbed0b4ea6e933c396626149 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 10 Mar 2008 15:05:30 +0000 Subject: [PATCH 030/324] Fix bug where Wx figures were getting shortened by the height of the status bar (Thanks, Gary Ruben) svn path=/branches/v0_91_maint/; revision=4997 --- lib/matplotlib/backends/backend_wx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index b54b4b3e39c2..43261b78950c 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -1291,9 +1291,9 @@ def __init__(self, num, fig): DEBUG_MSG("__init__()", 1, self) self.num = num - self.canvas = self.get_canvas(fig) statbar = StatusBarWx(self) self.SetStatusBar(statbar) + self.canvas = self.get_canvas(fig) self.sizer =wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND) # By adding toolbar in sizer, we are able to put it at the bottom From 5c7a23b25cee675de9089623be87c8dc3fed26dd Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 10 Mar 2008 15:06:25 +0000 Subject: [PATCH 031/324] Correcting range of subfigure values. This is a backport of 4913 from the trunk: "fixed a bug where annotations w/ arrows were not getting the figure instance set properly" svn path=/branches/v0_91_maint/; revision=4998 --- lib/matplotlib/rcsetup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 2e33bea01521..f559ddc1418c 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -425,13 +425,14 @@ def __call__(self, s): 'figure.facecolor' : [ '0.75', validate_color], # facecolor; scalar gray 'figure.edgecolor' : [ 'w', validate_color], # edgecolor; white - 'figure.subplot.left' : [0.125, ValidateInterval(0, 1, closedmin=False, closedmax=False)], - 'figure.subplot.right' : [0.9, ValidateInterval(0, 1, closedmin=False, closedmax=False)], - 'figure.subplot.bottom' : [0.1, ValidateInterval(0, 1, closedmin=False, closedmax=False)], - 'figure.subplot.top' : [0.9, ValidateInterval(0, 1, closedmin=False, closedmax=False)], - 'figure.subplot.wspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)], - 'figure.subplot.hspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)], - + 'figure.subplot.left' : [0.125, ValidateInterval(0, 1, closedmin=True, closedmax=True)], + 'figure.subplot.right' : [0.9, ValidateInterval(0, 1, closedmin=True, closedmax=True)], + 'figure.subplot.bottom' : [0.1, ValidateInterval(0, 1, closedmin=True, closedmax=True)], + 'figure.subplot.top' : [0.9, ValidateInterval(0, 1, closedmin=True, closedmax=True)], + 'figure.subplot.wspace' : [0.2, ValidateInterval(0, 1, closedmin=True, closedmax=False)], + 'figure.subplot.hspace' : [0.2, ValidateInterval(0, 1, closedmin=True, closedmax=False)], + + 'figure.autolayout' : [False, validate_bool], 'savefig.dpi' : [100, validate_float], # DPI 'savefig.facecolor' : ['w', validate_color], # facecolor; white From 28f5328760bfc606a7e9b4dfd707896ed9118bb0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 21 Mar 2008 13:10:20 +0000 Subject: [PATCH 032/324] Bugfix: [ 1912719 ] TypeError in Exception __get_configdir() Thanks, Andrea Tomasini svn path=/branches/v0_91_maint/; revision=5011 --- lib/matplotlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 84b62476cf1f..5b3c9d537731 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -397,7 +397,7 @@ def _get_configdir(): if os.path.exists(p): if not _is_writable_dir(p): - raise RuntimeError("'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored "%h) + raise RuntimeError("'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored "% (h, h)) else: if not _is_writable_dir(h): raise RuntimeError("Failed to create %s/.matplotlib; consider setting MPLCONFIGDIR to a writable directory for matplotlib configuration data"%h) From 9febe2a0d2fd1bf31c68808986da2065dc403869 Mon Sep 17 00:00:00 2001 From: Manuel Metz Date: Fri, 21 Mar 2008 17:19:37 +0000 Subject: [PATCH 033/324] Bugfix in ContourSet._process_linestyles svn path=/branches/v0_91_maint/; revision=5013 --- lib/matplotlib/contour.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index b28f4d0beaa5..190ed25fa0f3 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -708,7 +708,7 @@ def _process_linestyles(self): else: if cbook.is_string_like(linestyles): tlinestyles = [linestyles] * Nlev - elif cbook.iterable(linestyles) and len(linestyles) < Nlev: + elif cbook.iterable(linestyles) and len(linestyles) <= Nlev: tlinestyles = list(linestyles) * int(npy.ceil(Nlev/len(linestyles))) return tlinestyles From c6d43f0b1265884195b355d5913e6e8965000e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 23 Mar 2008 17:44:11 +0000 Subject: [PATCH 034/324] Fix a pdf backend bug which sometimes caused the outermost gsave to not be balanced with a grestore. svn path=/branches/v0_91_maint/; revision=5018 --- CHANGELOG | 3 +++ lib/matplotlib/backends/backend_pdf.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7d81dacb9c05..70fdc1e7d940 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-03-23 Fix a pdf backend bug which sometimes caused the outermost + gsave to not be balanced with a grestore. - JKS + 2008-02-29 Fix class Wx toolbar pan and zoom functions (Thanks Jeff Peery) - MGD diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 3b380677e113..8ef69fa1d5a9 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -1159,7 +1159,7 @@ def __init__(self, file, dpi): self.tex_font_map = None def finalize(self): - self.gc.finalize() + self.file.output(*self.gc.finalize()) def check_gc(self, gc, fillcolor=None): orig_fill = gc._fillcolor From 0a5f9084ee3d37ef3a821b071d10cd738429a17c Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 26 Mar 2008 14:30:18 +0000 Subject: [PATCH 035/324] Change character ids so they are a hash on the path data itself. (To fix Kaushik Ghose's copy-and-paste in Inkscape bug). svn path=/branches/v0_91_maint/; revision=5021 --- lib/matplotlib/backends/backend_svg.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index afccb20404a9..ee91963bcff8 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -1,6 +1,6 @@ from __future__ import division -import os, codecs, base64, tempfile, urllib, gzip +import os, codecs, base64, tempfile, urllib, gzip, md5 from matplotlib import agg from matplotlib import verbose, __version__, rcParams @@ -388,8 +388,9 @@ def _add_char_def(self, prop, char): if step[0] != 4: currx, curry = step[-2], -step[-1] - char_num = 'c_%x' % len(self._char_defs) - path_element = '\n' % (char_num, ''.join(path_data)) + path_data = ''.join(path_data) + char_num = 'c_%x' % len(self._char_defs) # md5.new(path_data).hexdigest() + path_element = '\n' % (char_num, ''.join(path_data)) self._char_defs[char_id] = char_num return path_element From ca55945698a9d1a11436067790b892f1d1f1a646 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 26 Mar 2008 14:33:35 +0000 Subject: [PATCH 036/324] Change character ids so they are a hash on the path data itself. (To fix Kaushik Ghose's copy-and-paste in Inkscape bug). svn path=/branches/v0_91_maint/; revision=5022 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 70fdc1e7d940..5543cb36301d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-03-26 Fix SVG backend bug that prevents copying and pasting in + Inkscape (thanks Kaushik Ghose) - MGD + 2008-03-23 Fix a pdf backend bug which sometimes caused the outermost gsave to not be balanced with a grestore. - JKS From 4d0a552ec982534376cd0ea19e4a21ea3f06c760 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 26 Mar 2008 14:35:50 +0000 Subject: [PATCH 037/324] Oops in last commit. svn path=/branches/v0_91_maint/; revision=5023 --- lib/matplotlib/backends/backend_svg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index ee91963bcff8..d3302e429eb1 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -389,7 +389,7 @@ def _add_char_def(self, prop, char): if step[0] != 4: currx, curry = step[-2], -step[-1] path_data = ''.join(path_data) - char_num = 'c_%x' % len(self._char_defs) # md5.new(path_data).hexdigest() + char_num = 'c_%s' % md5.new(path_data).hexdigest() path_element = '\n' % (char_num, ''.join(path_data)) self._char_defs[char_id] = char_num return path_element From 72705634323baf5e3994015cab5974d92d8f37bb Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 27 Mar 2008 14:26:19 +0000 Subject: [PATCH 038/324] Fix saving to Unicode filenames in Agg backend. Fix Qt and Qt4 GUI's to support saving to Unicode filenames in file save dialogs. Wx, Gtk and Tk GUIs already appear to work. svn path=/branches/v0_91_maint/; revision=5025 --- CHANGELOG | 4 +++ lib/matplotlib/backends/backend_agg.py | 14 +++++---- lib/matplotlib/backends/backend_qt.py | 2 +- lib/matplotlib/backends/backend_qt4.py | 4 +-- src/_backend_agg.cpp | 40 ++++++++++++++++++++------ 5 files changed, 48 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5543cb36301d..0fcfb4958e51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2008-03-27 Fix saving to Unicode filenames with Agg backend + (other backends appear to already work...) + (Thanks, Christopher Barker) - MGD + 2008-03-26 Fix SVG backend bug that prevents copying and pasting in Inkscape (thanks Kaushik Ghose) - MGD diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index 4c03a55f23f6..4ef9db72cf23 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -387,13 +387,17 @@ def buffer_rgba(self,x,y): def get_default_filetype(self): return 'png' - def print_raw(self, filename, *args, **kwargs): + def print_raw(self, filename_or_obj, *args, **kwargs): self.draw() - self.get_renderer()._renderer.write_rgba(str(filename)) + if type(filename_or_obj) in (str, unicode): + filename_or_obj = open(filename_or_obj, 'w') + self.get_renderer()._renderer.write_rgba(filename_or_obj) print_rgba = print_raw - def print_png(self, filename, *args, **kwargs): + def print_png(self, filename_or_obj, *args, **kwargs): self.draw() - filename = str(filename) # until we figure out unicode handling - self.get_renderer()._renderer.write_png(filename, self.figure.dpi.get()) + if type(filename_or_obj) in (str, unicode): + filename_or_obj = open(filename_or_obj, 'w') + self.get_renderer()._renderer.write_png(filename_or_obj, + self.figure.dpi.get()) diff --git a/lib/matplotlib/backends/backend_qt.py b/lib/matplotlib/backends/backend_qt.py index 57c9ebd14e82..e7b7fc1f755b 100644 --- a/lib/matplotlib/backends/backend_qt.py +++ b/lib/matplotlib/backends/backend_qt.py @@ -425,7 +425,7 @@ def save_figure( self ): selectedFilter) if fname: try: - self.canvas.print_figure( fname.latin1() ) + self.canvas.print_figure( unicode(fname) ) except Exception, e: qt.QMessageBox.critical( self, "Error saving file", str(e), diff --git a/lib/matplotlib/backends/backend_qt4.py b/lib/matplotlib/backends/backend_qt4.py index 5208b517f190..956fced11ef1 100644 --- a/lib/matplotlib/backends/backend_qt4.py +++ b/lib/matplotlib/backends/backend_qt4.py @@ -425,12 +425,12 @@ def save_figure( self ): selectedFilter = filter filters.append(filter) filters = ';;'.join(filters) - + fname = QtGui.QFileDialog.getSaveFileName( self, "Choose a filename to save to", start, filters, selectedFilter) if fname: try: - self.canvas.print_figure( str(fname.toLatin1()) ) + self.canvas.print_figure( unicode(fname) ) except Exception, e: QtGui.QMessageBox.critical( self, "Error saving file", str(e), diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 5960957ed332..621858ef14cc 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -2247,14 +2247,34 @@ RendererAgg::write_rgba(const Py::Tuple& args) { _VERBOSE("RendererAgg::write_rgba"); args.verify_length(1); - std::string fname = Py::String( args[0]); - std::ofstream of2( fname.c_str(), std::ios::binary|std::ios::out); - for (size_t i=0; i Date: Thu, 3 Apr 2008 15:24:20 +0000 Subject: [PATCH 039/324] some small fixes to excel tools svn path=/branches/v0_91_maint/; revision=5028 --- examples/rec_groupby_demo.py | 12 ++++++++++++ lib/matplotlib/mlab.py | 7 +++++++ lib/matplotlib/toolkits/exceltools.py | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/examples/rec_groupby_demo.py b/examples/rec_groupby_demo.py index 3513d39a9b1d..ad417076e32e 100644 --- a/examples/rec_groupby_demo.py +++ b/examples/rec_groupby_demo.py @@ -6,14 +6,20 @@ r.sort() def daily_return(prices): + 'an array of daily returns from price array' g = np.zeros_like(prices) g[1:] = (prices[1:]-prices[:-1])/prices[:-1] return g def volume_code(volume): + 'code the continuous volume data categorically' ind = np.searchsorted([1e5,1e6, 5e6,10e6, 1e7], volume) return ind +# a list of (dtype_name, summary_function, output_dtype_name). +# rec_summarize will call on each function on the indicated recarray +# attribute, and the result assigned to output name in the return +# record array. summaryfuncs = ( ('date', lambda x: [thisdate.year for thisdate in x], 'years'), ('date', lambda x: [thisdate.month for thisdate in x], 'months'), @@ -24,6 +30,10 @@ def volume_code(volume): rsum = mlab.rec_summarize(r, summaryfuncs) +# stats is a list of (dtype_name, function, output_dtype_name). +# rec_groupby will summarize the attribute identified by the +# dtype_name over the groups in the groupby list, and assign the +# result to the output_dtype_name stats = ( ('dreturn', len, 'rcnt'), ('dreturn', np.mean, 'rmean'), @@ -31,6 +41,7 @@ def volume_code(volume): ('dreturn', np.std, 'rsigma'), ) +# you can summarize over a single variable, like years or months print 'summary by years' ry = mlab.rec_groupby(rsum, ('years',), stats) print mlab. rec2txt(ry) @@ -39,6 +50,7 @@ def volume_code(volume): rm = mlab.rec_groupby(rsum, ('months',), stats) print mlab.rec2txt(rm) +# or over multiple variables like years and months print 'summary by year and month' rym = mlab.rec_groupby(rsum, ('years','months'), stats) print mlab.rec2txt(rym) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 903cb5aad346..93b3c51b682b 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1944,6 +1944,13 @@ def safe_isnan(x): else: return b +def safe_isinf(x): + 'isnan for arbitrary types' + try: b = npy.isinf(x) + except NotImplementedError: return False + else: return b + + def rec_append_field(rec, name, arr, dtype=None): 'return a new record array with field name populated with data from array arr' arr = npy.asarray(arr) diff --git a/lib/matplotlib/toolkits/exceltools.py b/lib/matplotlib/toolkits/exceltools.py index ca42081c39d2..805690abefb1 100644 --- a/lib/matplotlib/toolkits/exceltools.py +++ b/lib/matplotlib/toolkits/exceltools.py @@ -5,7 +5,7 @@ import matplotlib.mlab as mlab import matplotlib.toolkits.exceltools as exceltools - + r = mlab.csv2rec('somefile.csv', checkrows=0) formatd = dict( @@ -107,6 +107,10 @@ def rec2excel(r, ws, formatd=None, rownum=0, colnum=0): else: if mlab.safe_isnan(val): ws.write(rownum, colnum+i, 'NaN') + elif mlab.safe_isinf(val): + if val<0: sign='-' + else: sign='+' + ws.write(rownum, colnum+i, '%sInf'%sign) else: ws.write(rownum, colnum+i, val, format.xlstyle) rownum += 1 From 82fce66c61ed8d9efac1c0ab9955c8ed66db397a Mon Sep 17 00:00:00 2001 From: James Evans Date: Mon, 7 Apr 2008 22:26:21 +0000 Subject: [PATCH 040/324] Fixed the double draw bug. svn path=/branches/v0_91_maint/; revision=5032 --- lib/matplotlib/backends/backend_qt4agg.py | 1 - lib/matplotlib/backends/backend_qtagg.py | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_qt4agg.py b/lib/matplotlib/backends/backend_qt4agg.py index c5ba3a54e978..51cf4a4cb168 100644 --- a/lib/matplotlib/backends/backend_qt4agg.py +++ b/lib/matplotlib/backends/backend_qt4agg.py @@ -129,7 +129,6 @@ def draw( self ): if DEBUG: print "FigureCanvasQtAgg.draw", self self.replot = True FigureCanvasAgg.draw(self) - self.update() def blit(self, bbox=None): """ diff --git a/lib/matplotlib/backends/backend_qtagg.py b/lib/matplotlib/backends/backend_qtagg.py index 950719568659..be19aab2bc76 100644 --- a/lib/matplotlib/backends/backend_qtagg.py +++ b/lib/matplotlib/backends/backend_qtagg.py @@ -135,7 +135,6 @@ def draw( self ): if DEBUG: print "FigureCanvasQtAgg.draw", self self.replot = True FigureCanvasAgg.draw(self) - self.repaint( False ) def blit(self, bbox=None): """ From d6bfcd8587f191fef968446fd3cac0fde4f71ff4 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 9 Apr 2008 18:54:54 +0000 Subject: [PATCH 041/324] small fix for vlines w/ len 1 args svn path=/branches/v0_91_maint/; revision=5033 --- lib/matplotlib/axes.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 468dd4591f32..198e88b88a60 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -2442,9 +2442,10 @@ def hlines(self, y, xmin, xmax, colors='k', linestyle='solid', y = npy.asarray(y) if len(xmin)==1: - xmin = xmin*npy.ones(y.shape, y.dtype) + xmin = npy.resize( xmin, y.shape ) if len(xmax)==1: - xmax = xmax*npy.ones(y.shape, y.dtype) + xmax = npy.resize( xmax, y.shape ) + xmin = npy.asarray(xmin) xmax = npy.asarray(xmax) @@ -2512,6 +2513,11 @@ def vlines(self, x, ymin, ymax, colors='k', linestyle='solid', ymin = npy.asarray(ymin) ymax = npy.asarray(ymax) + if len(ymin)==1: + ymin = npy.resize( ymin, x.shape ) + if len(ymax)==1: + ymax = npy.resize( ymax, x.shape ) + if len(ymin)!=len(x): raise ValueError, 'ymin and x are unequal sized sequences' From a1e29feb7a838472acb45058d49b9a735af98d61 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 11 Apr 2008 15:24:57 +0000 Subject: [PATCH 042/324] Fixing global font rcParam setting after initialization time (thanks to Lev Givon and Eric Firing for finding this) svn path=/branches/v0_91_maint/; revision=5038 --- CHANGELOG | 3 + lib/matplotlib/font_manager.py | 130 +++++++++++++++------------------ 2 files changed, 63 insertions(+), 70 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0fcfb4958e51..beb38549d629 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-04-11 Fix global font rcParam setting after initialization + time. - MGD + 2008-03-27 Fix saving to Unicode filenames with Agg backend (other backends appear to already work...) (Thanks, Christopher Barker) - MGD diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index 45bca59f593f..c42935622b11 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -625,20 +625,6 @@ class FontProperties(object): fontconfig. """ - class FontPropertiesSet(object): - """This class contains all of the default properties at the - class level, which are then overridden (only if provided) at - the instance level.""" - family = rcParams['font.' + rcParams['font.family']] - if is_string_like(family): - family = [family] - slant = [rcParams['font.style']] - variant = [rcParams['font.variant']] - weight = [rcParams['font.weight']] - stretch = [rcParams['font.stretch']] - size = [rcParams['font.size']] - file = None - def __init__(self, family = None, style = None, @@ -649,12 +635,17 @@ def __init__(self, fname = None, # if this is set, it's a hardcoded filename to use _init = None # used only by copy() ): - - self.__props = self.FontPropertiesSet() + self._family = None + self._slant = None + self._variant = None + self._weight = None + self._stretch = None + self._size = None + self._file = None # This is used only by copy() if _init is not None: - self.__props.__dict__.update(_init) + self.__dict__.update(_init.__dict__) return if is_string_like(family): @@ -666,9 +657,8 @@ def __init__(self, stretch is None and size is None and fname is None): - self.__props.__dict__ = self._parse_fontconfig_pattern(family) + self.set_fontconfig_pattern(family) return - family = [family] self.set_family(family) self.set_style(style) @@ -682,7 +672,7 @@ def _parse_fontconfig_pattern(self, pattern): return parse_fontconfig_pattern(pattern) def __hash__(self): - return hash(repr(self.__props.__dict__)) + return hash(repr(self.__dict__)) def __str__(self): return self.get_fontconfig_pattern() @@ -690,7 +680,12 @@ def __str__(self): def get_family(self): """Return a list of font names that comprise the font family. """ - return self.__props.family + if self._family is None: + family = rcParams['font.family'] + if is_string_like(family): + return [family] + return family + return self._family def get_name(self): """Return the name of the font that best matches the font properties.""" @@ -698,38 +693,45 @@ def get_name(self): def get_style(self): """Return the font style. Values are: normal, italic or oblique.""" - return self.__props.slant[0] + if self._slant is None: + return rcParams['font.style'] + return self._slant def get_variant(self): """Return the font variant. Values are: normal or small-caps.""" - return self.__props.variant[0] + if self._variant is None: + return rcParams['font.variant'] + return self._variant def get_weight(self): """ Return the font weight. See the FontProperties class for a a list of possible values. """ - return self.__props.weight[0] + if self._weight is None: + return rcParams['font.weight'] + return self._weight def get_stretch(self): """ Return the font stretch or width. Options are: normal, narrow, condensed, or wide. """ - return self.__props.stretch[0] + if self._stretch is None: + return rcParams['font.stretch'] + return self._stretch def get_size(self): """Return the font size.""" - return float(self.__props.size[0]) + if self._size is None: + return rcParams['font.size'] + return float(self._size) def get_file(self): - if self.__props.file is not None: - return self.__props.file[0] - else: - return None + return self._file def get_fontconfig_pattern(self): - return generate_fontconfig_pattern(self.__props.__dict__) + return generate_fontconfig_pattern(self) def set_family(self, family): """ @@ -738,58 +740,49 @@ def set_family(self, family): fantasy, or monospace, or a real font name. """ if family is None: - self.__props.__dict__.pop('family', None) + self._family = None else: if is_string_like(family): family = [family] - self.__props.family = family + self._family = family set_name = set_family def set_style(self, style): """Set the font style. Values are: normal, italic or oblique.""" - if style is None: - self.__props.__dict__.pop('style', None) - else: - if style not in ('normal', 'italic', 'oblique'): - raise ValueError("style must be normal, italic or oblique") - self.__props.slant = [style] + if style not in ('normal', 'italic', 'oblique', None): + raise ValueError("style must be normal, italic or oblique") + self._slant = style def set_variant(self, variant): """Set the font variant. Values are: normal or small-caps.""" - if variant is None: - self.__props.__dict__.pop('variant', None) - else: - if variant not in ('normal', 'small-caps'): - raise ValueError("variant must be normal or small-caps") - self.__props.variant = [variant] + if variant not in ('normal', 'small-caps', None): + raise ValueError("variant must be normal or small-caps") + self._variant = variant def set_weight(self, weight): """ Set the font weight. See the FontProperties class for a a list of possible values. """ - if weight is None: - self.__props.__dict__.pop('weight', None) - else: - if (weight not in weight_dict and - weight not in weight_dict.keys()): - raise ValueError("weight is invalid") - self.__props.weight = [weight] + if (weight is not None and + weight not in weight_dict and + weight not in weight_dict.keys()): + raise ValueError("weight is invalid") + self._weight = weight def set_stretch(self, stretch): """ Set the font stretch or width. Options are: normal, narrow, condensed, or wide. """ - if stretch is None: - self.__props.__dict__.pop('stretch', None) - else: - self.__props.stretch = [stretch] + if stretch not in ('normal', 'narrow', 'condensed', 'wide', None): + raise ValueError("stretch is invalid") + self._stretch = stretch def set_size(self, size): """Set the font size.""" if size is None: - self.__props.__dict__.pop('size', None) + self._size = None else: if is_string_like(size): parent_size = fontManager.get_default_size() @@ -797,28 +790,25 @@ def set_size(self, size): if scaling is not None: size = parent_size * scaling else: - size = parent_size - if isinstance(size, (int, float)): - size = [size] - self.__props.size = size + try: + size = float(size) + except ValueError: + size = parent_size + assert(type(size) in (int, float)) + self._size = size def set_file(self, file): - if file is None: - self.__props.__dict__.pop('file', None) - else: - self.__props.file = [file] + self._file = file get_size_in_points = get_size def set_fontconfig_pattern(self, pattern): - self.__props.__dict__ = self._parse_fontconfig_pattern(pattern) - - def add_property_pair(self, key, val): - self.__props.setdefault(key, []).append(val) + for key, val in self._parse_fontconfig_pattern(pattern).items(): + getattr(self, "set_" + key)(val) def copy(self): """Return a deep copy of self""" - return FontProperties(_init = self.__props.__dict__) + return FontProperties(_init = self) def ttfdict_to_fnames(d): 'flatten a ttfdict to all the filenames it contains' From 91f3c4f8ddccde8136474e8f03c1bf35a860c3c6 Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Fri, 18 Apr 2008 15:20:03 +0000 Subject: [PATCH 043/324] dont remove repaint/update from draw(), or updates to the figure after the initial draw will be ignored. We need a different solution for the double drawing problem reported for the Wx and Qt* backends svn path=/branches/v0_91_maint/; revision=5046 --- lib/matplotlib/backends/backend_qt4agg.py | 1 + lib/matplotlib/backends/backend_qtagg.py | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/matplotlib/backends/backend_qt4agg.py b/lib/matplotlib/backends/backend_qt4agg.py index 51cf4a4cb168..c5ba3a54e978 100644 --- a/lib/matplotlib/backends/backend_qt4agg.py +++ b/lib/matplotlib/backends/backend_qt4agg.py @@ -129,6 +129,7 @@ def draw( self ): if DEBUG: print "FigureCanvasQtAgg.draw", self self.replot = True FigureCanvasAgg.draw(self) + self.update() def blit(self, bbox=None): """ diff --git a/lib/matplotlib/backends/backend_qtagg.py b/lib/matplotlib/backends/backend_qtagg.py index be19aab2bc76..3af9c0123433 100644 --- a/lib/matplotlib/backends/backend_qtagg.py +++ b/lib/matplotlib/backends/backend_qtagg.py @@ -135,6 +135,7 @@ def draw( self ): if DEBUG: print "FigureCanvasQtAgg.draw", self self.replot = True FigureCanvasAgg.draw(self) + self.repaint(False) def blit(self, bbox=None): """ From 02bd7f905fb3ce67ef473e92ef94074f4f3303a3 Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Sat, 19 Apr 2008 14:22:11 +0000 Subject: [PATCH 044/324] improve conversion from str to char*, avoid deprecation warnings during build svn path=/branches/v0_91_maint/; revision=5050 --- src/_backend_agg.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 621858ef14cc..067b390b230e 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -2269,7 +2269,7 @@ RendererAgg::write_rgba(const Py::Tuple& args) { throw Py::TypeError("Object does not appear to be a 8-bit string path or a Python file-like object"); } - PyObject_CallFunction(write_method, "s#", pixBuffer, NUMBYTES); + PyObject_CallFunction(write_method, (char *)"s#", pixBuffer, NUMBYTES); Py_XDECREF(write_method); } @@ -2282,7 +2282,7 @@ static void write_png_data(png_structp png_ptr, png_bytep data, png_size_t lengt PyObject* write_method = PyObject_GetAttrString(py_file_obj, "write"); PyObject* result = NULL; if (write_method) - result = PyObject_CallFunction(write_method, "s#", data, length); + result = PyObject_CallFunction(write_method, (char *)"s#", data, length); Py_XDECREF(write_method); Py_XDECREF(result); } @@ -2292,7 +2292,7 @@ static void flush_png_data(png_structp png_ptr) { PyObject* flush_method = PyObject_GetAttrString(py_file_obj, "flush"); PyObject* result = NULL; if (flush_method) - result = PyObject_CallFunction(flush_method, ""); + result = PyObject_CallFunction(flush_method, (char *)""); Py_XDECREF(flush_method); Py_XDECREF(result); } From 000c731dc1f146c80df2bf152a082fc0bf9ada37 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 22 Apr 2008 15:01:00 +0000 Subject: [PATCH 045/324] Fix inconsistency between svg.embed_chars and svg.embed_char_paths svn path=/branches/v0_91_maint/; revision=5058 --- CHANGELOG | 2 ++ matplotlibrc.template | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index beb38549d629..a43d915e6477 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-04-22 Use "svg.embed_char_paths" consistently everywhere - MGD + 2008-04-11 Fix global font rcParam setting after initialization time. - MGD diff --git a/matplotlibrc.template b/matplotlibrc.template index b9ddc264e87c..c245f16654f0 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -156,7 +156,7 @@ numerix : %(numerix)s # numpy, Numeric or numarray # 'tex': As TeX-like text. Text between $'s will be # formatted as a TeX math expression. # This setting has no effect when text.usetex is True. - # In that case, all text will be sent to TeX for + # In that case, all text will be sent to TeX for # processing. # The following settings allow you to select the fonts in math mode. @@ -171,7 +171,7 @@ numerix : %(numerix)s # numpy, Numeric or numarray #mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix', # 'stixsans' or 'custom' #mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern - # fonts when a symbol can not be found in one of + # fonts when a symbol can not be found in one of # the custom math fonts. ### AXES @@ -291,7 +291,7 @@ numerix : %(numerix)s # numpy, Numeric or numarray # svg backend params #svg.image_inline : True # write raster image data directly into the svg file #svg.image_noscale : False # suppress scaling of raster data embedded in SVG -#svg.embed_chars : True # embed character outlines in the SVG file +#svg.embed_char_paths : True # embed character outlines in the SVG file # Set the verbose flags. This controls how much information # matplotlib gives you at runtime and where it goes. The verbosity From 4b7298d06c6099fd1a41244733b0e1fa990e22a9 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 22 Apr 2008 15:06:01 +0000 Subject: [PATCH 046/324] Fix inconsistency between svg.embed_chars and svg.embed_char_paths svn path=/branches/v0_91_maint/; revision=5060 --- lib/matplotlib/config/mplconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/config/mplconfig.py b/lib/matplotlib/config/mplconfig.py index f8e140b8048d..f50e8408d322 100644 --- a/lib/matplotlib/config/mplconfig.py +++ b/lib/matplotlib/config/mplconfig.py @@ -99,7 +99,7 @@ class pdf(TConfig): class svg(TConfig): image_inline = T.true image_noscale = T.false - embed_chars = T.true + embed_char_paths = T.true class lines(TConfig): linewidth = T.Float(1.0) @@ -435,7 +435,7 @@ def __init__(self, tconfig): 'pdf.fonttype' : (self.tconfig.backend.pdf, 'fonttype'), 'svg.image_inline' : (self.tconfig.backend.svg, 'image_inline'), 'svg.image_noscale' : (self.tconfig.backend.svg, 'image_noscale'), - 'svg.embed_char_paths' : (self.tconfig.backend.svg, 'embed_chars'), + 'svg.embed_char_paths' : (self.tconfig.backend.svg, 'embed_char_paths'), } From 472ed1e00aa12ccf87ec04d37b9cc85fd2d9899b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 24 Apr 2008 12:31:53 +0000 Subject: [PATCH 047/324] Fix sub/superscript placement when the size of font has been changed. svn path=/branches/v0_91_maint/; revision=5068 --- CHANGELOG | 3 +++ lib/matplotlib/mathtext.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index a43d915e6477..db8c0a237faf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-04-24 Fix sub/superscripts when the size of the font has been + changed - MGD + 2008-04-22 Use "svg.embed_char_paths" consistently everywhere - MGD 2008-04-11 Fix global font rcParam setting after initialization diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 3faa041bff9e..1db8e8e2cd2b 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -651,7 +651,7 @@ def get_xheight(self, font, fontsize, dpi): # Some fonts don't store the xHeight, so we do a poor man's xHeight metrics = self.get_metrics(font, 'it', 'x', fontsize, dpi) return metrics.iceberg - xHeight = pclt['xHeight'] / 64.0 + xHeight = (pclt['xHeight'] / 64.0) * (fontsize / 12.0) return xHeight def get_underline_thickness(self, font, fontsize, dpi): From 70b568754a5a42bd3c516a1e435fc21f6e0e7ae7 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 28 Apr 2008 13:07:41 +0000 Subject: [PATCH 048/324] Fix SVG text rendering bug affecting Mozilla-based viewers. svn path=/branches/v0_91_maint/; revision=5088 --- CHANGELOG | 3 +++ lib/matplotlib/backends/backend_svg.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index db8c0a237faf..b6a56258f923 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-04-28 Fix bug in SVG text with Mozilla-based viewers (the symbol + tag is not supported) - MGD + 2008-04-24 Fix sub/superscripts when the size of the font has been changed - MGD diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index d3302e429eb1..a92291d68d8a 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -390,7 +390,8 @@ def _add_char_def(self, prop, char): currx, curry = step[-2], -step[-1] path_data = ''.join(path_data) char_num = 'c_%s' % md5.new(path_data).hexdigest() - path_element = '\n' % (char_num, ''.join(path_data)) + char_num = len(self._char_defs) + path_element = '\n' % (char_num, ''.join(path_data)) self._char_defs[char_id] = char_num return path_element From df366c7ad2bc97809100c0a74b8b15d64d68f785 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 28 Apr 2008 13:41:28 +0000 Subject: [PATCH 049/324] Fix bug where fraction beams were too wide at lower dpi's. Fix sub/superscript placement at different dpi's. svn path=/branches/v0_91_maint/; revision=5089 --- lib/matplotlib/mathtext.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 1db8e8e2cd2b..5c0df372bfe4 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -651,12 +651,12 @@ def get_xheight(self, font, fontsize, dpi): # Some fonts don't store the xHeight, so we do a poor man's xHeight metrics = self.get_metrics(font, 'it', 'x', fontsize, dpi) return metrics.iceberg - xHeight = (pclt['xHeight'] / 64.0) * (fontsize / 12.0) + xHeight = (pclt['xHeight'] / 64.0) * (fontsize / 12.0) * (dpi / 100.0) return xHeight def get_underline_thickness(self, font, fontsize, dpi): cached_font = self._get_font(font) - return max(1.0, cached_font.font.underline_thickness / 64.0 / fontsize * 10.0) + return cached_font.font.underline_thickness / 64.0 / fontsize * (10.0 * dpi / 100.0) def get_kern(self, font1, fontclass1, sym1, fontsize1, font2, fontclass2, sym2, fontsize2, dpi): From efa87f18384d6fd89a1497a0bc1a231a5953ff91 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 28 Apr 2008 13:49:50 +0000 Subject: [PATCH 050/324] Oops in last commit -- left in debugging info. svn path=/branches/v0_91_maint/; revision=5090 --- lib/matplotlib/backends/backend_svg.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index a92291d68d8a..ab468a105787 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -390,7 +390,6 @@ def _add_char_def(self, prop, char): currx, curry = step[-2], -step[-1] path_data = ''.join(path_data) char_num = 'c_%s' % md5.new(path_data).hexdigest() - char_num = len(self._char_defs) path_element = '\n' % (char_num, ''.join(path_data)) self._char_defs[char_id] = char_num return path_element From d3b021daa7d39b3706fa84c075eb00e796c7b1ed Mon Sep 17 00:00:00 2001 From: Manuel Metz Date: Tue, 29 Apr 2008 13:21:48 +0000 Subject: [PATCH 051/324] fixed bug in mlab.sqrtm; numpy.linalg.eig behaves different than Numeric did svn path=/branches/v0_91_maint/; revision=5095 --- CHANGELOG | 2 ++ lib/matplotlib/mlab.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b6a56258f923..941e483256f1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-04-29 Fix bug in mlab.sqrtm - MM + 2008-04-28 Fix bug in SVG text with Mozilla-based viewers (the symbol tag is not supported) - MGD diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 93b3c51b682b..1c4e3c9eb801 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1901,7 +1901,7 @@ def rank(x): def sqrtm(x): """ Returns the square root of a square matrix. - This means that s=sqrtm(x) implies s*s = x. + This means that s=sqrtm(x) implies dot(s,s) = x. Note that s and x are matrices. """ return mfuncC(npy.sqrt, x) @@ -1914,9 +1914,10 @@ def mfuncC(f, x): """ x = npy.asarray(x) - (v, u) = npy.linalg.eig(x) - uT = u.transpose() + (v,uT) = npy.linalg.eig(x) V = npy.diag(f(v+0j)) + # todo: warning: this is not exactly what matlab does + # MATLAB "B/A is roughly the same as B*inv(A)" y = npy.dot(uT, npy.dot(V, npy.linalg.inv(uT))) return approx_real(y) From d287cb4c0642f77eaa1238591eb3461b71d17056 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 1 May 2008 18:20:13 +0000 Subject: [PATCH 052/324] Include stdio.h for gcc 4.3 svn path=/branches/v0_91_maint/; revision=5101 --- ttconv/truetype.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ttconv/truetype.h b/ttconv/truetype.h index ffb3c1936db4..283163b30c2e 100644 --- a/ttconv/truetype.h +++ b/ttconv/truetype.h @@ -4,6 +4,8 @@ * Michael Droettboom */ +#include + /* ** ~ppr/src/include/typetype.h ** From d37b4d9a3c51ce1262f23ac44812f6fb12eb058a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 2 May 2008 16:55:59 +0000 Subject: [PATCH 053/324] Update _subprocess.c from upstream Python 2.5.2 to get a few memory and reference-counting-related bugfixes. See bug 1949978. - MGD svn path=/branches/v0_91_maint/; revision=5104 --- CHANGELOG | 4 ++++ src/_subprocess.c | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 941e483256f1..d3c762cd51cf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2008-05-02 Update _subprocess.c from upstream Python 2.5.2 to get a + few memory and reference-counting-related bugfixes. See + bug 1949978. - MGD + 2008-04-29 Fix bug in mlab.sqrtm - MM 2008-04-28 Fix bug in SVG text with Mozilla-based viewers (the symbol diff --git a/src/_subprocess.c b/src/_subprocess.c index b675b88462e8..c93f84bd1fe7 100644 --- a/src/_subprocess.c +++ b/src/_subprocess.c @@ -104,12 +104,12 @@ sp_handle_dealloc(sp_handle_object* self) { if (self->handle != INVALID_HANDLE_VALUE) CloseHandle(self->handle); - PyMem_DEL(self); + PyObject_FREE(self); } static PyMethodDef sp_handle_methods[] = { - {"Detach", (PyCFunction) sp_handle_detach, 1}, - {"Close", (PyCFunction) sp_handle_close, 1}, + {"Detach", (PyCFunction) sp_handle_detach, METH_VARARGS}, + {"Close", (PyCFunction) sp_handle_close, METH_VARARGS}, {NULL, NULL} }; @@ -250,19 +250,23 @@ static int getint(PyObject* obj, char* name) { PyObject* value; + int ret; value = PyObject_GetAttrString(obj, name); if (! value) { PyErr_Clear(); /* FIXME: propagate error? */ return 0; } - return (int) PyInt_AsLong(value); + ret = (int) PyInt_AsLong(value); + Py_DECREF(value); + return ret; } static HANDLE gethandle(PyObject* obj, char* name) { sp_handle_object* value; + HANDLE ret; value = (sp_handle_object*) PyObject_GetAttrString(obj, name); if (! value) { @@ -270,8 +274,11 @@ gethandle(PyObject* obj, char* name) return NULL; } if (value->ob_type != &sp_handle_type) - return NULL; - return value->handle; + ret = NULL; + else + ret = value->handle; + Py_DECREF(value); + return ret; } static PyObject* From 03d4ae92c4127bc8f98d51e4007acec7d84f5601 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 2 May 2008 17:05:19 +0000 Subject: [PATCH 054/324] Don't call sys.exit() when pyemf is not found. svn path=/branches/v0_91_maint/; revision=5107 --- CHANGELOG | 3 +++ lib/matplotlib/backends/backend_emf.py | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d3c762cd51cf..42846bfdb77a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-05-02 Don't call sys.exit() when pyemf is not found [1924199] - + MGD + 2008-05-02 Update _subprocess.c from upstream Python 2.5.2 to get a few memory and reference-counting-related bugfixes. See bug 1949978. - MGD diff --git a/lib/matplotlib/backends/backend_emf.py b/lib/matplotlib/backends/backend_emf.py index 9c06253bee1e..646fe238adae 100644 --- a/lib/matplotlib/backends/backend_emf.py +++ b/lib/matplotlib/backends/backend_emf.py @@ -8,9 +8,7 @@ try: import pyemf except ImportError: - import sys - print >>sys.stderr, 'You must first install pyemf from http://pyemf.sf.net' - sys.exit() + raise ImportError('You must first install pyemf from http://pyemf.sf.net') import os,sys,math,re @@ -600,7 +598,7 @@ def draw(self): pass filetypes = {'emf': 'Enhanced Metafile'} - + def print_emf(self, filename, dpi=300, **kwargs): width, height = self.figure.get_size_inches() renderer = RendererEMF(filename,width,height,dpi) @@ -609,7 +607,7 @@ def print_emf(self, filename, dpi=300, **kwargs): def get_default_filetype(self): return 'emf' - + class FigureManagerEMF(FigureManagerBase): """ Wrap everything up into a window for the pylab interface From 389636a616153fb876a4347687b4cb25206f1a8a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 2 May 2008 17:20:38 +0000 Subject: [PATCH 055/324] Fix build error with PyQt <= 3.14 [1851364] - MGD svn path=/branches/v0_91_maint/; revision=5108 --- CHANGELOG | 3 +++ setupext.py | 73 ++++++++++++++++++++++++++++------------------------- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 42846bfdb77a..371e5d39a1d1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-05-02 On PyQt <= 3.14 there is no way to determine the underlying + Qt version. [1851364] - MGD + 2008-05-02 Don't call sys.exit() when pyemf is not found [1924199] - MGD diff --git a/setupext.py b/setupext.py index 3d1a10da84f2..55de962f8d5b 100644 --- a/setupext.py +++ b/setupext.py @@ -100,20 +100,20 @@ numpy_inc_dirs = [] # matplotlib build options, which can be altered using setup.cfg -options = {'display_status': True, - 'verbose': False, - 'provide_pytz': 'auto', - 'provide_dateutil': 'auto', - 'provide_configobj': 'auto', - 'provide_traits': 'auto', - 'build_agg': True, - 'build_gtk': 'auto', - 'build_gtkagg': 'auto', - 'build_tkagg': 'auto', - 'build_wxagg': 'auto', - 'build_image': True, - 'build_windowing': True, - 'backend': None, +options = {'display_status': True, + 'verbose': False, + 'provide_pytz': 'auto', + 'provide_dateutil': 'auto', + 'provide_configobj': 'auto', + 'provide_traits': 'auto', + 'build_agg': True, + 'build_gtk': 'auto', + 'build_gtkagg': 'auto', + 'build_tkagg': 'auto', + 'build_wxagg': 'auto', + 'build_image': True, + 'build_windowing': True, + 'backend': None, 'numerix': None} # Based on the contents of setup.cfg, determine the build options @@ -351,8 +351,13 @@ def check_for_qt(): print_status("Qt", "no") return False else: + try: + qt_version = pyqtconfig.Configuration().qt_version + qt_version = convert_qt_version(qt_version) + except AttributeError: + qt_version = "" print_status("Qt", "Qt: %s, PyQt: %s" % - (convert_qt_version(pyqtconfig.Configuration().qt_version), + (qt_version, pyqtconfig.Configuration().pyqt_version_str)) return True @@ -813,7 +818,7 @@ def check_for_tk(): explanation = "Tcl/Tk v8.3 or later required" else: gotit = True - + if gotit: module = Extension('test', []) try: @@ -830,7 +835,7 @@ def check_for_tk(): else: explanation = message gotit = False - + if gotit: print_status("Tkinter", "Tkinter: %s, Tk: %s, Tcl: %s" % (Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion)) @@ -849,7 +854,7 @@ def query_tcltk(): # Use cached values if they exist, which ensures this function only executes once if TCL_TK_CACHE is not None: return TCL_TK_CACHE - + # By this point, we already know that Tkinter imports correctly import Tkinter tcl_lib_dir = '' @@ -875,14 +880,14 @@ def query_tcltk(): tk.withdraw() tcl_lib_dir = str(tk.getvar('tcl_library')) tk_lib_dir = str(tk.getvar('tk_library')) - + # Save directories and version string to cache TCL_TK_CACHE = tcl_lib_dir, tk_lib_dir, str(Tkinter.TkVersion)[:3] return TCL_TK_CACHE def add_tk_flags(module): 'Add the module flags to build extensions which use tk' - message = None + message = None if sys.platform == 'win32': major, minor1, minor2, s, tmp = sys.version_info if major == 2 and minor1 in [3, 4, 5]: @@ -894,11 +899,11 @@ def add_tk_flags(module): else: raise RuntimeError('No tk/win32 support for this python version yet') module.library_dirs.extend([os.path.join(sys.prefix, 'dlls')]) - + elif sys.platform == 'darwin': # this config section lifted directly from Imaging - thanks to # the effbot! - + # First test for a MacOSX/darwin framework install from os.path import join, exists framework_dirs = [ @@ -906,7 +911,7 @@ def add_tk_flags(module): '/Library/Frameworks', '/System/Library/Frameworks/', ] - + # Find the directory that contains the Tcl.framework and Tk.framework # bundles. # XXX distutils should support -F! @@ -931,7 +936,7 @@ def add_tk_flags(module): for fw in 'Tcl', 'Tk' for H in 'Headers', 'Versions/Current/PrivateHeaders' ] - + # For 8.4a2, the X11 headers are not included. Rather than include a # complicated search, this is a hard-coded path. It could bail out # if X11 libs are not found... @@ -940,31 +945,31 @@ def add_tk_flags(module): module.include_dirs.extend(tk_include_dirs) module.extra_link_args.extend(frameworks) module.extra_compile_args.extend(frameworks) - + # you're still here? ok we'll try it this way... else: # Query Tcl/Tk system for library paths and version string tcl_lib_dir, tk_lib_dir, tk_ver = query_tcltk() # todo: try/except - + # Process base directories to obtain include + lib dirs - if tcl_lib_dir != '' and tk_lib_dir != '': + if tcl_lib_dir != '' and tk_lib_dir != '': tcl_lib = os.path.normpath(os.path.join(tcl_lib_dir, '../')) tk_lib = os.path.normpath(os.path.join(tk_lib_dir, '../')) - tcl_inc = os.path.normpath(os.path.join(tcl_lib_dir, + tcl_inc = os.path.normpath(os.path.join(tcl_lib_dir, '../../include/tcl' + tk_ver)) if not os.path.exists(tcl_inc): - tcl_inc = os.path.normpath(os.path.join(tcl_lib_dir, + tcl_inc = os.path.normpath(os.path.join(tcl_lib_dir, '../../include')) - tk_inc = os.path.normpath(os.path.join(tk_lib_dir, + tk_inc = os.path.normpath(os.path.join(tk_lib_dir, '../../include/tk' + tk_ver)) if not os.path.exists(tk_inc): - tk_inc = os.path.normpath(os.path.join(tk_lib_dir, + tk_inc = os.path.normpath(os.path.join(tk_lib_dir, '../../include')) - + if ((not os.path.exists(os.path.join(tk_inc,'tk.h'))) and os.path.exists(os.path.join(tcl_inc,'tk.h'))): tk_inc = tcl_inc - + if not os.path.exists(tcl_inc): # this is a hack for suse linux, which is broken if (sys.platform.startswith('linux') and @@ -986,7 +991,7 @@ def add_tk_flags(module): module.include_dirs.extend([tcl_inc, tk_inc]) module.library_dirs.extend([tcl_lib, tk_lib]) module.libraries.extend(['tk' + tk_ver, 'tcl' + tk_ver]) - + return message def add_windowing_flags(module): From c7b27596d3a2aa355a2c65fe800248ec4ed81a0e Mon Sep 17 00:00:00 2001 From: John Hunter Date: Tue, 6 May 2008 14:34:32 +0000 Subject: [PATCH 056/324] use pngs for wx icons svn path=/branches/v0_91_maint/; revision=5119 --- lib/matplotlib/backends/backend_wx.py | 32 +++++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 43261b78950c..ce1c32f86e81 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -1452,6 +1452,24 @@ def _load_bitmap(filename): bmp =wx.Bitmap(bmpFilename, wx.BITMAP_TYPE_XPM) return bmp +def _load_pngicon(filename): + """ + Load a png icon file from the backends/images subdirectory in which the + matplotlib library is installed. The filename parameter should not + contain any path information as this is determined automatically. + + Returns a wx.Bitmap object + """ + + basedir = os.path.join(rcParams['datapath'],'images') + + pngFilename = os.path.normpath(os.path.join(basedir, filename)) + if not os.path.exists(pngFilename): + raise IOError('Could not find bitmap file "%s"; dying'%pngFilename) + + png =wx.Bitmap(pngFilename, wx.BITMAP_TYPE_PNG) + return png + class MenuButtonWx(wx.Button): """ wxPython does not permit a menu to be incorporated directly into a toolbar. @@ -1612,24 +1630,24 @@ def _init_toolbar(self): self.SetToolBitmapSize(wx.Size(24,24)) - self.AddSimpleTool(_NTB2_HOME, _load_bitmap('home.xpm'), + self.AddSimpleTool(_NTB2_HOME, _load_pngicon('home.png'), 'Home', 'Reset original view') - self.AddSimpleTool(self._NTB2_BACK, _load_bitmap('back.xpm'), + self.AddSimpleTool(self._NTB2_BACK, _load_pngicon('back.png'), 'Back', 'Back navigation view') - self.AddSimpleTool(self._NTB2_FORWARD, _load_bitmap('forward.xpm'), + self.AddSimpleTool(self._NTB2_FORWARD, _load_pngicon('forward.png'), 'Forward', 'Forward navigation view') # todo: get new bitmap - self.AddCheckTool(self._NTB2_PAN, _load_bitmap('move.xpm'), + self.AddCheckTool(self._NTB2_PAN, _load_pngicon('move.png'), shortHelp='Pan', longHelp='Pan with left, zoom with right') - self.AddCheckTool(self._NTB2_ZOOM, _load_bitmap('zoom_to_rect.xpm'), + self.AddCheckTool(self._NTB2_ZOOM, _load_pngicon('zoom_to_rect.png'), shortHelp='Zoom', longHelp='Zoom to rectangle') self.AddSeparator() - self.AddSimpleTool(_NTB2_SUBPLOT, _load_bitmap('subplots.xpm'), + self.AddSimpleTool(_NTB2_SUBPLOT, _load_pngicon('subplots.png'), 'Configure subplots', 'Configure subplot parameters') - self.AddSimpleTool(_NTB2_SAVE, _load_bitmap('filesave.xpm'), + self.AddSimpleTool(_NTB2_SAVE, _load_pngicon('filesave.png'), 'Save', 'Save plot contents to file') if wx.VERSION_STRING >= '2.5': From de481093d56f085d71a16e0688e75fbd1359f062 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 6 May 2008 15:25:04 +0000 Subject: [PATCH 057/324] Fix blitting in Qt backends (which need ARGB, not RGBA) svn path=/branches/v0_91_maint/; revision=5120 --- lib/matplotlib/backends/backend_qt4agg.py | 2 +- lib/matplotlib/backends/backend_qtagg.py | 2 +- src/_backend_agg.cpp | 29 ++++++++++++++++++++++- src/_backend_agg.h | 7 +++--- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/backends/backend_qt4agg.py b/lib/matplotlib/backends/backend_qt4agg.py index c5ba3a54e978..a3e4bfd1b78f 100644 --- a/lib/matplotlib/backends/backend_qt4agg.py +++ b/lib/matplotlib/backends/backend_qt4agg.py @@ -112,7 +112,7 @@ def paintEvent( self, e ): w, h = int(bbox.width()), int(bbox.height()) l, t = bbox.ll().x().get(), bbox.ur().y().get() reg = self.copy_from_bbox(bbox) - stringBuffer = reg.to_string() + stringBuffer = reg.to_string_argb() qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32) pixmap = QtGui.QPixmap.fromImage(qImage) p = QtGui.QPainter( self ) diff --git a/lib/matplotlib/backends/backend_qtagg.py b/lib/matplotlib/backends/backend_qtagg.py index 3af9c0123433..cef22ca51d62 100644 --- a/lib/matplotlib/backends/backend_qtagg.py +++ b/lib/matplotlib/backends/backend_qtagg.py @@ -118,7 +118,7 @@ def paintEvent( self, e ): w, h = int(bbox.width()), int(bbox.height()) l, t = bbox.ll().x().get(), bbox.ur().y().get() reg = self.copy_from_bbox(bbox) - stringBuffer = reg.to_string() + stringBuffer = reg.to_string_argb() qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian) self.pixmap.convertFromImage(qImage, qt.QPixmap.Color) p.drawPixmap(qt.QPoint(l, self.renderer.height-t), self.pixmap) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 067b390b230e..3ee31088108e 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -224,7 +224,33 @@ Py::Object BufferRegion::to_string(const Py::Tuple &args) { return Py::String(PyString_FromStringAndSize((const char*)aggbuf.data,aggbuf.height*aggbuf.stride), true); } +Py::Object BufferRegion::to_string_argb(const Py::Tuple &args) { + // owned=true to prevent memory leak + Py_ssize_t length; + char* pix; + char* begin; + char* end; + char tmp; + + PyObject* str = PyString_FromStringAndSize((const char*)aggbuf.data, aggbuf.height*aggbuf.stride); + if (PyString_AsStringAndSize(str, &begin, &length)) { + throw Py::TypeError("Could not create memory for blit"); + } + + pix = begin; + end = begin + (aggbuf.height * aggbuf.stride); + while (pix != end) { + // Convert rgba to argb + tmp = pix[3]; + pix[3] = pix[2]; + pix[2] = pix[1]; + pix[1] = pix[0]; + pix[0] = pix[3]; + pix += 4; + } + return Py::String(str, true); +} const size_t @@ -2612,7 +2638,8 @@ void BufferRegion::init_type() { add_varargs_method("to_string", &BufferRegion::to_string, "to_string()"); - + add_varargs_method("to_string_argb", &BufferRegion::to_string_argb, + "to_string_argb()"); } diff --git a/src/_backend_agg.h b/src/_backend_agg.h index c0cbed993715..a257b9f28627 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -67,7 +67,7 @@ class SafeSnap { SafeSnap() : first(true), xsnap(0.0), lastx(0.0), lastxsnap(0.0), ysnap(0.0), lasty(0.0), lastysnap(0.0) {} SnapData snap (const float& x, const float& y); - + private: bool first; float xsnap, lastx, lastxsnap, ysnap, lasty, lastysnap; @@ -85,6 +85,7 @@ class BufferRegion : public Py::PythonExtension { agg::rect rect; bool freemem; Py::Object to_string(const Py::Tuple &args); + Py::Object to_string_argb(const Py::Tuple &args); static void init_type(void); virtual ~BufferRegion() { @@ -125,7 +126,7 @@ class GCAgg { double dashOffset; double *dasha; - + protected: agg::rgba get_color(const Py::Object& gc); double points_to_pixels( const Py::Object& points); @@ -141,7 +142,7 @@ class GCAgg { //struct AMRenderer { -// +// //} // the renderer From 56f9427170ffb5ba9cd649ff9abfbf23896ea767 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 6 May 2008 15:30:09 +0000 Subject: [PATCH 058/324] Forgot CHANGELOG svn path=/branches/v0_91_maint/; revision=5121 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 371e5d39a1d1..7b1f67c92e94 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD + 2008-05-02 On PyQt <= 3.14 there is no way to determine the underlying Qt version. [1851364] - MGD From 82da311b8d5c81f7497b072b11c9cd28d24d057c Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 6 May 2008 18:56:47 +0000 Subject: [PATCH 059/324] Fixing bugs in recent changes to Qt blitting. svn path=/branches/v0_91_maint/; revision=5123 --- lib/matplotlib/backends/backend_qt4agg.py | 6 +++-- lib/matplotlib/backends/backend_qtagg.py | 6 +++-- src/_backend_agg.cpp | 28 ++++++++++++----------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lib/matplotlib/backends/backend_qt4agg.py b/lib/matplotlib/backends/backend_qt4agg.py index a3e4bfd1b78f..b9d88f155dc4 100644 --- a/lib/matplotlib/backends/backend_qt4agg.py +++ b/lib/matplotlib/backends/backend_qt4agg.py @@ -109,8 +109,10 @@ def paintEvent( self, e ): # we are blitting here else: bbox = self.replot - w, h = int(bbox.width()), int(bbox.height()) - l, t = bbox.ll().x().get(), bbox.ur().y().get() + l, t = int(bbox.ll().x().get()), int(bbox.ur().y().get()) + r, b = int(bbox.ur().x().get()), int(bbox.ll().y().get()) + w = r - l + h = t - b reg = self.copy_from_bbox(bbox) stringBuffer = reg.to_string_argb() qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32) diff --git a/lib/matplotlib/backends/backend_qtagg.py b/lib/matplotlib/backends/backend_qtagg.py index cef22ca51d62..88f04bf59d52 100644 --- a/lib/matplotlib/backends/backend_qtagg.py +++ b/lib/matplotlib/backends/backend_qtagg.py @@ -115,8 +115,10 @@ def paintEvent( self, e ): # we are blitting here else: bbox = self.replot - w, h = int(bbox.width()), int(bbox.height()) - l, t = bbox.ll().x().get(), bbox.ur().y().get() + l, t = int(bbox.ll().x().get()), int(bbox.ur().y().get()) + r, b = int(bbox.ur().x().get()), int(bbox.ll().y().get()) + w = r - l + h = t - b reg = self.copy_from_bbox(bbox) stringBuffer = reg.to_string_argb() qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 3ee31088108e..95ffdd6fd86f 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -227,26 +227,28 @@ Py::Object BufferRegion::to_string(const Py::Tuple &args) { Py::Object BufferRegion::to_string_argb(const Py::Tuple &args) { // owned=true to prevent memory leak Py_ssize_t length; - char* pix; - char* begin; - char* end; - char tmp; + unsigned char* pix; + unsigned char* begin; + unsigned char* end; + unsigned char tmp; + size_t i, j; PyObject* str = PyString_FromStringAndSize((const char*)aggbuf.data, aggbuf.height*aggbuf.stride); - if (PyString_AsStringAndSize(str, &begin, &length)) { + if (PyString_AsStringAndSize(str, (char**)&begin, &length)) { throw Py::TypeError("Could not create memory for blit"); } pix = begin; end = begin + (aggbuf.height * aggbuf.stride); - while (pix != end) { - // Convert rgba to argb - tmp = pix[3]; - pix[3] = pix[2]; - pix[2] = pix[1]; - pix[1] = pix[0]; - pix[0] = pix[3]; - pix += 4; + for (i = 0; i < aggbuf.height; ++i) { + pix = begin + i * aggbuf.stride; + for (j = 0; j < aggbuf.width; ++j) { + // Convert rgba to argb + tmp = pix[2]; + pix[2] = pix[0]; + pix[0] = tmp; + pix += 4; + } } return Py::String(str, true); From 5ee9bd26b99c47216fea594b5232ed94223c867b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 7 May 2008 19:39:58 +0000 Subject: [PATCH 060/324] [ 1922569 ] gcc 4.3 C++ compilation errors (Thanks, Jef Spaleta) svn path=/branches/v0_91_maint/; revision=5128 --- ttconv/pprdrv.h | 10 +- ttconv/pprdrv_tt.cpp | 222 +++++++++++++++++++++--------------------- ttconv/pprdrv_tt2.cpp | 92 ++++++++--------- ttconv/ttutil.cpp | 6 +- 4 files changed, 165 insertions(+), 165 deletions(-) diff --git a/ttconv/pprdrv.h b/ttconv/pprdrv.h index 3be9fd5ef2ac..2cefd923046b 100644 --- a/ttconv/pprdrv.h +++ b/ttconv/pprdrv.h @@ -20,10 +20,10 @@ */ #include -#include +#include /* - * Encapsulates all of the output to write to an arbitrary output + * Encapsulates all of the output to write to an arbitrary output * function. This both removes the hardcoding of output to go to stdout * and makes output thread-safe. Michael Droettboom [06-07-07] */ @@ -36,7 +36,7 @@ class TTStreamWriter { public: TTStreamWriter() { } virtual ~TTStreamWriter() { } - + virtual void write(const char*) = 0; virtual void printf(const char* format, ...); @@ -73,9 +73,9 @@ class TTException { const char* getMessage() { return message; } }; -/* +/* ** No debug code will be included if this -** is not defined: +** is not defined: */ /* #define DEBUG 1 */ diff --git a/ttconv/pprdrv_tt.cpp b/ttconv/pprdrv_tt.cpp index 5975af8d8c71..263759401171 100644 --- a/ttconv/pprdrv_tt.cpp +++ b/ttconv/pprdrv_tt.cpp @@ -16,22 +16,22 @@ ** documentation. This software is provided "as is" without express or ** implied warranty. ** -** TrueType font support. These functions allow PPR to generate +** TrueType font support. These functions allow PPR to generate ** PostScript fonts from Microsoft compatible TrueType font files. ** ** Last revised 19 December 1995. */ #include "global_defines.h" -#include -#include -#include +#include +#include +#include #include "pprdrv.h" #include "truetype.h" #include /*========================================================================== -** Convert the indicated Truetype font file to a type 42 or type 3 +** Convert the indicated Truetype font file to a type 42 or type 3 ** PostScript font and insert it in the output stream. ** ** All the routines from here to the end of file file are involved @@ -42,7 +42,7 @@ ** Endian conversion routines. ** These routines take a BYTE pointer ** and return a value formed by reading -** bytes starting at that point. +** bytes starting at that point. ** ** These routines read the big-endian ** values which are used in TrueType @@ -55,14 +55,14 @@ ULONG getULONG(BYTE *p) { int x; - ULONG val=0; + ULONG val=0; for(x=0; x<4; x++) { val *= 0x100; - val += p[x]; + val += p[x]; } - + return val; } /* end of ftohULONG() */ @@ -72,14 +72,14 @@ ULONG getULONG(BYTE *p) USHORT getUSHORT(BYTE *p) { int x; - USHORT val=0; + USHORT val=0; for(x=0; x<2; x++) { val *= 0x100; - val += p[x]; + val += p[x]; } - + return val; } /* end of getUSHORT() */ @@ -92,7 +92,7 @@ Fixed getFixed(BYTE *s) Fixed val={0,0}; val.whole = ((s[0] * 256) + s[1]); - val.fraction = ((s[2] * 256) + s[3]); + val.fraction = ((s[2] * 256) + s[3]); return val; } /* end of getFixed() */ @@ -102,16 +102,16 @@ Fixed getFixed(BYTE *s) ** The font's "file" and "offset_table" fields must be set before this ** routine is called. ** -** This first argument is a TrueType font structure, the second +** This first argument is a TrueType font structure, the second ** argument is the name of the table to retrieve. A table name -** is always 4 characters, though the last characters may be +** is always 4 characters, though the last characters may be ** padding spaces. -----------------------------------------------------------------------*/ BYTE *GetTable(struct TTFONT *font, const char *name) { BYTE *ptr; ULONG x; - + #ifdef DEBUG_TRUETYPE debug("GetTable(file,font,\"%s\")",name); #endif @@ -127,17 +127,17 @@ BYTE *GetTable(struct TTFONT *font, const char *name) BYTE *table; offset = getULONG( ptr + 8 ); - length = getULONG( ptr + 12 ); + length = getULONG( ptr + 12 ); table = (BYTE*)calloc( sizeof(BYTE), length ); try { #ifdef DEBUG_TRUETYPE debug("Loading table \"%s\" from offset %d, %d bytes",name,offset,length); #endif - + if( fseek( font->file, (long)offset, SEEK_SET ) ) throw TTException("TrueType font may be corrupt (reason 3)"); - + if( fread(table,sizeof(BYTE),length,font->file) != (sizeof(BYTE) * length)) throw TTException("TrueType font may be corrupt (reason 4)"); } catch (TTException& e) { @@ -156,7 +156,7 @@ BYTE *GetTable(struct TTFONT *font, const char *name) } /* end of GetTable() */ /*-------------------------------------------------------------------- -** Load the 'name' table, get information from it, +** Load the 'name' table, get information from it, ** and store that information in the font structure. ** ** The 'name' table contains information such as the name of @@ -171,7 +171,7 @@ void Read_name(struct TTFONT *font) int platform,encoding; /* Current platform id, encoding id, */ int language,nameid; /* language id, name id, */ int offset,length; /* offset and length of string. */ - + #ifdef DEBUG_TRUETYPE debug("Read_name()"); #endif @@ -188,7 +188,7 @@ void Read_name(struct TTFONT *font) try { numrecords = getUSHORT( table_ptr + 2 ); /* number of names */ strings = table_ptr + getUSHORT( table_ptr + 4 ); /* start of string storage */ - + ptr2 = table_ptr + 6; for(x=0; x < numrecords; x++,ptr2+=12) { @@ -202,7 +202,7 @@ void Read_name(struct TTFONT *font) #ifdef DEBUG_TRUETYPE debug("platform %d, encoding %d, language 0x%x, name %d, offset %d, length %d", platform,encoding,language,nameid,offset,length); -#endif +#endif /* Copyright notice */ if( platform == 1 && nameid == 0 ) @@ -211,13 +211,13 @@ void Read_name(struct TTFONT *font) strncpy(font->Copyright,(const char*)strings+offset,length); font->Copyright[length]=(char)NULL; replace_newlines_with_spaces(font->Copyright); - + #ifdef DEBUG_TRUETYPE debug("font->Copyright=\"%s\"",font->Copyright); #endif continue; } - + /* Font Family name */ if( platform == 1 && nameid == 1 ) @@ -226,7 +226,7 @@ void Read_name(struct TTFONT *font) strncpy(font->FamilyName,(const char*)strings+offset,length); font->FamilyName[length]=(char)NULL; replace_newlines_with_spaces(font->FamilyName); - + #ifdef DEBUG_TRUETYPE debug("font->FamilyName=\"%s\"",font->FamilyName); #endif @@ -241,14 +241,14 @@ void Read_name(struct TTFONT *font) strncpy(font->Style,(const char*)strings+offset,length); font->Style[length]=(char)NULL; replace_newlines_with_spaces(font->Style); - + #ifdef DEBUG_TRUETYPE debug("font->Style=\"%s\"",font->Style); #endif continue; } - - + + /* Full Font name */ if( platform == 1 && nameid == 4 ) { @@ -256,14 +256,14 @@ void Read_name(struct TTFONT *font) strncpy(font->FullName,(const char*)strings+offset,length); font->FullName[length]=(char)NULL; replace_newlines_with_spaces(font->FullName); - + #ifdef DEBUG_TRUETYPE debug("font->FullName=\"%s\"",font->FullName); #endif continue; } - - + + /* Version string */ if( platform == 1 && nameid == 5 ) { @@ -277,8 +277,8 @@ void Read_name(struct TTFONT *font) #endif continue; } - - + + /* PostScript name */ if( platform == 1 && nameid == 6 ) { @@ -292,8 +292,8 @@ void Read_name(struct TTFONT *font) #endif continue; } - - + + /* Trademark string */ if( platform == 1 && nameid == 7 ) { @@ -301,13 +301,13 @@ void Read_name(struct TTFONT *font) strncpy(font->Trademark,(const char*)strings+offset,length); font->Trademark[length]=(char)NULL; replace_newlines_with_spaces(font->Trademark); - + #ifdef DEBUG_TRUETYPE debug("font->Trademark=\"%s\"",font->Trademark); #endif continue; } - + } } catch (TTException& e) { free(table_ptr); @@ -443,20 +443,20 @@ void ttfont_FontInfo(TTStreamWriter& stream, struct TTFONT *font) /* Some information from the "post" table. */ ItalicAngle = getFixed( font->post_table + 4 ); stream.printf("/ItalicAngle %d.%d def\n",ItalicAngle.whole,ItalicAngle.fraction); - stream.printf("/isFixedPitch %s def\n", getULONG( font->post_table + 12 ) ? "true" : "false" ); + stream.printf("/isFixedPitch %s def\n", getULONG( font->post_table + 12 ) ? "true" : "false" ); stream.printf("/UnderlinePosition %d def\n", (int)getFWord( font->post_table + 8 ) ); - stream.printf("/UnderlineThickness %d def\n", (int)getFWord( font->post_table + 10 ) ); - stream.putline("end readonly def"); - } /* end of ttfont_FontInfo() */ + stream.printf("/UnderlineThickness %d def\n", (int)getFWord( font->post_table + 10 ) ); + stream.putline("end readonly def"); + } /* end of ttfont_FontInfo() */ /*------------------------------------------------------------------- ** sfnts routines -** These routines generate the PostScript "sfnts" array which +** These routines generate the PostScript "sfnts" array which ** contains one or more strings which contain a reduced version ** of the TrueType font. ** ** A number of functions are required to accomplish this rather -** complicated task. +** complicated task. -------------------------------------------------------------------*/ int string_len; int line_len; @@ -498,9 +498,9 @@ void sfnts_pputBYTE(TTStreamWriter& stream, BYTE n) stream.putchar('\n'); line_len=0; } - + } /* end of sfnts_pputBYTE() */ - + /* ** Write a USHORT as a hexadecimal value as part of the sfnts array. */ @@ -516,7 +516,7 @@ void sfnts_pputUSHORT(TTStreamWriter& stream, USHORT n) void sfnts_pputULONG(TTStreamWriter& stream, ULONG n) { int x1,x2,x3; - + x1 = n % 256; n /= 256; x2 = n % 256; @@ -531,7 +531,7 @@ void sfnts_pputULONG(TTStreamWriter& stream, ULONG n) } /* end of sfnts_pputULONG() */ /* -** This is called whenever it is +** This is called whenever it is ** necessary to end a string in the sfnts array. ** ** (The array must be broken into strings which are @@ -542,7 +542,7 @@ void sfnts_end_string(TTStreamWriter& stream) if(in_string) { string_len=0; /* fool sfnts_pputBYTE() */ - + #ifdef DEBUG_TRUETYPE_INLINE puts("\n% dummy byte:\n"); #endif @@ -562,7 +562,7 @@ void sfnts_end_string(TTStreamWriter& stream) */ void sfnts_new_table(TTStreamWriter& stream, ULONG length) { - if( (string_len + length) > 65528 ) + if( (string_len + length) > 65528 ) sfnts_end_string(stream); } /* end of sfnts_new_table() */ @@ -615,7 +615,7 @@ void sfnts_glyf_table(TTStreamWriter& stream, struct TTFONT *font, ULONG oldoffs /* Start new string if necessary. */ sfnts_new_table( stream, (int)length ); - /* + /* ** Make sure the glyph is padded out to a ** two byte boundary. */ @@ -627,16 +627,16 @@ void sfnts_glyf_table(TTStreamWriter& stream, struct TTFONT *font, ULONG oldoffs { if( (c = fgetc(font->file)) == EOF ) throw TTException("TrueType font may be corrupt (reason 6)"); - + sfnts_pputBYTE(stream, c); total++; /* add to running total */ - } + } } free(font->loca_table); font->loca_table = NULL; - + /* Pad out to full length from table directory */ while( total < correct_total_length ) { @@ -649,7 +649,7 @@ void sfnts_glyf_table(TTStreamWriter& stream, struct TTFONT *font, ULONG oldoffs /* ** Here is the routine which ties it all together. ** -** Create the array called "sfnts" which +** Create the array called "sfnts" which ** holds the actual TrueType data. */ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) @@ -673,7 +673,7 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) ULONG length; ULONG checksum; } tables[9]; - + BYTE *ptr; /* A pointer into the origional table directory. */ ULONG x,y; /* General use loop countes. */ int c; /* Input character. */ @@ -684,8 +684,8 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) ptr = font->offset_table + 12; nextoffset=0; count=0; - - /* + + /* ** Find the tables we want and store there vital ** statistics in tables[]. */ @@ -697,7 +697,7 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) if( diff > 0 ) /* If we are past it. */ { tables[x].length = 0; - diff = 0; + diff = 0; } else if( diff < 0 ) /* If we haven't hit it yet. */ { @@ -711,12 +711,12 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) tables[x].length = getULONG( ptr + 12 ); nextoffset += ( ((tables[x].length + 3) / 4) * 4 ); count++; - ptr += 16; + ptr += 16; } } while(diff != 0); - + } /* end of for loop which passes over the table directory */ - + /* Begin the sfnts array. */ sfnts_start(stream); @@ -724,10 +724,10 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) /* Start by copying the TrueType version number. */ ptr = font->offset_table; for(x=0; x < 4; x++) - { + { sfnts_pputBYTE( stream, *(ptr++) ); } - + /* Now, generate those silly numTables numbers. */ sfnts_pputUSHORT(stream, count); /* number of tables */ if( count == 9 ) @@ -735,11 +735,11 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) sfnts_pputUSHORT(stream, 7); /* searchRange */ sfnts_pputUSHORT(stream, 3); /* entrySelector */ sfnts_pputUSHORT(stream, 81); /* rangeShift */ - } + } #ifdef DEBUG_TRUETYPE else { - debug("only %d tables selected",count); + debug("only %d tables selected",count); } #endif @@ -754,13 +754,13 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) sfnts_pputBYTE( stream, table_names[x][1] ); sfnts_pputBYTE( stream, table_names[x][2] ); sfnts_pputBYTE( stream, table_names[x][3] ); - + /* Checksum */ sfnts_pputULONG( stream, tables[x].checksum ); /* Offset */ sfnts_pputULONG( stream, tables[x].newoffset + 12 + (count * 16) ); - + /* Length */ sfnts_pputULONG( stream, tables[x].length ); } @@ -770,7 +770,7 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) { if( tables[x].length == 0 ) /* skip tables that aren't there */ continue; - + #ifdef DEBUG_TRUETYPE debug("emmiting table '%s'",table_names[x]); #endif @@ -783,22 +783,22 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) else /* Other tables may not exceed */ { /* 65535 bytes in length. */ if( tables[x].length > 65535 ) - throw TTException("TrueType font has a table which is too long"); - + throw TTException("TrueType font has a table which is too long"); + /* Start new string if necessary. */ sfnts_new_table(stream, tables[x].length); /* Seek to proper position in the file. */ fseek( font->file, tables[x].oldoffset, SEEK_SET ); - + /* Copy the bytes of the table. */ for( y=0; y < tables[x].length; y++ ) { if( (c = fgetc(font->file)) == EOF ) throw TTException("TrueType font may be corrupt (reason 7)"); - + sfnts_pputBYTE(stream, c); - } + } } /* Padd it out to a four byte boundary. */ @@ -815,39 +815,39 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font) } /* End of loop for all tables */ /* Close the array. */ - sfnts_end_string(stream); + sfnts_end_string(stream); stream.putline("]def"); } /* end of ttfont_sfnts() */ - -/*-------------------------------------------------------------- -** Create the CharStrings dictionary which will translate -** PostScript character names to TrueType font character + +/*-------------------------------------------------------------- +** Create the CharStrings dictionary which will translate +** PostScript character names to TrueType font character ** indexes. ** ** If we are creating a type 3 instead of a type 42 font, ** this array will instead convert PostScript character names ** to executable proceedures. --------------------------------------------------------------*/ -const char *Apple_CharStrings[]={ -".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign", -"dollar","percent","ampersand","quotesingle","parenleft","parenright", +const char *Apple_CharStrings[]={ +".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign", +"dollar","percent","ampersand","quotesingle","parenleft","parenright", "asterisk","plus", "comma","hyphen","period","slash","zero","one","two", -"three","four","five","six","seven","eight","nine","colon","semicolon", +"three","four","five","six","seven","eight","nine","colon","semicolon", "less","equal","greater","question","at","A","B","C","D","E","F","G","H","I", "J","K", "L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", "bracketleft","backslash","bracketright","asciicircum","underscore","grave", -"a","b","c","d","e","f","g","h","i","j","k", "l","m","n","o","p","q","r","s", +"a","b","c","d","e","f","g","h","i","j","k", "l","m","n","o","p","q","r","s", "t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde", "Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis", "aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla", -"eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex", +"eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex", "idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde", "uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent", "sterling","section","bullet","paragraph","germandbls","registered", "copyright","trademark","acute","dieresis","notequal","AE","Oslash", "infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff", "summation","product","pi","integral","ordfeminine","ordmasculine","Omega", -"ae","oslash","questiondown","exclamdown","logicalnot","radical","florin", +"ae","oslash","questiondown","exclamdown","logicalnot","radical","florin", "approxequal","Delta","guillemotleft","guillemotright","ellipsis", "nobreakspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash", "quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge", @@ -861,7 +861,7 @@ const char *Apple_CharStrings[]={ "Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior", "twosuperior","threesuperior","onehalf","onequarter","threequarters","franc", "Gbreve","gbreve","Idot","Scedilla","scedilla","Cacute","cacute","Ccaron", -"ccaron","dmacron","markingspace","capslock","shift","propeller","enter", +"ccaron","dmacron","markingspace","capslock","shift","propeller","enter", "markingtabrtol","markingtabltor","control","markingdeleteltor", "markingdeletertol","option","escape","parbreakltor","parbreakrtol", "newpage","checkmark","linebreakltor","linebreakrtol","markingnobreakspace", @@ -879,7 +879,7 @@ const char *ttfont_CharStrings_getname(struct TTFONT *font, int charindex) ULONG len; GlyphIndex = (int)getUSHORT( font->post_table + 34 + (charindex * 2) ); - + if( GlyphIndex <= 257 ) /* If a standard Apple name, */ { return Apple_CharStrings[GlyphIndex]; @@ -887,7 +887,7 @@ const char *ttfont_CharStrings_getname(struct TTFONT *font, int charindex) else /* Otherwise, use one */ { /* of the pascal strings. */ GlyphIndex -= 258; - + /* Set pointer to start of Pascal strings. */ ptr = (char*)(font->post_table + 34 + (font->numGlyphs * 2)); @@ -897,7 +897,7 @@ const char *ttfont_CharStrings_getname(struct TTFONT *font, int charindex) ptr += len; len = (ULONG)*(ptr++); } - + if( len >= sizeof(temp) ) throw TTException("TrueType font file contains a very long PostScript name"); @@ -914,16 +914,16 @@ const char *ttfont_CharStrings_getname(struct TTFONT *font, int charindex) void ttfont_CharStrings(TTStreamWriter& stream, struct TTFONT *font, std::vector& glyph_ids) { Fixed post_format; - + /* The 'post' table format number. */ post_format = getFixed( font->post_table ); - + if( post_format.whole != 2 || post_format.fraction != 0 ) throw TTException("TrueType fontdoes not have a format 2.0 'post' table"); /* Emmit the start of the PostScript code to define the dictionary. */ stream.printf("/CharStrings %d dict dup begin\n", glyph_ids.size()); - + /* Emmit one key-value pair for each glyph. */ for(std::vector::const_iterator i = glyph_ids.begin(); i != glyph_ids.end(); ++i) @@ -935,13 +935,13 @@ void ttfont_CharStrings(TTStreamWriter& stream, struct TTFONT *font, std::vector else /* type 3 */ { stream.printf("/%s{",ttfont_CharStrings_getname(font, *i)); - + tt_type3_charproc(stream, font, *i); - + stream.putline("}_d"); /* "} bind def" */ } } - + stream.putline("end readonly def"); } /* end of ttfont_CharStrings() */ @@ -971,8 +971,8 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) stream.putline("/BuildChar {"); stream.putline(" 1 index /Encoding get exch get"); stream.putline(" 1 index /BuildGlyph get exec"); - stream.putline("}_d"); - + stream.putline("}_d"); + stream.putchar('\n'); } @@ -999,7 +999,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) stream.putline("{/TrueDict where{pop}{(%%[ Error: no TrueType rasterizer ]%%)= flush}ifelse"); /* Since we are expected to use Apple's TrueDict TrueType */ - /* reasterizer, change the font type to 3. */ + /* reasterizer, change the font type to 3. */ stream.putline("/FontType 3 def"); /* Define a string to hold the state of the Apple */ @@ -1035,7 +1035,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) /* Exchange the CharStrings dictionary and the charname, */ /* but if the answer was false, replace the character name */ - /* with ".notdef". */ + /* with ".notdef". */ stream.putline(" {exch}{exch pop /.notdef}ifelse"); /* stack: CharStrings charname */ @@ -1060,7 +1060,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) stream.putline(" /BuildChar{"); stream.putline(" 1 index /Encoding get exch get"); stream.putline(" 1 index /BuildGlyph get exec"); - stream.putline(" }bind def"); + stream.putline(" }bind def"); /* Here we close the condition which is true */ /* if the printer has no built-in TrueType */ @@ -1071,7 +1071,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) stream.putline("FontName currentdict end definefont pop"); stream.putline("%%EOF"); - } /* end of ttfont_trailer() */ + } /* end of ttfont_trailer() */ /*------------------------------------------------------------------ ** This is the externally callable routine which inserts the font. @@ -1080,7 +1080,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) void read_font(const char *filename, font_type_enum target_type, std::vector& glyph_ids, TTFONT& font) { BYTE *ptr; - + /* Decide what type of PostScript font we will be generating. */ font.target_type = target_type; @@ -1094,24 +1094,24 @@ void read_font(const char *filename, font_type_enum target_type, std::vector& glyph_ids) { struct TTFONT font; @@ -1233,9 +1233,9 @@ void get_pdf_charprocs(const char *filename, std::vector& glyph_ids, TTDict } TTFONT::TTFONT() : - file(NULL), + file(NULL), PostName(NULL), - FullName(NULL), + FullName(NULL), FamilyName(NULL), Style(NULL), Copyright(NULL), diff --git a/ttconv/pprdrv_tt2.cpp b/ttconv/pprdrv_tt2.cpp index b2a5e7e9096e..d32eed90650f 100644 --- a/ttconv/pprdrv_tt2.cpp +++ b/ttconv/pprdrv_tt2.cpp @@ -16,14 +16,14 @@ ** documentation. This software is provided "as is" without express or ** implied warranty. ** -** TrueType font support. These functions allow PPR to generate +** TrueType font support. These functions allow PPR to generate ** PostScript fonts from Microsoft compatible TrueType font files. ** ** The functions in this file do most of the work to convert a ** TrueType font to a type 3 PostScript font. ** ** Most of the material in this file is derived from a program called -** "ttf2ps" which L. S. Ng posted to the usenet news group +** "ttf2ps" which L. S. Ng posted to the usenet news group ** "comp.sources.postscript". The author did not provide a copyright ** notice or indicate any restrictions on use. ** @@ -31,11 +31,11 @@ */ #include "global_defines.h" -#include -#include -#include -#include -#include "pprdrv.h" +#include +#include +#include +#include +#include "pprdrv.h" #include "truetype.h" #include #include @@ -59,7 +59,7 @@ class GlyphToType3 { int *ctrset; /* in contour index followed by out contour index */ int stack_depth; /* A book-keeping variable for keeping track of the depth of the PS stack */ - + bool pdf_mode; void load_char(TTFONT* font, BYTE *glyph); @@ -88,7 +88,7 @@ double area(FWord *x, FWord *y, int n); /* ** This routine is used to break the character -** procedure up into a number of smaller +** procedure up into a number of smaller ** procedures. This is necessary so as not to ** overflow the stack on certain level 1 interpreters. ** @@ -131,21 +131,21 @@ void GlyphToType3::stack_end(TTStreamWriter& stream) /* called at end */ ** Find the area of a contour? */ double area(FWord *x, FWord *y, int n) - { + { int i; double sum; - + sum=x[n-1]*y[0]-y[n-1]*x[0]; for (i=0; i<=n-2; i++) sum += x[i]*y[i+1] - y[i]*x[i+1]; return sum; - } + } /* ** We call this routine to emmit the PostScript code ** for the character we have loaded with load_char(). */ void GlyphToType3::PSConvert(TTStreamWriter& stream) - { + { int i,j,k,fst,start_offpt; int end_offpt = 0; @@ -162,10 +162,10 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream) check_ctr[0]=1; area_ctr[0]=area(xcoor, ycoor, epts_ctr[0]+1); - for (i=1; i0) { @@ -254,26 +254,26 @@ int GlyphToType3::nextoutctr(int co) { int j; - for(j=0; jnumberOfHMetrics ) - advance_width = getuFWord( font->hmtx_table + (charindex * 4) ); + advance_width = getuFWord( font->hmtx_table + (charindex * 4) ); else advance_width = getuFWord( font->hmtx_table + ((font->numberOfHMetrics-1) * 4) ); @@ -718,7 +718,7 @@ GlyphToType3::GlyphToType3(TTStreamWriter& stream, struct TTFONT *font, int char { do_composite(stream, font, glyph); } - + stack_end(stream); } @@ -763,16 +763,16 @@ void ttfont_add_glyph_dependencies(struct TTFONT *font, std::vector& glyph_ gind = (int)getUSHORT(glyph); glyph += 2; - std::vector::iterator insertion = + std::vector::iterator insertion = std::lower_bound(glyph_ids.begin(), glyph_ids.end(), gind); if (*insertion != gind) { glyph_ids.insert(insertion, gind); glyph_stack.push(gind); } - + if (flags & ARG_1_AND_2_ARE_WORDS) glyph += 4; - else + else glyph += 2; if (flags & WE_HAVE_A_SCALE) diff --git a/ttconv/ttutil.cpp b/ttconv/ttutil.cpp index 782d021b26fc..540d849fa072 100644 --- a/ttconv/ttutil.cpp +++ b/ttconv/ttutil.cpp @@ -8,9 +8,9 @@ /* (c) Frank Siegert 1996 */ #include "global_defines.h" -#include -#include -#include +#include +#include +#include #include "pprdrv.h" #if DEBUG_TRUETYPE From 7089321fe8950473962ad0e4191d76322da57e0f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 8 May 2008 16:45:55 +0000 Subject: [PATCH 061/324] Fix kerning in SVG. svn path=/branches/v0_91_maint/; revision=5130 --- CHANGELOG | 2 ++ lib/matplotlib/backends/backend_svg.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7b1f67c92e94..368c5ff9c34d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-08 Fix kerning in SVG when embedding character outlines - MGD + 2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD 2008-05-02 On PyQt <= 3.14 there is no way to determine the underlying diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index ab468a105787..1bca2912e648 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -322,7 +322,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath): else: kern = 0 lastgind = gind - currx += kern/64.0 + currx += kern/64.0 / (self.FONT_SCALE / fontsize) svg.append(' Date: Fri, 9 May 2008 12:39:25 +0000 Subject: [PATCH 062/324] Fix /singlequote (') in Ps backend. svn path=/branches/v0_91_maint/; revision=5134 --- CHANGELOG | 2 ++ lib/matplotlib/backends/backend_ps.py | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 368c5ff9c34d..b1ab4a17338f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-09 Fix /singlequote (') in Postscript backend - MGD + 2008-05-08 Fix kerning in SVG when embedding character outlines - MGD 2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 3a8b1578ef3a..cecbd33f6f46 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -96,6 +96,7 @@ def quote_ps_string(s): s=s.replace("\\", "\\\\") s=s.replace("(", "\\(") s=s.replace(")", "\\)") + s=s.replace("'", "\\251") s=re.sub(r"[^ -~\n]", lambda x: r"\%03o"%ord(x.group()), s) return s From 6354bfc9523cfba78816620958b443b065e7f635 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 14 May 2008 12:59:46 +0000 Subject: [PATCH 063/324] Fix font embedding on Windows. svn path=/branches/v0_91_maint/; revision=5136 --- CHANGELOG | 2 ++ lib/matplotlib/cbook.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b1ab4a17338f..e7cc60db10ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD + 2008-05-09 Fix /singlequote (') in Postscript backend - MGD 2008-05-08 Fix kerning in SVG when embedding character outlines - MGD diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index f6a767d2d21e..ad640b44bced 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -412,8 +412,11 @@ def __call__(self, path): result = self._cache.get(path) if result is None: realpath = os.path.realpath(path) - stat = os.stat(realpath) - stat_key = (stat.st_ino, stat.st_dev) + if sys.platform == 'win32': + stat_key = realpath + else: + stat = os.stat(realpath) + stat_key = (stat.st_ino, stat.st_dev) result = realpath, stat_key self._cache[path] = result return result From c84d50ce4a67d8d92942702d68fe8fa1a91f0bdc Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sat, 17 May 2008 20:57:13 +0000 Subject: [PATCH 064/324] made backend agg open png in binary mode svn path=/branches/v0_91_maint/; revision=5171 --- examples/embedding_in_gtk2.py | 1 - examples/embedding_in_tk.py | 3 -- examples/embedding_in_tk2.py | 43 ++++++++++++-------------- examples/mathtext_demo.py | 2 +- examples/mathtext_examples.py | 2 +- lib/matplotlib/backends/backend_agg.py | 4 +-- 6 files changed, 23 insertions(+), 32 deletions(-) diff --git a/examples/embedding_in_gtk2.py b/examples/embedding_in_gtk2.py index cedc1d5eeb3c..54000d880781 100644 --- a/examples/embedding_in_gtk2.py +++ b/examples/embedding_in_gtk2.py @@ -5,7 +5,6 @@ """ import gtk -from matplotlib.axes import Subplot from matplotlib.figure import Figure from numpy import arange, sin, pi diff --git a/examples/embedding_in_tk.py b/examples/embedding_in_tk.py index 3831f953c0b0..f4da1a21e167 100644 --- a/examples/embedding_in_tk.py +++ b/examples/embedding_in_tk.py @@ -1,7 +1,4 @@ #!/usr/bin/env python -import matplotlib -matplotlib.use('TkAgg') - from numpy import arange, sin, pi from matplotlib.axes import Subplot from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg diff --git a/examples/embedding_in_tk2.py b/examples/embedding_in_tk2.py index 1f92dc3a9cee..d453ac09cfc1 100644 --- a/examples/embedding_in_tk2.py +++ b/examples/embedding_in_tk2.py @@ -1,43 +1,38 @@ #!/usr/bin/env python -import matplotlib -matplotlib.use('TkAgg') - -from numpy import arange, sin, pi -from matplotlib.axes import Subplot -from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg -from matplotlib.figure import Figure - import Tkinter as Tk -import sys +import numpy as np +import matplotlib.backends.backend_tkagg as backend +import matplotlib.figure as mfigure -def destroy(e): sys.exit() root = Tk.Tk() root.wm_title("Embedding in TK") -#root.bind("", destroy) +fig = mfigure.Figure(figsize=(5,4), dpi=100) +ax = fig.add_subplot(111) +t = np.arange(0.0,3.0,0.01) +s = np.sin(2*np.pi*t) -f = Figure(figsize=(5,4), dpi=100) -a = f.add_subplot(111) -t = arange(0.0,3.0,0.01) -s = sin(2*pi*t) - -a.plot(t,s) -a.set_title('Tk embedding') -a.set_xlabel('X axis label') -a.set_ylabel('Y label') +ax.plot(t,s) +ax.grid(True) +ax.set_title('Tk embedding') +ax.set_xlabel('time (s)') +ax.set_ylabel('volts (V)') # a tk.DrawingArea -canvas = FigureCanvasTkAgg(f, master=root) +canvas = backend.FigureCanvasTkAgg(fig, master=root) canvas.show() canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) -#toolbar = NavigationToolbar2TkAgg( canvas, root ) +#toolbar = backend.NavigationToolbar2TkAgg( canvas, root ) #toolbar.update() -canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) +#toolbar.pack(side=Tk.LEFT) + +def destroy(): + raise SystemExit -button = Tk.Button(master=root, text='Quit', command=sys.exit) +button = Tk.Button(master=root, text='Quit', command=destroy) button.pack(side=Tk.BOTTOM) Tk.mainloop() diff --git a/examples/mathtext_demo.py b/examples/mathtext_demo.py index 9c60a02d4cb4..4571c90e3c3b 100644 --- a/examples/mathtext_demo.py +++ b/examples/mathtext_demo.py @@ -18,7 +18,7 @@ ax.set_ylabel(r'$\Delta_{i+1}^j$', fontsize=20) tex = r'$\mathcal{R}\prod_{i=\alpha_{i+1}}^\infty a_i\sin(2 \pi f x_i)$' -ax.text(1, 1.6, tex, fontsize=20, va='bottom') +mymath = ax.text(1, 1.6, tex, fontsize=20, va='bottom') ax.legend(("Foo", "Testing $x^2$")) diff --git a/examples/mathtext_examples.py b/examples/mathtext_examples.py index 7d9581553bfe..13c49a21ed7e 100755 --- a/examples/mathtext_examples.py +++ b/examples/mathtext_examples.py @@ -49,7 +49,7 @@ r'$\widehat{abc}\widetilde{def}$', r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$', r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$', - ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' + #ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' ] from pylab import * diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index 4ef9db72cf23..b991e47e6098 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -390,14 +390,14 @@ def get_default_filetype(self): def print_raw(self, filename_or_obj, *args, **kwargs): self.draw() if type(filename_or_obj) in (str, unicode): - filename_or_obj = open(filename_or_obj, 'w') + filename_or_obj = file(filename_or_obj, 'wb') self.get_renderer()._renderer.write_rgba(filename_or_obj) print_rgba = print_raw def print_png(self, filename_or_obj, *args, **kwargs): self.draw() if type(filename_or_obj) in (str, unicode): - filename_or_obj = open(filename_or_obj, 'w') + filename_or_obj = file(filename_or_obj, 'wb') self.get_renderer()._renderer.write_png(filename_or_obj, self.figure.dpi.get()) From 32ca40bcc516390d4eb3a362b408345a550a1863 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sat, 17 May 2008 21:06:05 +0000 Subject: [PATCH 065/324] added a doc string to the branch -- just experimenting with svn merge here svn path=/branches/v0_91_maint/; revision=5172 --- lib/matplotlib/cbook.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index ad640b44bced..f41c47cffc40 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -220,6 +220,7 @@ def is_scalar(obj): return is_string_like(obj) or not iterable(obj) def is_numlike(obj): + 'return true if obj looks like a number' try: obj+1 except TypeError: return False else: return True From 5985b7b75634aca04dbcdd3e1b37fb6d5da299f9 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sat, 17 May 2008 21:28:34 +0000 Subject: [PATCH 066/324] updated the coding guide to encourage svnmerge svn path=/branches/v0_91_maint/; revision=5178 --- CODING_GUIDE | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/CODING_GUIDE b/CODING_GUIDE index 5e9e3cb449c0..dbbc67754e97 100644 --- a/CODING_GUIDE +++ b/CODING_GUIDE @@ -12,7 +12,7 @@ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk matplotli # checking out the main src svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib --username=youruser --password=yourpass -# branch checkouts, eg the transforms branch +# branch checkouts, eg the transforms branch svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms transbranch == Committing changes == @@ -41,13 +41,32 @@ in mind. MANIFEST.in. This file determines what goes into the src distribution of the mpl build. + * Keep the maintenance branch and trunk in sync here it makes sense. + If there is a bug on both that needs fixing, use svnmerge.py to + fix them. http://www.orcaware.com/svn/wiki/Svnmerge.py. The + basic procedure is: + + - get a svn copy of the branch (svn co + https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint) + and the trunk (svn co + https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib) + + - Michael advises making the change on the branch and committing + it. Make sure you svn upped on the trunk and have no local + modifications, and then from the svn trunk do + + # where these are the revision numbers. ranges also acceptable + > svnmerge.py merge -rNNN1,NNN2 + # this file is automatically created by the merge command + > svn commit -F svnmerge-commit-message.txt + == Importing and name spaces == For numpy, use: import numpy as npy a = npy.array([1,2,3]) - + For masked arrays, use: import matplotlib.numerix.npyma as ma @@ -64,8 +83,8 @@ For matplotlib main module, use: For matplotlib modules (or any other modules), use: - import matplotlib.cbook as cbook - + import matplotlib.cbook as cbook + if cbook.iterable(z): pass @@ -125,7 +144,7 @@ for older versions of emacs (emacs<22) you need to do (add-hook 'python-mode-hook (lambda () - (add-hook 'local-write-file-hooks 'delete-trailing-whitespace))) + (add-hook 'local-write-file-hooks 'delete-trailing-whitespace))) From a47b18bd3407365ee3c1992c790c66514afef72d Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sat, 17 May 2008 21:30:23 +0000 Subject: [PATCH 067/324] a few more doc string fixes in cboo svn path=/branches/v0_91_maint/; revision=5179 --- lib/matplotlib/cbook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index f41c47cffc40..029aab17fae9 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -202,21 +202,25 @@ def unique(x): return dict([ (val, 1) for val in x]).keys() def iterable(obj): + 'return true if obj is iterable' try: len(obj) except: return 0 return 1 def is_string_like(obj): + 'return true if obj looks like a string' if hasattr(obj, 'shape'): return 0 try: obj + '' except (TypeError, ValueError): return 0 return 1 def is_writable_file_like(obj): + 'return true if obj looks like a file object' return hasattr(obj, 'write') and callable(obj.write) def is_scalar(obj): + 'return true if ob is not string like and is not iterable' return is_string_like(obj) or not iterable(obj) def is_numlike(obj): From 7c1670bd7101eb309b25afda3ae542b4f7672e93 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sat, 17 May 2008 21:38:21 +0000 Subject: [PATCH 068/324] fixed some typos in the CODING_GUIDE svn path=/branches/v0_91_maint/; revision=5181 --- CODING_GUIDE | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CODING_GUIDE b/CODING_GUIDE index dbbc67754e97..b0bdef5608c9 100644 --- a/CODING_GUIDE +++ b/CODING_GUIDE @@ -41,11 +41,13 @@ in mind. MANIFEST.in. This file determines what goes into the src distribution of the mpl build. - * Keep the maintenance branch and trunk in sync here it makes sense. + * Keep the maintenance branch and trunk in sync where it makes sense. If there is a bug on both that needs fixing, use svnmerge.py to - fix them. http://www.orcaware.com/svn/wiki/Svnmerge.py. The + keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The basic procedure is: + - install svnmerge.py in your PATH + - get a svn copy of the branch (svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint) and the trunk (svn co @@ -55,8 +57,9 @@ in mind. it. Make sure you svn upped on the trunk and have no local modifications, and then from the svn trunk do - # where these are the revision numbers. ranges also acceptable + # where the NNN are the revision numbers. ranges also acceptable > svnmerge.py merge -rNNN1,NNN2 + # this file is automatically created by the merge command > svn commit -F svnmerge-commit-message.txt From f608f7c063fd3e678c5ad1fa0e5103f90aec1525 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 19 May 2008 01:09:09 +0000 Subject: [PATCH 069/324] fixed missing get_filterrad svn path=/branches/v0_91_maint/; revision=5189 --- lib/matplotlib/image.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index dddce9286326..6c598cc9c303 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -324,6 +324,7 @@ def set_filterrad(self, filterrad): def get_filterrad(self): 'return the filterrad setting' + return self._filterrad class NonUniformImage(AxesImage): From a60b45f1e5f17549a3218ec78da350e1553752f4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 19 May 2008 12:12:30 +0000 Subject: [PATCH 070/324] Use is_string_like instead of explicitly string or unicode. svn path=/branches/v0_91_maint/; revision=5191 --- lib/matplotlib/backends/backend_agg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index b991e47e6098..c14c37bcec40 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -389,14 +389,14 @@ def get_default_filetype(self): def print_raw(self, filename_or_obj, *args, **kwargs): self.draw() - if type(filename_or_obj) in (str, unicode): + if is_string_like(filename_or_obj): filename_or_obj = file(filename_or_obj, 'wb') self.get_renderer()._renderer.write_rgba(filename_or_obj) print_rgba = print_raw def print_png(self, filename_or_obj, *args, **kwargs): self.draw() - if type(filename_or_obj) in (str, unicode): + if is_string_like(filename_or_obj): filename_or_obj = file(filename_or_obj, 'wb') self.get_renderer()._renderer.write_png(filename_or_obj, self.figure.dpi.get()) From 7062d35da52992ef36266edf0d8c51a1ee45cc2d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 19 May 2008 19:05:23 +0000 Subject: [PATCH 071/324] [ 1966974 ] win32FontDirectory() can fail with access denied (Thanks, Patrik Simons) svn path=/branches/v0_91_maint/; revision=5193 --- CHANGELOG | 3 +++ lib/matplotlib/font_manager.py | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e7cc60db10ca..dd15f2dc7a78 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-05-19 Fix crash when Windows can not access the registry to + determine font path [Bug 1966974, thanks Patrik Simons] - MGD + 2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD 2008-05-09 Fix /singlequote (') in Postscript backend - MGD diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index c42935622b11..5c36387a924b 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -107,14 +107,17 @@ def win32FontDirectory(): except ImportError: pass # Fall through to default else: - user = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, MSFolders) try: + user = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, MSFolders) try: - return _winreg.QueryValueEx(user, 'Fonts')[0] - except OSError: - pass # Fall through to default - finally: - _winreg.CloseKey(user) + try: + return _winreg.QueryValueEx(user, 'Fonts')[0] + except OSError: + pass # Fall through to default + finally: + _winreg.CloseKey(user) + except OSError: + pass # Fall through to default return os.path.join(os.environ['WINDIR'], 'Fonts') def win32InstalledFonts(directory=None, fontext='ttf'): From 6a9ac5d9e07bbe59dc56ff63c8e7601c9200a0fa Mon Sep 17 00:00:00 2001 From: John Hunter Date: Tue, 20 May 2008 21:02:08 +0000 Subject: [PATCH 072/324] remove pesky date auto xlabel svn path=/branches/v0_91_maint/; revision=5205 --- CODING_GUIDE | 3 ++- lib/matplotlib/dates.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CODING_GUIDE b/CODING_GUIDE index b0bdef5608c9..c740c83de88f 100644 --- a/CODING_GUIDE +++ b/CODING_GUIDE @@ -46,7 +46,8 @@ in mind. keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The basic procedure is: - - install svnmerge.py in your PATH + - install svnmerge.py in your PATH: + wget http://svn.collab.net/repos/svn/trunk/contrib/client-side/svnmerge/svnmerge.py - get a svn copy of the branch (svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint) diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index d155b3c1d27d..27422e47a48e 100644 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -1003,7 +1003,7 @@ def axisinfo(unit): return units.AxisInfo( majloc = majloc, majfmt = majfmt, - label='date', + label='', ) else: return None axisinfo = staticmethod(axisinfo) From bf0fc71a8382cb87ef6ef4cdcda19ee694264cca Mon Sep 17 00:00:00 2001 From: Manuel Metz Date: Wed, 21 May 2008 09:47:59 +0000 Subject: [PATCH 073/324] Fixed bug in plotfile svn path=/branches/v0_91_maint/; revision=5207 --- CHANGELOG | 2 ++ lib/matplotlib/pyplot.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index dd15f2dc7a78..1fe40bd7bc87 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-21 Fix a "local variable unreferenced" bug in plotfile - MM + 2008-05-19 Fix crash when Windows can not access the registry to determine font path [Bug 1966974, thanks Patrik Simons] - MGD diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index b950ac58996d..11cb808a7f51 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -38,7 +38,7 @@ def switch_backend(newbackend): """ - Swtich the default backend to newbackend. This feature is + Switch the default backend to newbackend. This feature is EXPERIMENTAL, and is only expected to work switching to an image backend. Eg, if you have a bunch of PS scripts that you want to run from an interactive ipython session, you may want to switch to @@ -1225,7 +1225,7 @@ def getname_val(identifier): xname, x = getname_val(cols[0]) if len(cols)==1: - ax1 = fig.add_subplot(N,1,i) + ax1 = fig.add_subplot(1,1,1) funcname = plotfuncs.get(cols[0], 'plot') func = getattr(ax1, funcname) func(x, **kwargs) From e1f934ccf13ed0b9ba4be9147929641e66606e77 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 21 May 2008 13:06:51 +0000 Subject: [PATCH 074/324] Backport TkAgg segfault fix. svn path=/branches/v0_91_maint/; revision=5211 --- CHANGELOG | 2 ++ src/_tkagg.cpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1fe40bd7bc87..123a73d1f798 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-21 Fix segfault in TkAgg backend - MGD + 2008-05-21 Fix a "local variable unreferenced" bug in plotfile - MM 2008-05-19 Fix crash when Windows can not access the registry to diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index d6d903ed37c1..4d7964c308ce 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -50,6 +50,7 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp, agg::int8u *destbuffer; double l,b,r,t; int destx, desty, destwidth, destheight, deststride; + unsigned long aggl, bboxl; long mode; long nval; @@ -71,7 +72,11 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp, return TCL_ERROR; } /* get array (or object that can be converted to array) pointer */ - aggo = (PyObject*)atol(argv[2]); + if (sscanf (argv[2],"%lu",&aggl) != 1) { + Tcl_AppendResult(interp, "error casting pointer", (char *) NULL); + return TCL_ERROR; + } + aggo = (PyObject*)aggl; RendererAgg *aggRenderer = (RendererAgg *)aggo; int srcheight = (int)aggRenderer->get_height(); @@ -85,7 +90,11 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp, } /* check for bbox/blitting */ - bboxo = (PyObject*)atol(argv[4]); + if (sscanf(argv[4], "%lu", &bboxl) != 1) { + Tcl_AppendResult(interp, "error casting pointer", (char *) NULL); + return TCL_ERROR; + } + bboxo = (PyObject*)bboxl; if (bboxo != Py_None) { bbox = (Bbox*)bboxo; l = bbox->ll_api()->x_api()->val(); From 8aeb01bf3b29029b8f43fe808768aeb2ab7c24aa Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 22 May 2008 14:21:10 +0000 Subject: [PATCH 075/324] applied stans wx figsize patch svn path=/branches/v0_91_maint/; revision=5213 --- lib/matplotlib/backends/backend_wx.py | 10 ++++++++-- lib/matplotlib/figure.py | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index ce1c32f86e81..998161d6dfc6 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -1286,14 +1286,15 @@ def __init__(self, num, fig): pos =wx.Point(20,20) l,b,w,h = fig.bbox.get_bounds() wx.Frame.__init__(self, parent=None, id=-1, pos=pos, - title="Figure %d" % num, - size=(w,h)) + title="Figure %d" % num) + # Frame will be sized later by the Fit method DEBUG_MSG("__init__()", 1, self) self.num = num statbar = StatusBarWx(self) self.SetStatusBar(statbar) self.canvas = self.get_canvas(fig) + self.canvas.SetInitialSize(wx.Size(fig.bbox.width(), fig.bbox.height())) self.sizer =wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND) # By adding toolbar in sizer, we are able to put it at the bottom @@ -1412,6 +1413,11 @@ def destroy(self, *args): def set_window_title(self, title): self.window.SetTitle(title) + def resize(self, width, height) + 'Set the canvas size in pixels' + self.canvas.SetInitialSize(wx.Size(width, height)) + self.window.GetSizer().Fit(self.window) + # Identifiers for toolbar controls - images_wx contains bitmaps for the images # used in the controls. wxWindows does not provide any stock images, so I've # 'stolen' those from GTK2, and transformed them into the appropriate format. diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index a38b6ea00970..fa4b0280841f 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -327,6 +327,7 @@ def set_size_inches(self, *args, **kwargs): from the shell WARNING: forward=True is broken on all backends except GTK* + and WX* ACCEPTS: a w,h tuple with w,h in inches """ From 60f07d837338e9a10bc061736c41bbe2fb2945d5 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 22 May 2008 18:14:59 +0000 Subject: [PATCH 076/324] fixed a wx bug svn path=/branches/v0_91_maint/; revision=5215 --- lib/matplotlib/backends/backend_wx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 998161d6dfc6..27b5897bb448 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -1413,7 +1413,7 @@ def destroy(self, *args): def set_window_title(self, title): self.window.SetTitle(title) - def resize(self, width, height) + def resize(self, width, height): 'Set the canvas size in pixels' self.canvas.SetInitialSize(wx.Size(width, height)) self.window.GetSizer().Fit(self.window) From d9e2cedfe421e006dc5696910aad5ed83162465f Mon Sep 17 00:00:00 2001 From: Sameer D'Costa Date: Fri, 23 May 2008 19:27:23 +0000 Subject: [PATCH 077/324] Getting mlab.py in sync with the trunk svn path=/branches/v0_91_maint/; revision=5239 --- lib/matplotlib/mlab.py | 784 +++++++++++++++++++++++------------------ 1 file changed, 439 insertions(+), 345 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 1c4e3c9eb801..656b4e7cce1a 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -45,7 +45,6 @@ this efficiently by caching the direct FFTs. = record array helper functions = - * rec2txt : pretty print a record array * rec2csv : store record array in CSV file * csv2rec : import record array from CSV file with type inspection @@ -55,7 +54,7 @@ * rec_groupby : summarize data by groups (similar to SQL GROUP BY) * rec_summarize : helper code to filter rec array fields into new fields -For the rec viewer clases (eg rec2csv), there are a bunch of Format +For the rec viewer functions(e rec2csv), there are a bunch of Format objects you can pass into the functions that will do things like color negative values red, set percent formatting and scaling, etc. @@ -84,9 +83,10 @@ """ from __future__ import division -import sys, datetime, csv, warnings, copy, os +import csv, warnings, copy, os + +import numpy as np -import numpy as npy from matplotlib import nxutils from matplotlib import cbook @@ -100,28 +100,28 @@ def linspace(*args, **kw): warnings.warn("use numpy.linspace", DeprecationWarning) - return npy.linspace(*args, **kw) + return np.linspace(*args, **kw) def meshgrid(x,y): warnings.warn("use numpy.meshgrid", DeprecationWarning) - return npy.meshgrid(x,y) + return np.meshgrid(x,y) def mean(x, dim=None): warnings.warn("Use numpy.mean(x) or x.mean()", DeprecationWarning) if len(x)==0: return None - return npy.mean(x, axis=dim) + return np.mean(x, axis=dim) def logspace(xmin,xmax,N): - return npy.exp(npy.linspace(npy.log(xmin), npy.log(xmax), N)) + return np.exp(np.linspace(np.log(xmin), np.log(xmax), N)) def _norm(x): "return sqrt(x dot x)" - return npy.sqrt(npy.dot(x,x)) + return np.sqrt(np.dot(x,x)) def window_hanning(x): "return x times the hanning window of len(x)" - return npy.hanning(len(x))*x + return np.hanning(len(x))*x def window_none(x): "No window function; simply return x" @@ -131,7 +131,7 @@ def window_none(x): def conv(x, y, mode=2): 'convolve x with y' warnings.warn("Use numpy.convolve(x, y, mode='full')", DeprecationWarning) - return npy.convolve(x,y,mode) + return np.convolve(x,y,mode) def detrend(x, key=None): if key is None or key=='constant': @@ -141,10 +141,10 @@ def detrend(x, key=None): def demean(x, axis=0): "Return x minus its mean along the specified axis" - x = npy.asarray(x) + x = np.asarray(x) if axis: ind = [slice(None)] * axis - ind.append(npy.newaxis) + ind.append(np.newaxis) return x - x.mean(axis)[ind] return x - x.mean(axis) @@ -159,8 +159,8 @@ def detrend_none(x): def detrend_linear(y): "Return y minus best fit line; 'linear' detrending " # This is faster than an algorithm based on linalg.lstsq. - x = npy.arange(len(y), dtype=npy.float_) - C = npy.cov(x, y, bias=1) + x = np.arange(len(y), dtype=np.float_) + C = np.cov(x, y, bias=1) b = C[0,1]/C[0,0] a = y.mean() - b*x.mean() return y - (b*x + a) @@ -200,41 +200,41 @@ def psd(x, NFFT=256, Fs=2, detrend=detrend_none, if NFFT % 2: raise ValueError('NFFT must be even') - x = npy.asarray(x) # make sure we're dealing with a numpy array + x = np.asarray(x) # make sure we're dealing with a numpy array # zero pad x up to NFFT if it is shorter than NFFT if len(x)1: Pxx = Pxx.mean(axis=1) # Scale the spectrum by the norm of the window to compensate for # windowing loss; see Bendat & Piersol Sec 11.5.2 - Pxx /= (npy.abs(windowVals)**2).sum() + Pxx /= (np.abs(windowVals)**2).sum() - freqs = Fs/NFFT * npy.arange(numFreqs) + freqs = Fs/NFFT * np.arange(numFreqs) return Pxx, freqs @@ -267,32 +267,32 @@ def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none, if NFFT % 2: raise ValueError, 'NFFT must be even' - x = npy.asarray(x) # make sure we're dealing with a numpy array - y = npy.asarray(y) # make sure we're dealing with a numpy array + x = np.asarray(x) # make sure we're dealing with a numpy array + y = np.asarray(y) # make sure we're dealing with a numpy array # zero pad x and y up to NFFT if they are shorter than NFFT if len(x)1: Pxy = Pxy.mean(axis=1) - Pxy /= (npy.abs(windowVals)**2).sum() - freqs = Fs/NFFT*npy.arange(numFreqs) + Pxy /= (np.abs(windowVals)**2).sum() + freqs = Fs/NFFT*np.arange(numFreqs) return Pxy, freqs def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, @@ -342,9 +342,9 @@ def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, segments. """ - x = npy.asarray(x) + x = np.asarray(x) assert(NFFT>noverlap) - #if npy.log(NFFT)/npy.log(2) != int(npy.log(NFFT)/npy.log(2)): + #if np.log(NFFT)/np.log(2) != int(np.log(NFFT)/np.log(2)): # raise ValueError, 'NFFT must be a power of 2' if NFFT % 2: raise ValueError('NFFT must be even') @@ -353,42 +353,42 @@ def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, # zero pad x up to NFFT if it is shorter than NFFT if len(x)1: Pxy = npy.mean(Pxy) - Pxy = npy.divide(Pxy, normVal) - Cxy[(i,j)] = npy.divide(npy.absolute(Pxy)**2, Pxx[i]*Pxx[j]) - Phase[(i,j)] = npy.arctan2(Pxy.imag, Pxy.real) + Pxy = FFTSlices[i] * np.conjugate(FFTSlices[j]) + if numSlices>1: Pxy = np.mean(Pxy) + Pxy = np.divide(Pxy, normVal) + Cxy[(i,j)] = np.divide(np.absolute(Pxy)**2, Pxx[i]*Pxx[j]) + Phase[(i,j)] = np.arctan2(Pxy.imag, Pxy.real) - freqs = Fs/NFFT*npy.arange(numFreqs) + freqs = Fs/NFFT*np.arange(numFreqs) if returnPxx: return Cxy, Phase, freqs, Pxx else: @@ -684,16 +684,16 @@ def entropy(y, bins): Sanalytic = 0.5 * ( 1.0 + log(2*pi*sigma**2.0) ) """ - n,bins = npy.histogram(y, bins) - n = n.astype(npy.float_) + n,bins = np.histogram(y, bins) + n = n.astype(np.float_) - n = npy.take(n, npy.nonzero(n)[0]) # get the positive + n = np.take(n, np.nonzero(n)[0]) # get the positive - p = npy.divide(n, len(y)) + p = np.divide(n, len(y)) delta = bins[1]-bins[0] - S = -1.0*npy.sum(p*log(p)) + log(delta) - #S = -1.0*npy.sum(p*log(p)) + S = -1.0*np.sum(p*log(p)) + log(delta) + #S = -1.0*np.sum(p*log(p)) return S def hist(y, bins=10, normed=0): @@ -711,12 +711,12 @@ def hist(y, bins=10, normed=0): Credits: the Numeric 22 documentation """ warnings.warn("Use numpy.histogram()", DeprecationWarning) - return npy.histogram(y, bins=bins, range=None, normed=normed) + return np.histogram(y, bins=bins, range=None, normed=normed) def normpdf(x, *args): "Return the normal pdf evaluated at x; args provides mu, sigma" mu, sigma = args - return 1/(npy.sqrt(2*npy.pi)*sigma)*npy.exp(-0.5 * (1/sigma*(x - mu))**2) + return 1/(np.sqrt(2*np.pi)*sigma)*np.exp(-0.5 * (1/sigma*(x - mu))**2) def levypdf(x, gamma, alpha): @@ -726,26 +726,26 @@ def levypdf(x, gamma, alpha): if N%2 != 0: raise ValueError, 'x must be an event length array; try\n' + \ - 'x = npy.linspace(minx, maxx, N), where N is even' + 'x = np.linspace(minx, maxx, N), where N is even' dx = x[1]-x[0] - f = 1/(N*dx)*npy.arange(-N/2, N/2, npy.float_) + f = 1/(N*dx)*np.arange(-N/2, N/2, np.float_) - ind = npy.concatenate([npy.arange(N/2, N, int), - npy.arange(0, N/2, int)]) + ind = np.concatenate([np.arange(N/2, N, int), + np.arange(0, N/2, int)]) df = f[1]-f[0] - cfl = exp(-gamma*npy.absolute(2*pi*f)**alpha) + cfl = exp(-gamma*np.absolute(2*pi*f)**alpha) - px = npy.fft.fft(npy.take(cfl,ind)*df).astype(npy.float_) - return npy.take(px, ind) + px = np.fft.fft(np.take(cfl,ind)*df).astype(np.float_) + return np.take(px, ind) def find(condition): "Return the indices where ravel(condition) is true" - res, = npy.nonzero(npy.ravel(condition)) + res, = np.nonzero(np.ravel(condition)) return res def trapz(x, y): @@ -753,12 +753,12 @@ def trapz(x, y): Trapezoidal integral of y(x). """ warnings.warn("Use numpy.trapz(y,x) instead of trapz(x,y)", DeprecationWarning) - return npy.trapz(y, x) + return np.trapz(y, x) #if len(x)!=len(y): # raise ValueError, 'x and y must have the same length' #if len(x)<2: # raise ValueError, 'x and y must have > 1 element' - #return npy.sum(0.5*npy.diff(x)*(y[1:]+y[:-1])) + #return np.sum(0.5*np.diff(x)*(y[1:]+y[:-1])) @@ -769,23 +769,23 @@ def longest_contiguous_ones(x): If there are two equally long stretches, pick the first """ - x = npy.ravel(x) + x = np.ravel(x) if len(x)==0: - return npy.array([]) + return np.array([]) ind = (x==0).nonzero()[0] if len(ind)==0: - return npy.arange(len(x)) + return np.arange(len(x)) if len(ind)==len(x): - return npy.array([]) + return np.array([]) - y = npy.zeros( (len(x)+2,), x.dtype) + y = np.zeros( (len(x)+2,), x.dtype) y[1:-1] = x - dif = npy.diff(y) + dif = np.diff(y) up = (dif == 1).nonzero()[0]; dn = (dif == -1).nonzero()[0]; i = (dn-up == max(dn - up)).nonzero()[0][0] - ind = npy.arange(up[i], dn[i]) + ind = np.arange(up[i], dn[i]) return ind @@ -809,7 +809,7 @@ def prepca(P, frac=0): R13 Neural Network Toolbox but is not found in later versions; its successor seems to be called "processpcs". """ - U,s,v = npy.linalg.svd(P) + U,s,v = np.linalg.svd(P) varEach = s**2/P.shape[1] totVar = varEach.sum() fracVar = varEach/totVar @@ -817,7 +817,7 @@ def prepca(P, frac=0): # select the components that are greater Trans = U[:,ind].transpose() # The transformed data - Pcomponents = npy.dot(Trans,P) + Pcomponents = np.dot(Trans,P) return Pcomponents, Trans, fracVar[ind] def prctile(x, p = (0.0, 25.0, 50.0, 75.0, 100.0)): @@ -830,16 +830,16 @@ def prctile(x, p = (0.0, 25.0, 50.0, 75.0, 100.0)): """ - x = npy.array(x).ravel() # we need a copy + x = np.array(x).ravel() # we need a copy x.sort() Nx = len(x) if not cbook.iterable(p): return x[int(p*Nx/100.0)] - p = npy.asarray(p)* Nx/100.0 + p = np.asarray(p)* Nx/100.0 ind = p.astype(int) - ind = npy.where(ind>=Nx, Nx-1, ind) + ind = np.where(ind>=Nx, Nx-1, ind) return x.take(ind) def prctile_rank(x, p): @@ -856,15 +856,15 @@ def prctile_rank(x, p): """ if not cbook.iterable(p): - p = npy.arange(100.0/p, 100.0, 100.0/p) + p = np.arange(100.0/p, 100.0, 100.0/p) else: - p = npy.asarray(p) + p = np.asarray(p) if p.max()<=1 or p.min()<0 or p.max()>100: raise ValueError('percentiles should be in range 0..100, not 0..1') ptiles = prctile(x, p) - return npy.searchsorted(ptiles, x) + return np.searchsorted(ptiles, x) def center_matrix(M, dim=0): """ @@ -873,12 +873,12 @@ def center_matrix(M, dim=0): if dim=1 operate on columns instead of rows. (dim is opposite to the numpy axis kwarg.) """ - M = npy.asarray(M, npy.float_) + M = np.asarray(M, np.float_) if dim: M = (M - M.mean(axis=0)) / M.std(axis=0) else: - M = (M - M.mean(axis=1)[:,npy.newaxis]) - M = M / M.std(axis=1)[:,npy.newaxis] + M = (M - M.mean(axis=1)[:,np.newaxis]) + M = M / M.std(axis=1)[:,np.newaxis] return M @@ -922,25 +922,25 @@ def derivs(x,t): try: Ny = len(y0) except TypeError: - yout = npy.zeros( (len(t),), npy.float_) + yout = np.zeros( (len(t),), np.float_) else: - yout = npy.zeros( (len(t), Ny), npy.float_) + yout = np.zeros( (len(t), Ny), np.float_) yout[0] = y0 i = 0 - for i in npy.arange(len(t)-1): + for i in np.arange(len(t)-1): thist = t[i] dt = t[i+1] - thist dt2 = dt/2.0 y0 = yout[i] - k1 = npy.asarray(derivs(y0, thist)) - k2 = npy.asarray(derivs(y0 + dt2*k1, thist+dt2)) - k3 = npy.asarray(derivs(y0 + dt2*k2, thist+dt2)) - k4 = npy.asarray(derivs(y0 + dt*k3, thist+dt)) + k1 = np.asarray(derivs(y0, thist)) + k2 = np.asarray(derivs(y0 + dt2*k1, thist+dt2)) + k3 = np.asarray(derivs(y0 + dt2*k2, thist+dt2)) + k4 = np.asarray(derivs(y0 + dt*k3, thist+dt)) yout[i+1] = y0 + dt/6.0*(k1 + 2*k2 + 2*k3 + k4) return yout @@ -957,8 +957,8 @@ def bivariate_normal(X, Y, sigmax=1.0, sigmay=1.0, rho = sigmaxy/(sigmax*sigmay) z = Xmu**2/sigmax**2 + Ymu**2/sigmay**2 - 2*rho*Xmu*Ymu/(sigmax*sigmay) - denom = 2*npy.pi*sigmax*sigmay*npy.sqrt(1-rho**2) - return npy.exp( -z/(2*(1-rho**2))) / denom + denom = 2*np.pi*sigmax*sigmay*np.sqrt(1-rho**2) + return np.exp( -z/(2*(1-rho**2))) / denom @@ -970,22 +970,22 @@ def get_xyz_where(Z, Cond): where x and y are the indices into Z and z are the values of Z at those indices. x,y,z are 1D arrays """ - X,Y = npy.indices(Z.shape) + X,Y = np.indices(Z.shape) return X[Cond], Y[Cond], Z[Cond] def get_sparse_matrix(M,N,frac=0.1): 'return a MxN sparse matrix with frac elements randomly filled' - data = npy.zeros((M,N))*0. + data = np.zeros((M,N))*0. for i in range(int(M*N*frac)): - x = npy.random.randint(0,M-1) - y = npy.random.randint(0,N-1) - data[x,y] = npy.random.rand() + x = np.random.randint(0,M-1) + y = np.random.randint(0,N-1) + data[x,y] = np.random.rand() return data def dist(x,y): 'return the distance between two points' d = x-y - return npy.sqrt(npy.dot(d,d)) + return np.sqrt(np.dot(d,d)) def dist_point_to_segment(p, s0, s1): """ @@ -996,17 +996,17 @@ def dist_point_to_segment(p, s0, s1): This algorithm from http://softsurfer.com/Archive/algorithm_0102/algorithm_0102.htm#Distance%20to%20Ray%20or%20Segment """ - p = npy.asarray(p, npy.float_) - s0 = npy.asarray(s0, npy.float_) - s1 = npy.asarray(s1, npy.float_) + p = np.asarray(p, np.float_) + s0 = np.asarray(s0, np.float_) + s1 = np.asarray(s1, np.float_) v = s1 - s0 w = p - s0 - c1 = npy.dot(w,v); + c1 = np.dot(w,v); if ( c1 <= 0 ): return dist(p, s0); - c2 = npy.dot(v,v) + c2 = np.dot(v,v) if ( c2 <= c1 ): return dist(p, s1); @@ -1049,11 +1049,11 @@ def fftsurr(x, detrend=detrend_none, window=window_none): x=window*detrend(x) else: x = window(detrend(x)) - z = npy.fft.fft(x) - a = 2.*npy.pi*1j - phase = a * npy.random.rand(len(x)) - z = z*npy.exp(phase) - return npy.fft.ifft(z).real + z = np.fft.fft(x) + a = 2.*np.pi*1j + phase = a * np.random.rand(len(x)) + z = z*np.exp(phase) + return np.fft.ifft(z).real def liaupunov(x, fprime): @@ -1066,7 +1066,7 @@ def liaupunov(x, fprime): caveat emptor. It also seems that this function's name is badly misspelled. """ - return npy.mean(npy.log(npy.absolute(fprime(x)))) + return np.mean(np.log(np.absolute(fprime(x)))) class FIFOBuffer: """ @@ -1088,10 +1088,10 @@ class FIFOBuffer: """ def __init__(self, nmax): 'buffer up to nmax points' - self._xa = npy.zeros((nmax,), npy.float_) - self._ya = npy.zeros((nmax,), npy.float_) - self._xs = npy.zeros((nmax,), npy.float_) - self._ys = npy.zeros((nmax,), npy.float_) + self._xa = np.zeros((nmax,), np.float_) + self._ya = np.zeros((nmax,), np.float_) + self._xs = np.zeros((nmax,), np.float_) + self._ys = np.zeros((nmax,), np.float_) self._ind = 0 self._nmax = nmax self.dataLim = None @@ -1149,9 +1149,9 @@ def update_datalim_to_current(self): def movavg(x,n): 'compute the len(n) moving average of x' - w = npy.empty((n,), dtype=npy.float_) + w = np.empty((n,), dtype=np.float_) w[:] = 1.0/n - return npy.convolve(x, w, mode='valid') + return np.convolve(x, w, mode='valid') def save(fname, X, fmt='%.18e',delimiter=' '): """ @@ -1185,7 +1185,7 @@ def save(fname, X, fmt='%.18e',delimiter=' '): raise ValueError('fname must be a string or file handle') - X = npy.asarray(X) + X = np.asarray(X) origShape = None if X.ndim == 1: origShape = X.shape @@ -1278,7 +1278,7 @@ def splitfunc(x): thisLen = len(row) X.append(row) - X = npy.array(X, npy.float_) + X = np.array(X, np.float_) r,c = X.shape if r==1 or c==1: X.shape = max(r,c), @@ -1313,10 +1313,10 @@ def slopes(x,y): Icelandic Meteorological Office, March 2006 halldor at vedur.is) """ # Cast key variables as float. - x=npy.asarray(x, npy.float_) - y=npy.asarray(y, npy.float_) + x=np.asarray(x, np.float_) + y=np.asarray(y, np.float_) - yp=npy.zeros(y.shape, npy.float_) + yp=np.zeros(y.shape, np.float_) dx=x[1:] - x[:-1] dy=y[1:] - y[:-1] @@ -1371,18 +1371,18 @@ def stineman_interp(xi,x,y,yp=None): """ # Cast key variables as float. - x=npy.asarray(x, npy.float_) - y=npy.asarray(y, npy.float_) + x=np.asarray(x, np.float_) + y=np.asarray(y, np.float_) assert x.shape == y.shape N=len(y) if yp is None: yp = slopes(x,y) else: - yp=npy.asarray(yp, npy.float_) + yp=np.asarray(yp, np.float_) - xi=npy.asarray(xi, npy.float_) - yi=npy.zeros(xi.shape, npy.float_) + xi=np.asarray(xi, np.float_) + yi=np.zeros(xi.shape, np.float_) # calculate linear slopes dx = x[1:] - x[:-1] @@ -1391,7 +1391,7 @@ def stineman_interp(xi,x,y,yp=None): # find the segment each xi is in # this line actually is the key to the efficiency of this implementation - idx = npy.searchsorted(x[1:-1], xi) + idx = np.searchsorted(x[1:-1], xi) # now we have generally: x[idx[j]] <= xi[j] <= x[idx[j]+1] # except at the boundaries, where it may be that xi[j] < x[0] or xi[j] > x[-1] @@ -1412,7 +1412,7 @@ def stineman_interp(xi,x,y,yp=None): # does more calculations than necessary but exploiting the power # of numpy, this is far more efficient than coding a loop by hand # in Python - yi = yo + dy1dy2 * npy.choose(npy.array(npy.sign(dy1dy2), npy.int32)+1, + yi = yo + dy1dy2 * np.choose(np.array(np.sign(dy1dy2), np.int32)+1, ((2*xi-xidx-xidxp1)/((dy1-dy2)*(xidxp1-xidx)), 0.0, 1/(dy1+dy2),)) @@ -1426,7 +1426,7 @@ def inside_poly(points, verts): return value is a sequence of indices into points for the points that are inside the polygon """ - res, = npy.nonzero(nxutils.points_inside_poly(points, verts)) + res, = np.nonzero(nxutils.points_inside_poly(points, verts)) return res def poly_below(xmin, xs, ys): @@ -1439,13 +1439,13 @@ def poly_below(xmin, xs, ys): xv, yv = poly_below(0, x, y) ax.fill(xv, yv) """ - xs = npy.asarray(xs) - ys = npy.asarray(ys) + xs = np.asarray(xs) + ys = np.asarray(ys) Nx = len(xs) Ny = len(ys) assert(Nx==Ny) - x = xmin*npy.ones(2*Nx) - y = npy.ones(2*Nx) + x = xmin*np.ones(2*Nx) + y = np.ones(2*Nx) x[:Nx] = xs y[:Nx] = ys y[Nx:] = ys[::-1] @@ -1462,13 +1462,13 @@ def poly_between(x, ylower, yupper): """ Nx = len(x) if not cbook.iterable(ylower): - ylower = ylower*npy.ones(Nx) + ylower = ylower*np.ones(Nx) if not cbook.iterable(yupper): - yupper = yupper*npy.ones(Nx) + yupper = yupper*np.ones(Nx) - x = npy.concatenate( (x, x[::-1]) ) - y = npy.concatenate( (yupper, ylower[::-1]) ) + x = np.concatenate( (x, x[::-1]) ) + y = np.concatenate( (yupper, ylower[::-1]) ) return x,y ### the following code was written and submitted by Fernando Perez @@ -1532,8 +1532,8 @@ def exp_safe(x): floating point exception handling with access to the underlying hardware.""" - if type(x) is npy.ndarray: - return exp(npy.clip(x,exp_safe_MIN,exp_safe_MAX)) + if type(x) is np.ndarray: + return exp(np.clip(x,exp_safe_MIN,exp_safe_MAX)) else: return math.exp(x) @@ -1543,14 +1543,14 @@ def amap(fn,*args): Works like map(), but it returns an array. This is just a convenient shorthand for numpy.array(map(...)) """ - return npy.array(map(fn,*args)) + return np.array(map(fn,*args)) #from numpy import zeros_like def zeros_like(a): """Return an array of zeros of the shape and typecode of a.""" warnings.warn("Use numpy.zeros_like(a)", DeprecationWarning) - return npy.zeros_like(a) + return np.zeros_like(a) #from numpy import sum as sum_flat def sum_flat(a): @@ -1558,32 +1558,32 @@ def sum_flat(a): It uses a.flat, and if a is not contiguous, a call to ravel(a) is made.""" warnings.warn("Use numpy.sum(a) or a.sum()", DeprecationWarning) - return npy.sum(a) + return np.sum(a) #from numpy import mean as mean_flat def mean_flat(a): """Return the mean of all the elements of a, flattened out.""" warnings.warn("Use numpy.mean(a) or a.mean()", DeprecationWarning) - return npy.mean(a) + return np.mean(a) def rms_flat(a): """Return the root mean square of all the elements of a, flattened out.""" - return npy.sqrt(npy.mean(npy.absolute(a)**2)) + return np.sqrt(np.mean(np.absolute(a)**2)) def l1norm(a): """Return the l1 norm of a, flattened out. Implemented as a separate function (not a call to norm() for speed).""" - return npy.sum(npy.absolute(a)) + return np.sum(np.absolute(a)) def l2norm(a): """Return the l2 norm of a, flattened out. Implemented as a separate function (not a call to norm() for speed).""" - return npy.sqrt(npy.sum(npy.absolute(a)**2)) + return np.sqrt(np.sum(np.absolute(a)**2)) def norm_flat(a,p=2): """norm(a,p=2) -> l-p norm of a.flat @@ -1595,9 +1595,9 @@ def norm_flat(a,p=2): # This function was being masked by a more general norm later in # the file. We may want to simply delete it. if p=='Infinity': - return npy.amax(npy.absolute(a)) + return np.amax(np.absolute(a)) else: - return (npy.sum(npy.absolute(a)**p))**(1.0/p) + return (np.sum(np.absolute(a)**p))**(1.0/p) def frange(xini,xfin=None,delta=None,**kw): """frange([start,] stop[, step, keywords]) -> array of floats @@ -1657,7 +1657,7 @@ def frange(xini,xfin=None,delta=None,**kw): # round finds the nearest, so the endpoint can be up to # delta/2 larger than xfin. - return npy.arange(npts)*delta+xini + return np.arange(npts)*delta+xini # end frange() #import numpy.diag as diagonal_matrix @@ -1665,7 +1665,7 @@ def diagonal_matrix(diag): """Return square diagonal matrix whose non-zero elements are given by the input array.""" warnings.warn("Use numpy.diag(d)", DeprecationWarning) - return npy.diag(diag) + return np.diag(diag) def identity(n, rank=2, dtype='l', typecode=None): """identity(n,r) returns the identity matrix of shape (n,n,...,n) (rank r). @@ -1686,7 +1686,7 @@ def identity(n, rank=2, dtype='l', typecode=None): warnings.warn("Use dtype kwarg instead of typecode", DeprecationWarning) dtype = typecode - iden = npy.zeros((n,)*rank, dtype) + iden = np.zeros((n,)*rank, dtype) for i in range(n): idx = (i,)*rank iden[idx] = 1 @@ -1761,7 +1761,7 @@ def fromfunction_kw(function, dimensions, **kwargs): The function MyFunction() is responsible for handling the dictionary of keywords it will receive.""" warnings.warn("Use numpy.fromfunction()", DeprecationWarning) - return npy.fromfunction(function, dimensions, **kwargs) + return np.fromfunction(function, dimensions, **kwargs) ### end fperez numutils code @@ -1792,7 +1792,7 @@ def fix(x): For negative numbers is equivalent to ceil and for positive to floor. """ warnings.warn("Use numpy.fix()", DeprecationWarning) - return npy.fix(x) + return np.fix(x) def rem(x,y): """ @@ -1802,10 +1802,10 @@ def rem(x,y): This also differs from numpy.remainder, which uses floor instead of fix. """ - x,y = npy.asarray(x), npy.asarray(y) - if npy.any(y == 0): + x,y = np.asarray(x), np.asarray(y) + if np.any(y == 0): return None - return x - y * npy.fix(x/y) + return x - y * np.fix(x/y) def norm(x,y=2): @@ -1830,28 +1830,28 @@ def norm(x,y=2): NORM(V,-inf) = min(abs(V)). """ - x = npy.asarray(x) + x = np.asarray(x) if x.ndim == 2: if y==2: - return npy.max(npy.linalg.svd(x)[1]) + return np.max(np.linalg.svd(x)[1]) elif y==1: - return npy.max(npy.sum(npy.absolute((x)), axis=0)) + return np.max(np.sum(np.absolute((x)), axis=0)) elif y=='inf': - return npy.max(npy.sum(npy.absolute((npy.transpose(x))), axis=0)) + return np.max(np.sum(np.absolute((np.transpose(x))), axis=0)) elif y=='fro': - xx = npy.dot(x.transpose(), x) - return npy.sqrt(npy.sum(npy.diag(xx), axis=0)) + xx = np.dot(x.transpose(), x) + return np.sqrt(np.sum(np.diag(xx), axis=0)) else: raise ValueError('Second argument not permitted for matrices') else: - xa = npy.absolute(x) + xa = np.absolute(x) if y == 'inf': - return npy.max(xa) + return np.max(xa) elif y == '-inf': - return npy.min(xa) + return np.min(xa) else: - return npy.power(npy.sum(npy.power(xa,y)),1/float(y)) + return np.power(np.sum(np.power(xa,y)),1/float(y)) def orth(A): @@ -1865,8 +1865,8 @@ def orth(A): rank of A. """ - A = npy.asarray(A) - U,S,V = npy.linalg.svd(A) + A = np.asarray(A) + U,S,V = np.linalg.svd(A) m,n = A.shape if m > 1: @@ -1876,9 +1876,9 @@ def orth(A): else: s = 0 - tol = max(m,n) * npy.max(s) * _eps_approx - r = npy.sum(s > tol) - Q = npy.take(U,range(r),1) + tol = max(m,n) * np.max(s) * _eps_approx + r = np.sum(s > tol) + Q = np.take(U,range(r),1) return Q @@ -1891,12 +1891,12 @@ def rank(x): Note that numerix.mlab.rank() is not equivalent to Matlab's rank. This function is! """ - x = npy.asarray(x) - s = npy.linalg.svd(x, compute_uv=False) - maxabs = npy.max(npy.absolute(s)) + x = np.asarray(x) + s = np.linalg.svd(x, compute_uv=False) + maxabs = np.max(np.absolute(s)) maxdim = max(x.shape) tol = maxabs * maxdim * _eps_approx - return npy.sum(s > tol) + return np.sum(s > tol) def sqrtm(x): """ @@ -1904,7 +1904,8 @@ def sqrtm(x): This means that s=sqrtm(x) implies dot(s,s) = x. Note that s and x are matrices. """ - return mfuncC(npy.sqrt, x) + return mfuncC(np.sqrt, x) + def mfuncC(f, x): """ @@ -1913,12 +1914,12 @@ def mfuncC(f, x): This function is needed by sqrtm and allows further functions. """ - x = npy.asarray(x) - (v,uT) = npy.linalg.eig(x) - V = npy.diag(f(v+0j)) + x = np.asarray(x) + (v,uT) = np.linalg.eig(x) + V = np.diag(f(v+0j)) # todo: warning: this is not exactly what matlab does # MATLAB "B/A is roughly the same as B*inv(A)" - y = npy.dot(uT, npy.dot(V, npy.linalg.inv(uT))) + y = np.dot(uT, np.dot(V, np.linalg.inv(uT))) return approx_real(y) def approx_real(x): @@ -1927,9 +1928,9 @@ def approx_real(x): approx_real(x) : returns x.real if |x.imag| < |x.real| * _eps_approx. This function is needed by sqrtm and allows further functions. """ - ai = npy.absolute(x.imag) - ar = npy.absolute(x.real) - if npy.max(ai) <= npy.max(ar) * _eps_approx: + ai = np.absolute(x.imag) + ar = np.absolute(x.real) + if np.max(ai) <= np.max(ar) * _eps_approx: return x.real else: return x @@ -1940,29 +1941,52 @@ def approx_real(x): def safe_isnan(x): 'isnan for arbitrary types' - try: b = npy.isnan(x) + try: b = np.isnan(x) except NotImplementedError: return False else: return b - def safe_isinf(x): 'isnan for arbitrary types' - try: b = npy.isinf(x) + try: b = np.isinf(x) except NotImplementedError: return False else: return b - def rec_append_field(rec, name, arr, dtype=None): 'return a new record array with field name populated with data from array arr' - arr = npy.asarray(arr) - if dtype is None: - dtype = arr.dtype - newdtype = npy.dtype(rec.dtype.descr + [(name, dtype)]) - newrec = npy.empty(rec.shape, dtype=newdtype) + warnings.warn("use rec_append_fields", DeprecationWarning) + return rec_append_fields(rec, name, arr, dtype) + +def rec_append_fields(rec, names, arrs, dtypes=None): + """ + return a new record array with field names populated with data + from arrays in arrs. If appending a single field then names, arrs + and dtypes do not have to be lists. They can just be the values themselves. + """ + if (not cbook.is_string_like(names) and cbook.iterable(names) \ + and len(names) and cbook.is_string_like(names[0])): + if len(names) != len(arrs): + raise ValueError, "number of arrays do not match number of names" + else: # we have only 1 name and 1 array + names = [names] + arrs = [arrs] + arrs = map(np.asarray, arrs) + if dtypes is None: + dtypes = [a.dtype for a in arrs] + elif not cbook.iterable(dtypes): + dtypes = [dtypes] + if len(arrs) != len(dtypes): + if len(dtypes) == 1: + dtypes = dtypes * len(arrs) + else: + raise ValueError, "dtypes must be None, a single dtype or a list" + + newdtype = np.dtype(rec.dtype.descr + zip(names, dtypes)) + newrec = np.empty(rec.shape, dtype=newdtype) for field in rec.dtype.fields: newrec[field] = rec[field] - newrec[name] = arr - return newrec.view(npy.recarray) + for name, arr in zip(names, arrs): + newrec[name] = arr + return newrec.view(np.recarray) def rec_drop_fields(rec, names): @@ -1971,86 +1995,15 @@ def rec_drop_fields(rec, names): names = set(names) Nr = len(rec) - newdtype = npy.dtype([(name, rec.dtype[name]) for name in rec.dtype.names + newdtype = np.dtype([(name, rec.dtype[name]) for name in rec.dtype.names if name not in names]) - newrec = npy.empty(Nr, dtype=newdtype) + newrec = np.empty(Nr, dtype=newdtype) for field in newdtype.names: newrec[field] = rec[field] - return newrec.view(npy.recarray) - - -def rec_join(key, r1, r2): - """ - join record arrays r1 and r2 on key; key is a tuple of field - names. if r1 and r2 have equal values on all the keys in the key - tuple, then their fields will be merged into a new record array - containing the intersection of the fields of r1 and r2 - """ - - for name in key: - if name not in r1.dtype.names: - raise ValueError('r1 does not have key field %s'%name) - if name not in r2.dtype.names: - raise ValueError('r2 does not have key field %s'%name) - - def makekey(row): - return tuple([row[name] for name in key]) - - - names = list(r1.dtype.names) + [name for name in r2.dtype.names if name not in set(r1.dtype.names)] - - - - r1d = dict([(makekey(row),i) for i,row in enumerate(r1)]) - r2d = dict([(makekey(row),i) for i,row in enumerate(r2)]) - - r1keys = set(r1d.keys()) - r2keys = set(r2d.keys()) - - keys = r1keys & r2keys - - r1ind = [r1d[k] for k in keys] - r2ind = [r2d[k] for k in keys] - + return newrec.view(np.recarray) - r1 = r1[r1ind] - r2 = r2[r2ind] - - r2 = rec_drop_fields(r2, r1.dtype.names) - - - def key_desc(name): - 'if name is a string key, use the larger size of r1 or r2 before merging' - dt1 = r1.dtype[name] - if dt1.type != npy.string_: - return (name, dt1.descr[0][1]) - - dt2 = r1.dtype[name] - assert dt2==dt1 - if dt1.num>dt2.num: - return (name, dt1.descr[0][1]) - else: - return (name, dt2.descr[0][1]) - - - - keydesc = [key_desc(name) for name in key] - - newdtype = npy.dtype(keydesc + - [desc for desc in r1.dtype.descr if desc[0] not in key ] + - [desc for desc in r2.dtype.descr if desc[0] not in key ] ) - - - newrec = npy.empty(len(r1), dtype=newdtype) - for field in r1.dtype.names: - newrec[field] = r1[field] - - for field in r2.dtype.names: - newrec[field] = r2[field] - - return newrec.view(npy.recarray) def rec_groupby(r, groupby, stats): @@ -2063,7 +2016,7 @@ def rec_groupby(r, groupby, stats): stats is a sequence of (attr, func, outname) which will call x = func(attr) and assign x to the record array output with attribute outname. - Eg, stats = ( ('sales', len, 'numsales'), ('sales', npy.mean, 'avgsale') ) + Eg, stats = ( ('sales', len, 'numsales'), ('sales', np.mean, 'avgsale') ) return record array has dtype names for each attribute name in in the the 'groupby' argument, with the associated group values, and @@ -2095,7 +2048,7 @@ def rec_groupby(r, groupby, stats): attrs, funcs, outnames = zip(*stats) names = list(groupby) names.extend(outnames) - return npy.rec.fromrecords(rows, names=names) + return np.rec.fromrecords(rows, names=names) @@ -2114,16 +2067,23 @@ def rec_summarize(r, summaryfuncs): for attr, func, outname in summaryfuncs: names.append(outname) - arrays.append(npy.asarray(func(r[attr]))) + arrays.append(np.asarray(func(r[attr]))) + + return np.rec.fromarrays(arrays, names=names) - return npy.rec.fromarrays(arrays, names=names) -def rec_join(key, r1, r2): +def rec_join(key, r1, r2, jointype='inner', defaults=None): """ join record arrays r1 and r2 on key; key is a tuple of field names. if r1 and r2 have equal values on all the keys in the key tuple, then their fields will be merged into a new record array containing the intersection of the fields of r1 and r2 + + The jointype keyword can be 'inner', 'outer', 'leftouter'. + To do a rightouter join just reverse r1 and r2. + + The defaults keyword is a dictionary filled with + {column_name:default_value} pairs. """ for name in key: @@ -2141,16 +2101,21 @@ def makekey(row): r1keys = set(r1d.keys()) r2keys = set(r2d.keys()) - keys = r1keys & r2keys + common_keys = r1keys & r2keys - r1ind = npy.array([r1d[k] for k in keys]) - r2ind = npy.array([r2d[k] for k in keys]) + r1ind = np.array([r1d[k] for k in common_keys]) + r2ind = np.array([r2d[k] for k in common_keys]) - # Make sure that the output rows have the same relative order as r1 - sortind = r1ind.argsort() - - r1 = r1[r1ind[sortind]] - r2 = r2[r2ind[sortind]] + common_len = len(common_keys) + left_len = right_len = 0 + if jointype == "outer" or jointype == "leftouter": + left_keys = r1keys.difference(r2keys) + left_ind = np.array([r1d[k] for k in left_keys]) + left_len = len(left_ind) + if jointype == "outer": + right_keys = r2keys.difference(r1keys) + right_ind = np.array([r2d[k] for k in right_keys]) + right_len = len(right_ind) r2 = rec_drop_fields(r2, r1.dtype.names) @@ -2158,7 +2123,7 @@ def makekey(row): def key_desc(name): 'if name is a string key, use the larger size of r1 or r2 before merging' dt1 = r1.dtype[name] - if dt1.type != npy.string_: + if dt1.type != np.string_: return (name, dt1.descr[0][1]) dt2 = r1.dtype[name] @@ -2172,25 +2137,44 @@ def key_desc(name): keydesc = [key_desc(name) for name in key] - newdtype = npy.dtype(keydesc + + newdtype = np.dtype(keydesc + [desc for desc in r1.dtype.descr if desc[0] not in key ] + [desc for desc in r2.dtype.descr if desc[0] not in key ] ) - newrec = npy.empty(len(r1), dtype=newdtype) + newrec = np.empty(common_len + left_len + right_len, dtype=newdtype) + + if jointype != 'inner' and defaults is not None: # fill in the defaults enmasse + newrec_fields = newrec.dtype.fields.keys() + for k, v in defaults.items(): + if k in newrec_fields: + newrec[k] = v + for field in r1.dtype.names: - newrec[field] = r1[field] + newrec[field][:common_len] = r1[field][r1ind] + if jointype == "outer" or jointype == "leftouter": + newrec[field][common_len:(common_len+left_len)] = r1[field][left_ind] for field in r2.dtype.names: - newrec[field] = r2[field] + newrec[field][:common_len] = r2[field][r2ind] + if jointype == "outer": + newrec[field][-right_len:] = r2[field][right_ind[right_ind.argsort()]] + + # sort newrec using the same order as r1 + sort_indices = r1ind.copy() + if jointype == "outer" or jointype == "leftouter": + sort_indices = np.append(sort_indices, left_ind) + newrec[:(common_len+left_len)] = newrec[sort_indices.argsort()] + + + return newrec.view(np.recarray) - return newrec.view(npy.recarray) def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',', - converterd=None, names=None, missing=None): + converterd=None, names=None, missing='', missingd=None): """ Load data from comma/space/tab delimited file in fname into a - numpy record array and return the record array. + numpy (m)record array and return the record array. If names is None, a header row is required to automatically assign the recarray names. The headers will be lower cased, spaces will @@ -2211,18 +2195,29 @@ def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',', data type. When set to zero all rows are validated. converterd, if not None, is a dictionary mapping column number or - munged column name to a converter function + munged column name to a converter function. names, if not None, is a list of header names. In this case, no header will be read from the file + missingd - is a dictionary mapping munged column names to field values + which signify that the field does not contain actual data and should + be masked, e.g. '0000-00-00' or 'unused' + + missing - a string whose value signals a missing field regardless of + the column it appears in, e.g. 'unused' + if no rows are found, None is returned -- see examples/loadrec.py """ if converterd is None: converterd = dict() + if missingd is None: + missingd = {} + import dateutil.parser + import datetime parsedate = dateutil.parser.parse @@ -2270,13 +2265,34 @@ def process_skiprows(reader): process_skiprows(reader) - dateparser = dateutil.parser.parse + def ismissing(name, val): + "Should the value val in column name be masked?" - def myfloat(x): - if x==missing: - return npy.nan + if val == missing or val == missingd.get(name) or val == '': + return True else: - return float(x) + return False + + def with_default_value(func, default): + def newfunc(name, val): + if ismissing(name, val): + return default + else: + return func(val) + return newfunc + + + def mybool(x): + if x=='True': return True + elif x=='False': return False + else: raise ValueError('invalid bool') + + dateparser = dateutil.parser.parse + mydateparser = with_default_value(dateparser, datetime.date(1,1,1)) + myfloat = with_default_value(float, np.nan) + myint = with_default_value(int, -1) + mystr = with_default_value(str, '') + mybool = with_default_value(mybool, None) def mydate(x): # try and return a date object @@ -2285,16 +2301,16 @@ def mydate(x): if d.hour>0 or d.minute>0 or d.second>0: raise ValueError('not a date') return d.date() + mydate = with_default_value(mydate, datetime.date(1,1,1)) - - def get_func(item, func): + def get_func(name, item, func): # promote functions in this order - funcmap = {int:myfloat, myfloat:mydate, mydate:dateparser, dateparser:str} - try: func(item) + funcmap = {mybool:myint,myint:myfloat, myfloat:mydate, mydate:mydateparser, mydateparser:mystr} + try: func(name, item) except: - if func==str: + if func==mystr: raise ValueError('Could not find a working conversion function') - else: return get_func(item, funcmap[func]) # recurse + else: return get_func(name, item, funcmap[func]) # recurse else: return func @@ -2310,7 +2326,7 @@ def get_converters(reader): converters = None for i, row in enumerate(reader): if i==0: - converters = [int]*len(row) + converters = [mybool]*len(row) if checkrows and i>checkrows: break #print i, len(names), len(row) @@ -2320,17 +2336,25 @@ def get_converters(reader): if func is None: func = converterd.get(name) if func is None: - if not item.strip(): continue + #if not item.strip(): continue func = converters[j] if len(item.strip()): - func = get_func(item, func) + func = get_func(name, item, func) + else: + # how should we handle custom converters and defaults? + func = with_default_value(func, None) converters[j] = func return converters # Get header and remove invalid characters needheader = names is None if needheader: - headers = reader.next() + for row in reader: + if len(row) and row[0].startswith(comments): + continue + headers = row + break + # remove these chars delete = set("""~!@#$%^&*()-=+~\|]}[{';: /?.>,<""") delete.add('"') @@ -2346,7 +2370,7 @@ def get_converters(reader): item = itemd.get(item, item) cnt = seen.get(item, 0) if cnt>0: - names.append(item + '%d'%cnt) + names.append(item + '_%d'%cnt) else: names.append(item) seen[item] = cnt+1 @@ -2366,15 +2390,24 @@ def get_converters(reader): # iterate over the remaining rows and convert the data to date # objects, ints, or floats as approriate rows = [] + rowmasks = [] for i, row in enumerate(reader): if not len(row): continue if row[0].startswith(comments): continue - rows.append([func(val) for func, val in zip(converters, row)]) + rows.append([func(name, val) for func, name, val in zip(converters, names, row)]) + rowmasks.append([ismissing(name, val) for name, val in zip(names, row)]) fh.close() if not len(rows): return None - r = npy.rec.fromrecords(rows, names=names) + if np.any(rowmasks): + try: from numpy.ma import mrecords + except ImportError: + raise RuntimeError('numpy 1.05 or later is required for masked array support') + else: + r = mrecords.fromrecords(rows, names=names, mask=rowmasks) + else: + r = np.rec.fromrecords(rows, names=names) return r @@ -2386,6 +2419,8 @@ def tostr(self, x): def toval(self, x): return str(x) + def fromstr(self, s): + return s class FormatString(FormatObj): def tostr(self, x): @@ -2404,6 +2439,7 @@ def tostr(self, x): if x is None: return 'None' return self.fmt%self.toval(x) + class FormatFloat(FormatFormatStr): def __init__(self, precision=4, scale=1.): FormatFormatStr.__init__(self, '%%1.%df'%precision) @@ -2415,10 +2451,24 @@ def toval(self, x): x = x * self.scale return x + def fromstr(self, s): + return float(s)/self.scale + + class FormatInt(FormatObj): def toval(self, x): return x + def fromstr(self, s): + return int(s) + +class FormatBool(FormatObj): + def toval(self, x): + return x + + def fromstr(self, s): + return bool(s) + class FormatPercent(FormatFloat): def __init__(self, precision=4): FormatFloat.__init__(self, precision, scale=100.) @@ -2427,6 +2477,7 @@ class FormatThousands(FormatFloat): def __init__(self, precision=4): FormatFloat.__init__(self, precision, scale=1e-3) + class FormatMillions(FormatFloat): def __init__(self, precision=4): FormatFloat.__init__(self, precision, scale=1e-6) @@ -2440,19 +2491,30 @@ def toval(self, x): if x is None: return 'None' return x.strftime(self.fmt) + def fromstr(self, x): + import dateutil.parser + return dateutil.parser.parse(x).date() + class FormatDatetime(FormatDate): def __init__(self, fmt='%Y-%m-%d %H:%M:%S'): FormatDate.__init__(self, fmt) + def fromstr(self, x): + import dateutil.parser + return dateutil.parser.parse(x) + + + defaultformatd = { - npy.int16 : FormatInt(), - npy.int32 : FormatInt(), - npy.int64 : FormatInt(), - npy.float32 : FormatFloat(), - npy.float64 : FormatFloat(), - npy.object_ : FormatObj(), - npy.string_ : FormatString(), + np.bool_ : FormatBool(), + np.int16 : FormatInt(), + np.int32 : FormatInt(), + np.int64 : FormatInt(), + np.float32 : FormatFloat(), + np.float64 : FormatFloat(), + np.object_ : FormatObj(), + np.string_ : FormatString(), } def get_formatd(r, formatd=None): @@ -2510,20 +2572,20 @@ def get_type(item,atype=int): def get_justify(colname, column, precision): ntype = type(column[0]) - if ntype==npy.str or ntype==npy.str_ or ntype==npy.string0 or ntype==npy.string_: + if ntype==np.str or ntype==np.str_ or ntype==np.string0 or ntype==np.string_: length = max(len(colname),column.itemsize) return 0, length+padding, "%s" # left justify - if ntype==npy.int or ntype==npy.int16 or ntype==npy.int32 or ntype==npy.int64 or ntype==npy.int8 or ntype==npy.int_: - length = max(len(colname),npy.max(map(len,map(str,column)))) + if ntype==np.int or ntype==np.int16 or ntype==np.int32 or ntype==np.int64 or ntype==np.int8 or ntype==np.int_: + length = max(len(colname),np.max(map(len,map(str,column)))) return 1, length+padding, "%d" # right justify - if ntype==npy.float or ntype==npy.float32 or ntype==npy.float64 or ntype==npy.float96 or ntype==npy.float_: + if ntype==np.float or ntype==np.float32 or ntype==np.float64 or ntype==np.float96 or ntype==np.float_: fmt = "%." + str(precision) + "f" - length = max(len(colname),npy.max(map(len,map(lambda x:fmt%x,column)))) + length = max(len(colname),np.max(map(len,map(lambda x:fmt%x,column)))) return 1, length+padding, fmt # right justify - return 0, max(len(colname),npy.max(map(len,map(str,column))))+padding, "%s" + return 0, max(len(colname),np.max(map(len,map(str,column))))+padding, "%s" if header is None: header = r.dtype.names @@ -2566,29 +2628,61 @@ def format(item, just_pad_prec_spacer): text = os.linesep.join(textl) return text -def rec2csv(r, fname, delimiter=',', formatd=None): + + +def rec2csv(r, fname, delimiter=',', formatd=None, missing='', + missingd=None): """ - Save the data from numpy record array r into a comma/space/tab + Save the data from numpy (m)recarray r into a comma/space/tab delimited file. The record array dtype names will be used for column headers. fname - can be a filename or a file handle. Support for gzipped files is automatic, if the filename ends in .gz + + See csv2rec and rec2csv for information about missing and + missingd, which can be used to fill in masked values into your CSV + file. """ + + if missingd is None: + missingd = dict() + + def with_mask(func): + def newfunc(val, mask, mval): + if mask: + return mval + else: + return func(val) + return newfunc + formatd = get_formatd(r, formatd) funcs = [] for i, name in enumerate(r.dtype.names): - funcs.append(csvformat_factory(formatd[name]).tostr) + funcs.append(with_mask(csvformat_factory(formatd[name]).tostr)) fh, opened = cbook.to_filehandle(fname, 'w', return_opened=True) writer = csv.writer(fh, delimiter=delimiter) header = r.dtype.names writer.writerow(header) - for row in r: - writer.writerow([func(val) for func, val in zip(funcs, row)]) - if opened: - fh.close() + # Our list of specials for missing values + mvals = [] + for name in header: + mvals.append(missingd.get(name, missing)) + ismasked = False + if len(r): + row = r[0] + ismasked = hasattr(row, '_fieldmask') + for row in r: + if ismasked: + row, rowmask = row.item(), row._fieldmask.item() + else: + rowmask = [False] * len(row) + writer.writerow([func(val, mask, mval) for func, val, mask, mval + in zip(funcs, row, rowmask, mvals)]) + if opened: + fh.close() From 2881611af8b5e4007eb1fb7058b09af67d25b520 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 25 May 2008 12:51:50 +0000 Subject: [PATCH 078/324] added pil support to imread svn path=/branches/v0_91_maint/; revision=5258 --- lib/matplotlib/image.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 6c598cc9c303..8ffcba213d6c 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -609,13 +609,29 @@ def imread(fname): Return value is a MxNx4 array of 0-1 normalized floats + matplotlib can only read PNGs natively, but if PIL is installed, + it will use it to load the image and return an RGBA if possible + which can be used with imshow """ + + def pilread(): + 'try to load the image with PIL or return None' + try: import Image + except ImportError: return None + image = Image.open( fname ) + return pil_to_array(image) + + handlers = {'png' :_image.readpng, } basename, ext = os.path.splitext(fname) ext = ext.lower()[1:] + if ext not in handlers.keys(): - raise ValueError('Only know how to handled extensions: %s' % handlers.keys()) + im = pilread() + if im is None: + raise ValueError('Only know how to handle extensions: %s; with PIL installed matplotlib can handle more images' % handlers.keys()) + return im handler = handlers[ext] return handler(fname) @@ -632,6 +648,6 @@ def pil_to_array( pilImage ): raise RuntimeError('Unknown image mode') x_str = im.tostring('raw',im.mode,0,-1) - x = npy.fromstring(x_str,npy.uint8) + x = np.fromstring(x_str,np.uint8) x.shape = im.size[1], im.size[0], 4 return x From 579f9cdf2207b7b92e7435a45150af606831c4a4 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 25 May 2008 13:00:49 +0000 Subject: [PATCH 079/324] fixed a npy np mixup in image svn path=/branches/v0_91_maint/; revision=5259 --- lib/matplotlib/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 8ffcba213d6c..fc60657b8a27 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -648,6 +648,6 @@ def pil_to_array( pilImage ): raise RuntimeError('Unknown image mode') x_str = im.tostring('raw',im.mode,0,-1) - x = np.fromstring(x_str,np.uint8) + x = npy.fromstring(x_str,npy.uint8) x.shape = im.size[1], im.size[0], 4 return x From 99f3a369ef64704b58636a98e178c96bf44afbc3 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 26 May 2008 17:02:46 +0000 Subject: [PATCH 080/324] added a line vertex selector widget svn path=/branches/v0_91_maint/; revision=5271 --- CODING_GUIDE | 6 ----- lib/matplotlib/lines.py | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/CODING_GUIDE b/CODING_GUIDE index c740c83de88f..9e0cf0e883bb 100644 --- a/CODING_GUIDE +++ b/CODING_GUIDE @@ -9,12 +9,6 @@ and standards. Please edit and extend this document. svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk matplotlib --username=youruser --password=yourpass -# checking out the main src -svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib --username=youruser --password=yourpass - -# branch checkouts, eg the transforms branch -svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms transbranch - == Committing changes == When committing changes to matplotlib, there are a few things to bear diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 1166f66aed3b..631ead9f0309 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -569,6 +569,10 @@ def get_markerfacecolor(self): def get_markersize(self): return self._markersize + def get_data(self, orig=True): + 'return the xdata, ydata; if orig is True, return the original data' + return self.get_xdata(orig=orig), self.get_ydata(orig=orig) + def get_xdata(self, orig=True): """ return the xdata; if orig is true return the original data, @@ -1460,6 +1464,57 @@ def is_dashed(self): 'return True if line is dashstyle' return self._linestyle in ('--', '-.', ':') +class VertexSelector: + """ + manage the callbacks to maintain a list of selected vertices for + matplotlib.lines.Lin2D. Derived classes should override + process_selected to do something with the picks + """ + def __init__(self, line): + """ + Initialize the class with a matplotlib.lines.Line2D instance. + The line should already be added to some matplotlib.axes.Axes + instance and should have the picker property set. + """ + if not hasattr(line, 'axes'): + raise RuntimeError('You must first add the line to the Axes') + + if line.get_picker() is None: + raise RuntimeError('You must first set the picker property of the line') + + self.axes = line.axes + self.line = line + self.canvas = self.axes.figure.canvas + self.cid = self.canvas.mpl_connect('pick_event', self.onpick) + + self.ind = set() + + + def process_selected(self, ind, xs, ys): + """ + Default do nothing implementation of the process_selected method. + + ind are the indices of the selected vertices. xs and ys are + the coordinates of the selected vertices. + """ + pass + + def onpick(self, event): + 'when the line is picked, update the set of selected indicies' + if event.artist is not self.line: return + + for i in event.ind: + if i in self.ind: + self.ind.remove(i) + else: + self.ind.add(i) + + + ind = list(self.ind) + ind.sort() + ind = npy.array(ind) + xdata, ydata = self.line.get_data() + self.process_selected(ind, xdata[ind], ydata[ind]) lineStyles = Line2D._lineStyles lineMarkers = Line2D._markers From 376b438cd040cc047671f8c5f133b0cbe2e4f236 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 26 May 2008 17:04:38 +0000 Subject: [PATCH 081/324] added a line vertex selector widget svn path=/branches/v0_91_maint/; revision=5272 --- lib/matplotlib/lines.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 631ead9f0309..25e88ac1e847 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -1467,8 +1467,33 @@ def is_dashed(self): class VertexSelector: """ manage the callbacks to maintain a list of selected vertices for - matplotlib.lines.Lin2D. Derived classes should override + matplotlib.lines.Line2D. Derived classes should override process_selected to do something with the picks + + Here is an example which highlights the selected verts with red + circles:: + + import numpy as np + import matplotlib.pyplot as plt + import matplotlib.lines as lines + + class HighlightSelected(lines.VertexSelector): + def __init__(self, line, fmt='ro', **kwargs): + lines.VertexSelector.__init__(self, line) + self.markers, = self.axes.plot([], [], fmt, **kwargs) + + def process_selected(self, ind, xs, ys): + self.markers.set_data(xs, ys) + self.canvas.draw() + + fig = plt.figure() + ax = fig.add_subplot(111) + x, y = np.random.rand(2, 30) + line, = ax.plot(x, y, 'bs-', picker=5) + + selector = HighlightSelected(line) + plt.show() + """ def __init__(self, line): """ From d5579d9297d8d275b27af9743214e1b7cdfc6fe3 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 26 May 2008 17:09:44 +0000 Subject: [PATCH 082/324] fixed an empty vertex list bug svn path=/branches/v0_91_maint/; revision=5275 --- lib/matplotlib/lines.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 25e88ac1e847..3773acf02b87 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -1537,7 +1537,6 @@ def onpick(self, event): ind = list(self.ind) ind.sort() - ind = npy.array(ind) xdata, ydata = self.line.get_data() self.process_selected(ind, xdata[ind], ydata[ind]) From 84eb65bfd3c026b82b10e7cc9ed0264800a6c953 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 28 May 2008 13:31:39 +0000 Subject: [PATCH 083/324] Fix rendering of composite glyphs in Type 3 conversion (particularly as evidenced in the Eunjin.ttf Korean font) Thanks Jae-Joon Lee for finding this! svn path=/branches/v0_91_maint/; revision=5283 --- CHANGELOG | 4 ++++ ttconv/pprdrv_tt2.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 123a73d1f798..c4e789dc4a73 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2008-05-28 Fix rendering of composite glyphs in Type 3 conversion + (particularly as evidenced in the Eunjin.ttf Korean font) + Thanks Jae-Joon Lee for finding this! + 2008-05-21 Fix segfault in TkAgg backend - MGD 2008-05-21 Fix a "local variable unreferenced" bug in plotfile - MM diff --git a/ttconv/pprdrv_tt2.cpp b/ttconv/pprdrv_tt2.cpp index d32eed90650f..e7a93f9b82a9 100644 --- a/ttconv/pprdrv_tt2.cpp +++ b/ttconv/pprdrv_tt2.cpp @@ -531,8 +531,8 @@ void GlyphToType3::do_composite(TTStreamWriter& stream, struct TTFONT *font, BYT } else /* The tt spec. does not clearly indicate */ { /* whether these values are signed or not. */ - arg1 = *(glyph++); - arg2 = *(glyph++); + arg1 = *(signed char *)(glyph++); + arg2 = *(signed char *)(glyph++); } if(flags & WE_HAVE_A_SCALE) From 9c5d7a8f566eb972b15156a8a55cfd84224544e9 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 28 May 2008 18:03:15 +0000 Subject: [PATCH 084/324] added keywords to configure sliders for sf patch 1866207 svn path=/branches/v0_91_maint/; revision=5292 --- CHANGELOG | 5 +++++ examples/logo.py | 4 ++-- examples/widgets/sliders.py | 4 ++-- lib/matplotlib/widgets.py | 9 +++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c4e789dc4a73..ca2ddad2dbd5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +2008-05-28 Allow keyword args to configure widget properties as + requested in + http://sourceforge.net/tracker/index.php?func=detail&aid=1866207&group_id=80706&atid=560722 + - JDH + 2008-05-28 Fix rendering of composite glyphs in Type 3 conversion (particularly as evidenced in the Eunjin.ttf Korean font) Thanks Jae-Joon Lee for finding this! diff --git a/examples/logo.py b/examples/logo.py index 5963c0c53b9a..9ea14e75ccd6 100644 --- a/examples/logo.py +++ b/examples/logo.py @@ -8,7 +8,7 @@ file('data/membrane.dat', 'rb').read(), float32) # 0.0005 is the sample interval t = 0.0005*arange(len(x)) -figure(1, figsize=(7,1), dpi=100) +figure(1, figsize=(4,1), dpi=70) ax = subplot(111, axisbg='y') plot(t, x) text(0.5, 0.5,'matplotlib', color='r', @@ -20,5 +20,5 @@ axis([1, 1.72,-60, 10]) setp(gca(), 'xticklabels', []) setp(gca(), 'yticklabels', []) -#savefig('logo2.png', dpi=300) +savefig('logo2.png', dpi=70) show() diff --git a/examples/widgets/sliders.py b/examples/widgets/sliders.py index 8a6d42f48f0b..31738619e545 100644 --- a/examples/widgets/sliders.py +++ b/examples/widgets/sliders.py @@ -12,8 +12,8 @@ axfreq = axes([0.125, 0.1, 0.775, 0.03], axisbg=axcolor) axamp = axes([0.125, 0.15, 0.775, 0.03], axisbg=axcolor) -sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=1) -samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=1) +sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=1, facecolor='blue', alpha=0.5) +samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=1, facecolor='red', alpha=0.5) def update(val): amp = samp.val diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 7941ae76021a..50dfc6abfc65 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -171,7 +171,7 @@ class Slider(Widget): """ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f', closedmin=True, closedmax=True, slidermin=None, slidermax=None, - dragging=True): + dragging=True, **kwargs): """ Create a slider from valmin to valmax in axes ax; @@ -185,6 +185,11 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f', slidermin and slidermax - be used to contrain the value of this slider to the values of other sliders. + + additional kwargs are passed on to self.poly which is the + matplotlib.patches.Rectangle which draws the slider. See the + matplotlib.patches.Rectangle documentation for legal property + names (eg facecolor, edgecolor, alpha, ...) """ self.ax = ax @@ -192,7 +197,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f', self.valmax = valmax self.val = valinit self.valinit = valinit - self.poly = ax.axvspan(valmin,valinit,0,1) + self.poly = ax.axvspan(valmin,valinit,0,1, **kwargs) self.vline = ax.axvline(valinit,0,1, color='r', lw=1) From 1cba068cc1c185e6c18b93a05dda0f0ba36588e1 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 28 May 2008 18:13:05 +0000 Subject: [PATCH 085/324] Fix PDFs that crash xpdf and ghostscript when two-byte codepoints are used with Type 3 fonts. svn path=/branches/v0_91_maint/; revision=5293 --- lib/matplotlib/backends/backend_pdf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 8ef69fa1d5a9..5eb5239dafed 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -713,6 +713,7 @@ def get_char_width(charcode): charprocDict['Type'] = Name('XObject') charprocDict['Subtype'] = Name('Form') charprocDict['BBox'] = bbox + stream = stream[stream.find("d1") + 2:] charprocObject = self.reserveObject('charProc') self.beginStream(charprocObject.id, None, charprocDict) self.currentstream.write(stream) From 86ca40d350535f396a667c2f4d8cf54a3180c8dc Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 28 May 2008 18:19:30 +0000 Subject: [PATCH 086/324] Adding CHANGELOG entry and scary comment about what was going wrong. svn path=/branches/v0_91_maint/; revision=5294 --- CHANGELOG | 3 +++ lib/matplotlib/backends/backend_pdf.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index ca2ddad2dbd5..79526a3f5ca8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-05-28 Fix crashing of PDFs in xpdf and ghostscript when two-byte + characters are used with Type 3 fonts - MGD + 2008-05-28 Allow keyword args to configure widget properties as requested in http://sourceforge.net/tracker/index.php?func=detail&aid=1866207&group_id=80706&atid=560722 diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 5eb5239dafed..38edb7e6da7b 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -713,6 +713,12 @@ def get_char_width(charcode): charprocDict['Type'] = Name('XObject') charprocDict['Subtype'] = Name('Form') charprocDict['BBox'] = bbox + # Each glyph includes bounding box information, + # but xpdf and ghostscript can't handle it in a + # Form XObject (they segfault!!!), so we remove it + # from the stream here. It's not needed anyway, + # since the Form XObject includes it in its BBox + # value. stream = stream[stream.find("d1") + 2:] charprocObject = self.reserveObject('charProc') self.beginStream(charprocObject.id, None, charprocDict) From e83ae910afea7a474b67cc5d4bf4c33abd388e47 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 29 May 2008 13:01:40 +0000 Subject: [PATCH 087/324] Implement path clipping in SVG backend. svn path=/branches/v0_91_maint/; revision=5298 --- CHANGELOG | 2 + lib/matplotlib/backends/backend_svg.py | 83 ++++++++++++++++---------- 2 files changed, 54 insertions(+), 31 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 79526a3f5ca8..7de3c7344f8d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-29 Implement path clipping in SVG backend - MGD + 2008-05-28 Fix crashing of PDFs in xpdf and ghostscript when two-byte characters are used with Type 3 fonts - MGD diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index 1bca2912e648..d5905101869a 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -56,6 +56,37 @@ def _draw_svg_element(self, element, details, gc, rgbFace): self._svgwriter.write ('%s<%s style="%s" %s %s/>\n' % ( cliprect, element, style, clippath, details)) + def _path_commands(self, path): + cmd = [] + while 1: + code, xp, yp = path.vertex() + yp = self.height - yp + + if code == agg.path_cmd_stop: + cmd.append('z') # Hack, path_cmd_end_poly not found + break + elif code == agg.path_cmd_move_to: + cmd.append('M%g %g' % (xp, yp)) + elif code == agg.path_cmd_line_to: + cmd.append('L%g %g' % (xp, yp)) + elif code == agg.path_cmd_curve3: + verts = [xp, yp] + verts.extent(path.vertex()[1:]) + verts[-1] = self.height - verts[-1] + cmd.append('Q%g %g %g %g' % tuple(verts)) + elif code == agg.path_cmd_curve4: + verts = [xp, yp] + verts.extend(path.vertex()[1:]) + verts[-1] = self.height - verts[-1] + verts.extend(path.vertex()[1:]) + verts[-1] = self.height - verts[-1] + cmd.append('C%g %g %g %g %g %g'%tuple(verts)) + elif code == agg.path_cmd_end_poly: + cmd.append('z') + + path_data = "".join(cmd) + return path_data + def _get_font(self, prop): key = hash(prop) font = self.fontd.get(key) @@ -108,9 +139,27 @@ def _get_style(self, gc, rgbFace): def _get_gc_clip_svg(self, gc): cliprect = gc.get_clip_rectangle() - if cliprect is None: + clippath = gc.get_clip_path() + if cliprect is None and clippath is None: return '', None - else: + elif clippath is not None: + # See if we've already seen this clip rectangle + key = hash(clippath) + if self._clipd.get(key) is None: # If not, store a new clipPath + self._clipd[key] = clippath + style = "stroke: gray; fill: none;" + path_data = self._path_commands(clippath) + path = """\ + + + + + +""" % locals() + return path, key + else: + return '', key + elif cliprect is not None: # See if we've already seen this clip rectangle key = hash(cliprect) if self._clipd.get(key) is None: # If not, store a new clipPath @@ -139,35 +188,7 @@ def close_group(self, s): self._svgwriter.write('\n') def draw_path(self, gc, rgbFace, path): - cmd = [] - - while 1: - code, xp, yp = path.vertex() - yp = self.height - yp - - if code == agg.path_cmd_stop: - cmd.append('z') # Hack, path_cmd_end_poly not found - break - elif code == agg.path_cmd_move_to: - cmd.append('M%g %g' % (xp, yp)) - elif code == agg.path_cmd_line_to: - cmd.append('L%g %g' % (xp, yp)) - elif code == agg.path_cmd_curve3: - verts = [xp, yp] - verts.extent(path.vertex()[1:]) - verts[-1] = self.height - verts[-1] - cmd.append('Q%g %g %g %g' % tuple(verts)) - elif code == agg.path_cmd_curve4: - verts = [xp, yp] - verts.extend(path.vertex()[1:]) - verts[-1] = self.height - verts[-1] - verts.extend(path.vertex()[1:]) - verts[-1] = self.height - verts[-1] - cmd.append('C%g %g %g %g %g %g'%tuple(verts)) - elif code == agg.path_cmd_end_poly: - cmd.append('z') - - path_data = "".join(cmd) + path_data = self._path_commands(path) self._draw_svg_element("path", 'd="%s"' % path_data, gc, rgbFace) def draw_arc(self, gc, rgbFace, x, y, width, height, angle1, angle2, rotation): From 3f66e1c56ba1d411d0675ddc7846707a1b2f1d81 Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Thu, 29 May 2008 13:54:04 +0000 Subject: [PATCH 088/324] fixed two bugs in texmanager: dvipng version comparison, and another related to the addition of the get_gray method svn path=/branches/v0_91_maint/; revision=5299 --- CHANGELOG | 5 ++++ lib/matplotlib/texmanager.py | 54 +++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7de3c7344f8d..39901b90c19f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +2008-05-29 Fixed two bugs in texmanager.py: + improved comparison of dvipng versions + fixed a bug introduced when get_grey method was added + - DSD + 2008-05-29 Implement path clipping in SVG backend - MGD 2008-05-28 Fix crashing of PDFs in xpdf and ghostscript when two-byte diff --git a/lib/matplotlib/texmanager.py b/lib/matplotlib/texmanager.py index f95303e1c1ee..b7b4835d50cf 100644 --- a/lib/matplotlib/texmanager.py +++ b/lib/matplotlib/texmanager.py @@ -34,6 +34,7 @@ """ import copy, glob, md5, os, shutil, sys, warnings +import distutils.version import numpy as npy import matplotlib as mpl from matplotlib import rcParams @@ -44,14 +45,15 @@ if sys.platform.startswith('win'): cmd_split = '&' else: cmd_split = ';' -def get_dvipng_version(): +def dvipng_hack_alpha(): stdin, stdout = os.popen4('dvipng -version') for line in stdout: if line.startswith('dvipng '): version = line.split()[-1] mpl.verbose.report('Found dvipng version %s'% version, 'helpful') - return version + version = distutils.version.LooseVersion(version) + return version < distutils.version.LooseVersion('1.6') raise RuntimeError('Could not obtain dvipng version') @@ -76,7 +78,7 @@ class TexManager: if not os.path.exists(texcache): os.mkdir(texcache) - dvipngVersion = get_dvipng_version() + _dvipng_hack_alpha = dvipng_hack_alpha() # mappable cache of rgba_arrayd = {} @@ -332,8 +334,28 @@ def get_grey(self, tex, fontsize=None, dpi=None): pngfile = self.make_png(tex, fontsize, dpi) X = readpng(os.path.join(self.texcache, pngfile)) - if (self.dvipngVersion < '1.6') or rcParams['text.dvipnghack']: - # hack the alpha channel as described in comment above + if self._dvipng_hack_alpha or rcParams['text.dvipnghack']: + # hack the alpha channel + # dvipng assumed a constant background, whereas we want to + # overlay these rasters with antialiasing over arbitrary + # backgrounds that may have other figure elements under them. + # When you set dvipng -bg Transparent, it actually makes the + # alpha channel 1 and does the background compositing and + # antialiasing itself and puts the blended data in the rgb + # channels. So what we do is extract the alpha information + # from the red channel, which is a blend of the default dvipng + # background (white) and foreground (black). So the amount of + # red (or green or blue for that matter since white and black + # blend to a grayscale) is the alpha intensity. Once we + # extract the correct alpha information, we assign it to the + # alpha channel properly and let the users pick their rgb. In + # this way, we can overlay tex strings on arbitrary + # backgrounds with antialiasing + # + # red = alpha*red_foreground + (1-alpha)*red_background + # + # Since the foreground is black (0) and the background is + # white (1) this reduces to red = 1-alpha or alpha = 1-red alpha = npy.sqrt(1-X[:,:,0]) else: alpha = X[:,:,-1] @@ -346,26 +368,6 @@ def get_rgba(self, tex, fontsize=None, dpi=None, rgb=(0,0,0)): """ Return tex string as an rgba array """ - # dvipng assumes a constant background, whereas we want to - # overlay these rasters with antialiasing over arbitrary - # backgrounds that may have other figure elements under them. - # When you set dvipng -bg Transparent, it actually makes the - # alpha channel 1 and does the background compositing and - # antialiasing itself and puts the blended data in the rgb - # channels. So what we do is extract the alpha information - # from the red channel, which is a blend of the default dvipng - # background (white) and foreground (black). So the amount of - # red (or green or blue for that matter since white and black - # blend to a grayscale) is the alpha intensity. Once we - # extract the correct alpha information, we assign it to the - # alpha channel properly and let the users pick their rgb. In - # this way, we can overlay tex strings on arbitrary - # backgrounds with antialiasing - # - # red = alpha*red_foreground + (1-alpha)*red_background - # - # Since the foreground is black (0) and the background is - # white (1) this reduces to red = 1-alpha or alpha = 1-red if not fontsize: fontsize = rcParams['font.size'] if not dpi: dpi = rcParams['savefig.dpi'] r,g,b = rgb @@ -375,7 +377,7 @@ def get_rgba(self, tex, fontsize=None, dpi=None, rgb=(0,0,0)): if Z is None: alpha = self.get_grey(tex, fontsize, dpi) - Z = npy.zeros((X.shape[0], X.shape[1], 4), npy.float) + Z = npy.zeros((alpha.shape[0], alpha.shape[1], 4), npy.float) Z[:,:,0] = r Z[:,:,1] = g Z[:,:,2] = b From a5a85026be3f498d87d6b54deaf8e69847893ed1 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 29 May 2008 18:25:15 +0000 Subject: [PATCH 089/324] added clippath support for ps svn path=/branches/v0_91_maint/; revision=5304 --- examples/polar_demo.py | 2 + lib/matplotlib/backends/backend_ps.py | 84 +++++++++++++++++++++++++- lib/matplotlib/backends/backend_svg.py | 2 +- 3 files changed, 85 insertions(+), 3 deletions(-) diff --git a/examples/polar_demo.py b/examples/polar_demo.py index 5a28035ec953..974a4bf9f22d 100644 --- a/examples/polar_demo.py +++ b/examples/polar_demo.py @@ -57,4 +57,6 @@ ax.set_rmax(2.0) ax.set_title("And there was much rejoicing!", fontsize=20) + +fig.savefig('polar_demo') show() diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index cecbd33f6f46..59a95ffb614e 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -150,6 +150,8 @@ def __init__(self, width, height, pswriter, dpi=72): self.used_characters = {} self.mathtext_parser = MathTextParser("PS") + self._clip_paths = dict() + def track_characters(self, font, s): """Keeps track of which characters are required from each font.""" @@ -445,6 +447,49 @@ def draw_line(self, gc, x0, y0, x1, y1): ps = '%1.4g %1.4g m %1.4g %1.4g l'%(x0, y0, x1, y1) self._draw_ps(ps, gc, None, "line") + def _get_clippath_command(self, clippath): + id = self._clip_paths.get(clippath) + if id is None: + id = 'c%x' % len(self._clip_paths) + ps_cmd = ['/%s {' % id] + ps_cmd.append(self._get_path(clippath)) + ps_cmd.extend(['clip', 'newpath', '} bind def\n']) + self._pswriter.write('\n'.join(ps_cmd)) + self._clip_paths[clippath] = id + + return '%s\n'%id + + def _get_path(self, path): + cmd = [] + while 1: + code, xp, yp = path.vertex() + + + if code == agg.path_cmd_stop: + cmd.append('closepath\n') + break + elif code == agg.path_cmd_move_to: + cmd.append('%g %g m' % (xp, yp)) + elif code == agg.path_cmd_line_to: + cmd.append('%g %g l' % (xp, yp)) + elif code == agg.path_cmd_curve3: + verts = [xp, yp] + verts.extend(path.vertex()[1:]) + cmd.append('%g %g %g %g %g %g c' % (verts[0], verts[1], + verts[0], verts[1], + verts[2], verts[3])) + elif code == agg.path_cmd_curve4: + verts = [xp, yp] + verts.extend(path.vertex()[1:]) + verts.extend(path.vertex()[1:]) + cmd.append('%g %g %g %g %g %g c'%tuple(verts)) + elif code == agg.path_cmd_end_poly: + cmd.append('cl\n') + + if len(cmd)==0: + return None + return '\n'.join(cmd) + def draw_markers(self, gc, path, rgbFace, x, y, transform): """ Draw the markers defined by path at each of the positions in x @@ -515,10 +560,17 @@ def drawone(x, y): mask = npy.where(npy.isnan(x) + npy.isnan(y), 0, 1) cliprect = gc.get_clip_rectangle() + clippath = gc.get_clip_path() if cliprect: write('gsave\n') xc,yc,wc,hc=cliprect write('%g %g %g %g clipbox\n' % (wc,hc,xc,yc)) + if clippath: + write('gsave\n') + cmd = self._get_clippath_command(clippath) + write(cmd) + + write(' '.join(['/o {', ps_cmd, '} bind def\n'])) # Now evaluate the marker command at each marker location: while start < len(x): @@ -527,7 +579,10 @@ def drawone(x, y): write('\n'.join(ps)+'\n') start = end end += step + if cliprect: write('grestore\n') + if clippath: write('grestore\n') + def draw_path(self, gc, rgbFace, path): @@ -594,10 +649,17 @@ def drawone(x, y, skip): self.push_gc(gc, store=1) cliprect = gc.get_clip_rectangle() + clippath = gc.get_clip_path() + if cliprect: write('gsave\n') xc,yc,wc,hc=cliprect write('%g %g %g %g clipbox\n' % (wc,hc,xc,yc)) + if clippath: + write('gsave\n') + cmd = self._get_clippath_command(clippath) + write(cmd) + while start < len(points): drawone.state = 'm' ps = [i for i in [drawone(x,y,s) for x,y,s in points[start:end+1]]\ @@ -607,7 +669,7 @@ def drawone(x, y, skip): start = end end += step if cliprect: write('grestore\n') - + if clippath: write('grestore\n') def draw_lines_old(self, gc, x, y, transform=None): """ @@ -633,11 +695,18 @@ def draw_lines_old(self, gc, x, y, transform=None): self.push_gc(gc, store=1) cliprect = gc.get_clip_rectangle() + clippath = gc.get_clip_path() + if cliprect: write('gsave\n') xc,yc,wc,hc=cliprect write('%g %g %g %g clipbox\n' % (wc,hc,xc,yc)) + if clippath: + write('gsave\n') + cmd = self._get_clippath_command(clippath) + write(cmd) + steps = 50 start = 0 end = steps @@ -672,7 +741,7 @@ def draw_lines_old(self, gc, x, y, transform=None): end += steps if transform: if cliprect: write("grestore\n") - + if clippath: write('grestore\n') def draw_point(self, gc, x, y): """ Draw a single point at x,y @@ -930,6 +999,7 @@ def _draw_ps(self, ps, gc, rgbFace, command=None): write("% "+command+"\n") cliprect = gc.get_clip_rectangle() + clippath = gc.get_clip_path() self.set_color(*gc.get_rgb()) self.set_linewidth(gc.get_linewidth()) jint = gc.get_joinstyle() @@ -941,6 +1011,13 @@ def _draw_ps(self, ps, gc, rgbFace, command=None): if cliprect: x,y,w,h=cliprect write('gsave\n%1.4g %1.4g %1.4g %1.4g clipbox\n' % (w,h,x,y)) + + if clippath: + write('gsave\n') + cmd = self._get_clippath_command(clippath) + write(cmd) + + # Jochen, is the strip necessary? - this could be a honking big string write(ps.strip()) write("\n") @@ -962,6 +1039,9 @@ def _draw_ps(self, ps, gc, rgbFace, command=None): if cliprect: write("grestore\n") + if clippath: + write('grestore\n') + def push_gc(self, gc, store=1): """ Push the current onto stack, with the exception of the clip box, which diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index d5905101869a..baa97445c4b4 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -71,7 +71,7 @@ def _path_commands(self, path): cmd.append('L%g %g' % (xp, yp)) elif code == agg.path_cmd_curve3: verts = [xp, yp] - verts.extent(path.vertex()[1:]) + verts.extend(path.vertex()[1:]) verts[-1] = self.height - verts[-1] cmd.append('Q%g %g %g %g' % tuple(verts)) elif code == agg.path_cmd_curve4: From b88868e9fcd80e1b94c9a5b4c2d78d8e73db15e9 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 29 May 2008 18:25:58 +0000 Subject: [PATCH 090/324] added clippath support for ps svn path=/branches/v0_91_maint/; revision=5305 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 39901b90c19f..4405a91e80dd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-05-29 Implement path clipping in PS backend - JDH + 2008-05-29 Fixed two bugs in texmanager.py: improved comparison of dvipng versions fixed a bug introduced when get_grey method was added From 1e10bbe0d4fc1d9278ab068ba0d3e453d485c4b0 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 29 May 2008 20:17:32 +0000 Subject: [PATCH 091/324] imread via pil now returns lumininance or rgb if possible svn path=/branches/v0_91_maint/; revision=5306 --- API_CHANGES | 5 +++++ CHANGELOG | 5 +++++ lib/matplotlib/image.py | 38 +++++++++++++++++++++++++++++++++----- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/API_CHANGES b/API_CHANGES index d83fa537228e..76b188885b18 100644 --- a/API_CHANGES +++ b/API_CHANGES @@ -1,3 +1,8 @@ + matplotlib.image.imread now no longer always returns RGBA -- if + the image is luminance or RGB, it will return a MxN or MxNx3 array + if possible. Also uint8 is no longer always forced to float. + + 0.91.2 Released For csv2rec, checkrows=0 is the new default indicating all rows diff --git a/CHANGELOG b/CHANGELOG index 4405a91e80dd..12da3cd195fb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +2008-05-29 matplotlib.image.imread now no longer always returns RGBA + -- if the image is luminance or RGB, it will return a MxN + or MxNx3 array if possible. Also uint8 is no longer always + forced to float. + 2008-05-29 Implement path clipping in PS backend - JDH 2008-05-29 Fixed two bugs in texmanager.py: diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index fc60657b8a27..1495d7d19476 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -607,11 +607,15 @@ def imread(fname): """ return image file in fname as numpy array - Return value is a MxNx4 array of 0-1 normalized floats + return value is a numpy array. For grayscale images, the return + array is MxN. For RGB images, the return value is MxNx3. For + RGBA images the return value is MxNx4 matplotlib can only read PNGs natively, but if PIL is installed, - it will use it to load the image and return an RGBA if possible + it will use it to load the image and return an array (if possible) which can be used with imshow + + TODO: support RGB and grayscale return values in _image.readpng """ def pilread(): @@ -639,15 +643,39 @@ def pilread(): def pil_to_array( pilImage ): + """ + load a PIL image and return it as a numpy array of uint8. For + grayscale images, the return array is MxN. For RGB images, the + return value is MxNx3. For RGBA images the return value is MxNx4 + """ + def toarray(im): + 'return a 1D array of floats' + x_str = im.tostring('raw',im.mode,0,-1) + x = npy.fromstring(x_str,npy.uint8) + return x + if pilImage.mode in ('RGBA', 'RGBX'): - im = pilImage # no need to convert images in rgba format + im = pilImage # no need to convert images + elif pilImage.mode=='L': + im = pilImage # no need to luminance images + # return MxN luminance array + x = toarray(im) + x.shape = im.size[1], im.size[0] + return x + elif pilImage.mode=='RGB': + #return MxNx3 RGB array + im = pilImage # no need to RGB images + x = toarray(im) + x.shape = im.size[1], im.size[0], 3 + return x + else: # try to convert to an rgba image try: im = pilImage.convert('RGBA') except ValueError: raise RuntimeError('Unknown image mode') - x_str = im.tostring('raw',im.mode,0,-1) - x = npy.fromstring(x_str,npy.uint8) + # return MxNx4 RGBA array + x = toarray(im) x.shape = im.size[1], im.size[0], 4 return x From 790c7daa7dc3abea9735129d7d67bad4e97bd830 Mon Sep 17 00:00:00 2001 From: Charles Moad Date: Thu, 29 May 2008 22:59:43 +0000 Subject: [PATCH 092/324] tagging new version svn path=/branches/v0_91_maint/; revision=5312 --- CHANGELOG | 2 ++ lib/matplotlib/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 12da3cd195fb..c32b553b633f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +=============================================================== 2008-01-06 Released 0.91.3 at revision 5312 + 2008-05-29 matplotlib.image.imread now no longer always returns RGBA -- if the image is luminance or RGB, it will return a MxN or MxNx3 array if possible. Also uint8 is no longer always diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 5b3c9d537731..9c1878536426 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -55,7 +55,7 @@ """ from __future__ import generators -__version__ = '0.91.2svn' +__version__ = '0.91.3svn' __revision__ = '$Revision$' __date__ = '$Date$' From 562ec2c5fc1bde61e81d9f2cec0fe03c1058df00 Mon Sep 17 00:00:00 2001 From: Charles Moad Date: Fri, 30 May 2008 03:07:39 +0000 Subject: [PATCH 093/324] minor rev bump svn path=/branches/v0_91_maint/; revision=5313 --- CHANGELOG | 3 ++- lib/matplotlib/__init__.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c32b553b633f..5797be0ca4fb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ -=============================================================== 2008-01-06 Released 0.91.3 at revision 5312 +=============================================================== +2008-05-29 Released 0.91.3 at revision 5313 2008-05-29 matplotlib.image.imread now no longer always returns RGBA -- if the image is luminance or RGB, it will return a MxN diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 9c1878536426..6665f04741f8 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -55,7 +55,7 @@ """ from __future__ import generators -__version__ = '0.91.3svn' +__version__ = '0.91.3' __revision__ = '$Revision$' __date__ = '$Date$' From 44df37768b31e9d707da784e546ea4461b0ee14c Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 30 May 2008 19:21:56 +0000 Subject: [PATCH 094/324] added support for None for dvipng and removed the sqrt in the hack which I think is wrong svn path=/branches/v0_91_maint/; revision=5329 --- lib/matplotlib/rcsetup.py | 12 +++++++++++- lib/matplotlib/texmanager.py | 11 +++++++++-- matplotlibrc.template | 11 ++++++++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index f559ddc1418c..55fb266a5c0b 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -42,6 +42,16 @@ def validate_bool(b): else: raise ValueError('Could not convert "%s" to boolean' % b) +def validate_bool_maybe_none(b): + 'Convert b to a boolean or raise' + if type(b) is str: + b = b.lower() + if b=='none': return None + if b in ('t', 'y', 'yes', 'on', 'true', '1', 1, True): return True + elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False): return False + else: + raise ValueError('Could not convert "%s" to boolean' % b) + def validate_float(s): 'convert s to float or raise' try: return float(s) @@ -339,7 +349,7 @@ def __call__(self, s): 'text.usetex' : [False, validate_bool], 'text.latex.unicode' : [False, validate_bool], 'text.latex.preamble' : [[''], validate_stringlist], - 'text.dvipnghack' : [False, validate_bool], + 'text.dvipnghack' : [None, validate_bool_maybe_none], 'text.fontstyle' : ['normal', str], 'text.fontangle' : ['normal', str], 'text.fontvariant' : ['normal', str], diff --git a/lib/matplotlib/texmanager.py b/lib/matplotlib/texmanager.py index b7b4835d50cf..6aa50504b452 100644 --- a/lib/matplotlib/texmanager.py +++ b/lib/matplotlib/texmanager.py @@ -334,7 +334,12 @@ def get_grey(self, tex, fontsize=None, dpi=None): pngfile = self.make_png(tex, fontsize, dpi) X = readpng(os.path.join(self.texcache, pngfile)) - if self._dvipng_hack_alpha or rcParams['text.dvipnghack']: + if rcParams['text.dvipnghack'] is not None: + hack = rcParams['text.dvipnghack'] + else: + hack = self._dvipng_hack_alpha + print 'using hack', hack + if hack: # hack the alpha channel # dvipng assumed a constant background, whereas we want to # overlay these rasters with antialiasing over arbitrary @@ -356,7 +361,9 @@ def get_grey(self, tex, fontsize=None, dpi=None): # # Since the foreground is black (0) and the background is # white (1) this reduces to red = 1-alpha or alpha = 1-red - alpha = npy.sqrt(1-X[:,:,0]) + #alpha = npy.sqrt(1-X[:,:,0]) # should this be sqrt here? + alpha = 1-X[:,:,0] + else: alpha = X[:,:,-1] diff --git a/matplotlibrc.template b/matplotlibrc.template index c245f16654f0..4eda83835feb 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -147,9 +147,14 @@ numerix : %(numerix)s # numpy, Numeric or numarray # beware of package collisions: color, geometry, graphicx, # type1cm, textcomp. Adobe Postscript (PSSNFS) font packages # may also be loaded, depending on your font settings -#text.dvipnghack : False # some versions of dvipng don't handle - # alpha channel properly. Use True to correct and flush - # ~/.matplotlib/tex.cache before testing + +#text.dvipnghack : None # some versions of dvipng don't handle alpha + # channel properly. Use True to correct + # and flush ~/.matplotlib/tex.cache + # before testing and False to force + # correction off. None will try and + # guess based on your dvipng version + #text.markup : 'plain' # Affects how text, such as titles and labels, are # interpreted by default. # 'plain': As plain, unformatted text From 99c8dc0ec24f41d80ab10981937e8d615d1c5021 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 30 May 2008 19:38:58 +0000 Subject: [PATCH 095/324] removed debug print statement svn path=/branches/v0_91_maint/; revision=5334 --- lib/matplotlib/texmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/texmanager.py b/lib/matplotlib/texmanager.py index 6aa50504b452..c604fc1d5fe2 100644 --- a/lib/matplotlib/texmanager.py +++ b/lib/matplotlib/texmanager.py @@ -338,7 +338,7 @@ def get_grey(self, tex, fontsize=None, dpi=None): hack = rcParams['text.dvipnghack'] else: hack = self._dvipng_hack_alpha - print 'using hack', hack + if hack: # hack the alpha channel # dvipng assumed a constant background, whereas we want to From 06031ee29b75fcefebea4c53c688e4d135f8273e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 2 Jun 2008 14:53:20 +0000 Subject: [PATCH 096/324] Fix crash in Agg drawing collections with no fill and/or edge color. svn path=/branches/v0_91_maint/; revision=5358 --- CHANGELOG | 4 +- src/_backend_agg.cpp | 294 ++++++++++++++++++++++++------------------- 2 files changed, 166 insertions(+), 132 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5797be0ca4fb..0e59f1280387 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ -=============================================================== +2008-06-02 Fix crash in Agg when drawing collections with no fill and/or + edge color - MGD + 2008-05-29 Released 0.91.3 at revision 5313 2008-05-29 matplotlib.image.imread now no longer always returns RGBA diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 95ffdd6fd86f..8a7a8e8065a3 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -690,6 +690,9 @@ RendererAgg::draw_line_collection(const Py::Tuple& args) { size_t N = Nsegments; size_t Ndash = 0; + if (Nsegments == 0) + throw Py::ValueError("segments must have non-zero length"); + Py::SeqBase dashtup(linestyle); bool useDashes = dashtup[0].ptr() != Py_None; @@ -791,49 +794,53 @@ RendererAgg::draw_line_collection(const Py::Tuple& args) { else path.line_to(thisx, height-thisy); } + if (Nc != 0 && Nlw != 0) { + double lw = points_to_pixels ( Py::Float( linewidths[i%Nlw] ) ); + if (! useDashes ) { - double lw = points_to_pixels ( Py::Float( linewidths[i%Nlw] ) ); - - if (! useDashes ) { + agg::conv_stroke stroke(path); + //stroke.line_cap(cap); + //stroke.line_join(join); + stroke.width(lw); + theRasterizer->add_path(stroke); + } + else { - agg::conv_stroke stroke(path); - //stroke.line_cap(cap); - //stroke.line_join(join); - stroke.width(lw); - theRasterizer->add_path(stroke); - } - else { + dash_t dash(path); + //dash.dash_start(offset); + for (size_t idash=0; idash stroke(dash); + //stroke.line_cap(cap); + //stroke.line_join(join); + stroke.width(lw); + theRasterizer->add_path(stroke); + } - agg::conv_stroke stroke(dash); - //stroke.line_cap(cap); - //stroke.line_join(join); - stroke.width(lw); - theRasterizer->add_path(stroke); - } + // get the color and render + Py::SeqBase rgba(colors[ i%Nc]); + double r = Py::Float(rgba[0]); + double g = Py::Float(rgba[1]); + double b = Py::Float(rgba[2]); + double a = Py::Float(rgba[3]); + agg::rgba color(r, g, b, a); - // get the color and render - Py::SeqBase rgba(colors[ i%Nc]); - double r = Py::Float(rgba[0]); - double g = Py::Float(rgba[1]); - double b = Py::Float(rgba[2]); - double a = Py::Float(rgba[3]); - agg::rgba color(r, g, b, a); - - // render antialiased or not - int isaa = Py::Int(antialiaseds[i%Naa]); - if ( isaa ) { - rendererAA->color(color); - agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); - } - else { - rendererBin->color(color); - agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); + // render antialiased or not + int isaa; + if (Naa != 0) + isaa = Py::Int(antialiaseds[i%Naa]); + else + isaa = true; + if ( isaa ) { + rendererAA->color(color); + agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); + } + else { + rendererBin->color(color); + agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); + } } } //for every segment if (useDashes) delete [] dasha; @@ -1219,6 +1226,9 @@ RendererAgg::draw_poly_collection(const Py::Tuple& args) { size_t N = (Noffsets>Nverts) ? Noffsets : Nverts; + if (Nverts == 0) + throw Py::ValueError("Must have at least one set of vertices"); + std::pair xyo, xy; Py::SeqBase thisverts; size_t i, j; @@ -1302,55 +1312,64 @@ RendererAgg::draw_poly_collection(const Py::Tuple& args) { } path.close_polygon(); - int isaa = Py::Int(antialiaseds[i%Naa]); - // get the facecolor and render - Py::SeqBase rgba = Py::SeqBase(facecolors[ i%Nface]); - double r = Py::Float(rgba[0]); - double g = Py::Float(rgba[1]); - double b = Py::Float(rgba[2]); - double a = Py::Float(rgba[3]); - if (a>0) { //only render if alpha>0 - agg::rgba facecolor(r, g, b, a); - - theRasterizer->add_path(path); + int isaa; + if (Naa != 0) + isaa = Py::Int(antialiaseds[i%Naa]); + else + isaa = true; - if (isaa) { - rendererAA->color(facecolor); - agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); - } - else { - rendererBin->color(facecolor); - agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); - } - } //renderer face + // get the facecolor and render + if (Nface != 0) { + Py::SeqBase rgba = Py::SeqBase(facecolors[ i%Nface]); + double r = Py::Float(rgba[0]); + double g = Py::Float(rgba[1]); + double b = Py::Float(rgba[2]); + double a = Py::Float(rgba[3]); + if (a>0) { //only render if alpha>0 + agg::rgba facecolor(r, g, b, a); + + theRasterizer->add_path(path); + + if (isaa) { + rendererAA->color(facecolor); + agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); + } + else { + rendererBin->color(facecolor); + agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); + } + } //renderer face + } + if (Nedge != 0 && Nlw != 0) { // get the edgecolor and render - rgba = Py::SeqBase(edgecolors[ i%Nedge]); - r = Py::Float(rgba[0]); - g = Py::Float(rgba[1]); - b = Py::Float(rgba[2]); - a = Py::Float(rgba[3]); - - double lw = points_to_pixels ( Py::Float( linewidths[i%Nlw] ) ); - if ((a>0) && lw) { //only render if alpha>0 and linewidth !=0 - agg::rgba edgecolor(r, g, b, a); - - agg::conv_stroke stroke(path); - //stroke.line_cap(cap); - //stroke.line_join(join); - stroke.width(lw); - theRasterizer->add_path(stroke); - - // render antialiased or not - if ( isaa ) { - rendererAA->color(edgecolor); - agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); - } - else { - rendererBin->color(edgecolor); - agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); - } - } //rendered edge + Py::SeqBase rgba = Py::SeqBase(edgecolors[ i%Nedge]); + double r = Py::Float(rgba[0]); + double g = Py::Float(rgba[1]); + double b = Py::Float(rgba[2]); + double a = Py::Float(rgba[3]); + + double lw = points_to_pixels ( Py::Float( linewidths[i%Nlw] ) ); + if ((a>0) && lw) { //only render if alpha>0 and linewidth !=0 + agg::rgba edgecolor(r, g, b, a); + + agg::conv_stroke stroke(path); + //stroke.line_cap(cap); + //stroke.line_join(join); + stroke.width(lw); + theRasterizer->add_path(stroke); + + // render antialiased or not + if ( isaa ) { + rendererAA->color(edgecolor); + agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); + } + else { + rendererBin->color(edgecolor); + agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); + } + } //rendered edge + } delete [] xs; delete [] ys; @@ -1429,8 +1448,12 @@ RendererAgg::draw_regpoly_collection(const Py::Tuple& args) { } - - double scale = Py::Float(sizes[i%Nsizes]); + double scale; + if (Nsizes != 0) { + scale = Py::Float(sizes[i%Nsizes]); + } else { + scale = 1.0; + } agg::path_storage path; @@ -1445,54 +1468,63 @@ RendererAgg::draw_regpoly_collection(const Py::Tuple& args) { } path.close_polygon(); - int isaa = Py::Int(antialiaseds[i%Naa]); - // get the facecolor and render - Py::SeqBase rgba = Py::SeqBase(facecolors[ i%Nface]); - double r = Py::Float(rgba[0]); - double g = Py::Float(rgba[1]); - double b = Py::Float(rgba[2]); - double a = Py::Float(rgba[3]); - if (a>0) { //only render if alpha>0 - agg::rgba facecolor(r, g, b, a); - - theRasterizer->add_path(path); - - if (isaa) { - rendererAA->color(facecolor); - agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); - } - else { - rendererBin->color(facecolor); - agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); - } - } //renderer face + int isaa; + if (Naa != 0) + isaa = Py::Int(antialiaseds[i%Naa]); + else + isaa = true; + + if (Nface != 0) { + // get the facecolor and render + Py::SeqBase rgba = Py::SeqBase(facecolors[ i%Nface]); + double r = Py::Float(rgba[0]); + double g = Py::Float(rgba[1]); + double b = Py::Float(rgba[2]); + double a = Py::Float(rgba[3]); + if (a>0) { //only render if alpha>0 + agg::rgba facecolor(r, g, b, a); + + theRasterizer->add_path(path); + + if (isaa) { + rendererAA->color(facecolor); + agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); + } + else { + rendererBin->color(facecolor); + agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); + } + } //renderer face + } + if (Nedge != 0 && Nlw != 0) { // get the edgecolor and render - rgba = Py::SeqBase(edgecolors[ i%Nedge]); - r = Py::Float(rgba[0]); - g = Py::Float(rgba[1]); - b = Py::Float(rgba[2]); - a = Py::Float(rgba[3]); - double lw = points_to_pixels ( Py::Float( linewidths[i%Nlw] ) ); - if ((a>0) && lw) { //only render if alpha>0 - agg::rgba edgecolor(r, g, b, a); - - agg::conv_stroke stroke(path); - //stroke.line_cap(cap); - //stroke.line_join(join); - stroke.width(lw); - theRasterizer->add_path(stroke); - - // render antialiased or not - if ( isaa ) { - rendererAA->color(edgecolor); - agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); - } - else { - rendererBin->color(edgecolor); - agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); - } - } //rendered edge + Py::SeqBase rgba = Py::SeqBase(edgecolors[ i%Nedge]); + double r = Py::Float(rgba[0]); + double g = Py::Float(rgba[1]); + double b = Py::Float(rgba[2]); + double a = Py::Float(rgba[3]); + double lw = points_to_pixels ( Py::Float( linewidths[i%Nlw] ) ); + if ((a>0) && lw) { //only render if alpha>0 + agg::rgba edgecolor(r, g, b, a); + + agg::conv_stroke stroke(path); + //stroke.line_cap(cap); + //stroke.line_join(join); + stroke.width(lw); + theRasterizer->add_path(stroke); + + // render antialiased or not + if ( isaa ) { + rendererAA->color(edgecolor); + agg::render_scanlines(*theRasterizer, *slineP8, *rendererAA); + } + else { + rendererBin->color(edgecolor); + agg::render_scanlines(*theRasterizer, *slineBin, *rendererBin); + } + } //rendered edge + } } // for every poly delete [] xverts; From c399a94b35e6ca6916162688b914807550692ca8 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 2 Jun 2008 15:06:41 +0000 Subject: [PATCH 097/324] added switch_backend bugfix from sf patch 1979402 svn path=/branches/v0_91_maint/; revision=5360 --- lib/matplotlib/__init__.py | 15 ++++++++++----- lib/matplotlib/pyplot.py | 8 ++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 6665f04741f8..ca96494ad112 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -733,7 +733,7 @@ def rcdefaults(): or matplotlib.backends is imported for the first time. """ -def use(arg): +def use(arg, warn=True): """ Set the matplotlib backend to one of the known backends. @@ -745,12 +745,17 @@ def use(arg): will specify a default of pdf output generated by Cairo. - Note: this function must be called *before* importing pylab - for the first time; or, if you are not using pylab, it must - be called before importing matplotlib.backends. + Note: this function must be called *before* importing pylab for + the first time; or, if you are not using pylab, it must be called + before importing matplotlib.backends. If warn is True, a warning + is issued if you try and callthis after pylab or pyplot have been + loaded. In certain black magic use cases, eg + pyplot.switch_backends, we are doing the reloading necessary to + make the backend switch work (in some cases, eg pure image + backends) so one can set warn=False to supporess the warnings """ if 'matplotlib.backends' in sys.modules: - warnings.warn(_use_error_msg) + if warn: warnings.warn(_use_error_msg) be_parts = arg.split('.') name = validate_backend(be_parts[0]) rcParams['backend'] = name diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 11cb808a7f51..718e27166312 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -50,10 +50,10 @@ def switch_backend(newbackend): """ close('all') global new_figure_manager, draw_if_interactive, show - matplotlib.use(newbackend) - reload(backends) - from backends import new_figure_manager, draw_if_interactive, show - + matplotlib.use(newbackend, warn=False) + reload(matplotlib.backends) + from matplotlib.backends import pylab_setup + new_figure_manager, draw_if_interactive, show = pylab_setup() def isinteractive(): From 2a311a46f3e9fbce3a432745b6b55f13f86ec638 Mon Sep 17 00:00:00 2001 From: Sameer D'Costa Date: Wed, 4 Jun 2008 16:49:19 +0000 Subject: [PATCH 098/324] Docstring changes svn path=/branches/v0_91_maint/; revision=5381 --- lib/matplotlib/mlab.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 656b4e7cce1a..2e9e3f3f744a 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -48,7 +48,7 @@ * rec2txt : pretty print a record array * rec2csv : store record array in CSV file * csv2rec : import record array from CSV file with type inspection - * rec_append_field : add a field/array to record array + * rec_append_fields: adds field(s)/array(s) to record array * rec_drop_fields : drop fields from record array * rec_join : join two record arrays on sequence of fields * rec_groupby : summarize data by groups (similar to SQL GROUP BY) @@ -1952,7 +1952,10 @@ def safe_isinf(x): else: return b def rec_append_field(rec, name, arr, dtype=None): - 'return a new record array with field name populated with data from array arr' + """ + return a new record array with field name populated with data from array arr. + This function is Depreacted. Please use rec_append_fields. + """ warnings.warn("use rec_append_fields", DeprecationWarning) return rec_append_fields(rec, name, arr, dtype) From b586ec58fc52e3b3af938435e8a684e0ddb0419e Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 4 Jun 2008 17:49:17 +0000 Subject: [PATCH 099/324] try to handle xaxis_date more gracefully when no data has been added svn path=/branches/v0_91_maint/; revision=5383 --- lib/matplotlib/axes.py | 30 +++++++++++++++++++++++++++++- src/_transforms.cpp | 8 ++++++++ src/_transforms.h | 3 +++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 198e88b88a60..fd15daaf1263 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -1,5 +1,5 @@ from __future__ import division, generators -import math, sys, warnings +import math, sys, warnings, datetime import numpy as npy @@ -1858,10 +1858,25 @@ def xaxis_date(self, tz=None): tz is the time zone to use in labeling dates. Defaults to rc value. """ + if self.dataLim.is_ignore(): + # no data has been added - let's set the default datalim. + # We should probably use a better proxy for the datalim + # have been updated than the ignore setting + dmax = today = datetime.date.today() + dmin = today-datetime.timedelta(days=10) + self._process_unit_info(xdata=(dmin, dmax)) + + dmin, dmax = self.convert_xunits([dmin, dmax]) + + self.viewLim.intervalx().set_bounds(dmin, dmax) + self.viewLim.intervalx().set_bounds(dmin, dmax) + + locator = self.xaxis.get_major_locator() if not isinstance(locator, mdates.DateLocator): locator = mdates.AutoDateLocator(tz) self.xaxis.set_major_locator(locator) + locator.refresh() formatter = self.xaxis.get_major_formatter() if not isinstance(formatter, mdates.DateFormatter): @@ -1873,11 +1888,24 @@ def yaxis_date(self, tz=None): tz is the time zone to use in labeling dates. Defaults to rc value. """ + if self.dataLim.is_ignore(): + # no data has been added - let's set the default datalim. + # We should probably use a better proxy for the datalim + # have been updated than the ignore setting + dmax = today = datetime.date.today() + dmin = today-datetime.timedelta(days=10) + self._process_unit_info(xdata=(dmin, dmax)) + + dmin, dmax = self.convert_xunits([dmin, dmax]) + self.viewLim.intervaly().set_bounds(dmin, dmax) + self.viewLim.intervaly().set_bounds(dmin, dmax) + locator = self.yaxis.get_major_locator() if not isinstance(locator, mdates.DateLocator): locator = mdates.AutoDateLocator(tz) self.yaxis.set_major_locator(locator) + locator.refresh() formatter = self.xaxis.get_major_formatter() if not isinstance(formatter, mdates.DateFormatter): diff --git a/src/_transforms.cpp b/src/_transforms.cpp index 89ee315ede4a..03e1b2e8fd99 100644 --- a/src/_transforms.cpp +++ b/src/_transforms.cpp @@ -347,6 +347,13 @@ Bbox::ignore(const Py::Tuple &args) { return Py::Object(); } +Py::Object +Bbox::is_ignore(const Py::Tuple &args) { + _VERBOSE("Bbox::ignore"); + args.verify_length(0); + return Py::Int(_ignore); +} + Py::Object Bbox::overlapsx(const Py::Tuple &args, const Py::Dict &kwargs) { _VERBOSE("Bbox::overlapsx"); @@ -2349,6 +2356,7 @@ Bbox::init_type() add_varargs_method("ymin", &Bbox::ymin, "ymin()\n"); add_varargs_method("ignore", &Bbox::ignore, "ignore(int)"); + add_varargs_method("is_ignore", &Bbox::is_ignore, "is_ignore()"); add_varargs_method("scale", &Bbox::scale, "scale(sx,sy)"); add_varargs_method("deepcopy", &Bbox::deepcopy, "deepcopy()\n"); } diff --git a/src/_transforms.h b/src/_transforms.h index 5ab3cbbc61ed..a76472078ee5 100644 --- a/src/_transforms.h +++ b/src/_transforms.h @@ -357,6 +357,9 @@ class Bbox: public Py::PythonExtension { //set the ignore attr Py::Object ignore(const Py::Tuple &args); + //return the ignore setting + Py::Object is_ignore(const Py::Tuple &args); + Point* ll_api() {return _ll;} From b0921b95e0289699ede3e575102d553a6b5e88e5 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 4 Jun 2008 18:17:23 +0000 Subject: [PATCH 100/324] fixed some bugs introduced in the xaxis_date fix svn path=/branches/v0_91_maint/; revision=5385 --- lib/matplotlib/axes.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index fd15daaf1263..5e4735ebb302 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -1174,9 +1174,8 @@ def update_datalim(self, xys): # limits and set the bound to be the bounds of the xydata. # Otherwise, it will compute the bounds of it's current data # and the data in xydata + if iterable(xys) and not len(xys): return xys = npy.asarray(xys) - - self.dataLim.update_numerix_xy(xys, -1) @@ -1187,6 +1186,7 @@ def update_datalim_numerix(self, x, y): # Otherwise, it will compute the bounds of it's current data # and the data in xydata #print type(x), type(y) + if iterable(x) and not len(x): return self.dataLim.update_numerix(x, y, -1) def _get_verts_in_data_coords(self, trans, xys): @@ -1869,14 +1869,15 @@ def xaxis_date(self, tz=None): dmin, dmax = self.convert_xunits([dmin, dmax]) self.viewLim.intervalx().set_bounds(dmin, dmax) - self.viewLim.intervalx().set_bounds(dmin, dmax) + self.dataLim.intervalx().set_bounds(dmin, dmax) locator = self.xaxis.get_major_locator() if not isinstance(locator, mdates.DateLocator): locator = mdates.AutoDateLocator(tz) self.xaxis.set_major_locator(locator) - locator.refresh() + + locator.refresh() formatter = self.xaxis.get_major_formatter() if not isinstance(formatter, mdates.DateFormatter): @@ -1894,18 +1895,19 @@ def yaxis_date(self, tz=None): # have been updated than the ignore setting dmax = today = datetime.date.today() dmin = today-datetime.timedelta(days=10) - self._process_unit_info(xdata=(dmin, dmax)) + self._process_unit_info(ydata=(dmin, dmax)) - dmin, dmax = self.convert_xunits([dmin, dmax]) - self.viewLim.intervaly().set_bounds(dmin, dmax) + dmin, dmax = self.convert_yunits([dmin, dmax]) self.viewLim.intervaly().set_bounds(dmin, dmax) + self.dataLim.intervaly().set_bounds(dmin, dmax) locator = self.yaxis.get_major_locator() if not isinstance(locator, mdates.DateLocator): locator = mdates.AutoDateLocator(tz) self.yaxis.set_major_locator(locator) - locator.refresh() + + locator.refresh() formatter = self.xaxis.get_major_formatter() if not isinstance(formatter, mdates.DateFormatter): From 42251b916770e472481190ff85377742908cf5a6 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 5 Jun 2008 14:37:03 +0000 Subject: [PATCH 101/324] fixed classic toolbar bugs svn path=/branches/v0_91_maint/; revision=5396 --- lib/matplotlib/backends/backend_gtk.py | 66 +++++++++--------------- lib/matplotlib/backends/backend_tkagg.py | 42 ++++----------- 2 files changed, 34 insertions(+), 74 deletions(-) diff --git a/lib/matplotlib/backends/backend_gtk.py b/lib/matplotlib/backends/backend_gtk.py index 69ec0e816574..3e15a385da01 100644 --- a/lib/matplotlib/backends/backend_gtk.py +++ b/lib/matplotlib/backends/backend_gtk.py @@ -353,12 +353,12 @@ def _print_image(self, filename, format): # for self.window(for pixmap) and has a side effect of altering # figure width,height (via configure-event?) gtk.DrawingArea.realize(self) - + width, height = self.get_width_height() pixmap = gdk.Pixmap (self.window, width, height) self._renderer.set_pixmap (pixmap) self._render_figure(pixmap, width, height) - + # jpg colors don't match the display very well, png colors match # better pixbuf = gdk.Pixbuf(gdk.COLORSPACE_RGB, 0, 8, width, height) @@ -382,11 +382,11 @@ def save_callback(buf, data=None): raise ValueError("Saving to a Python file-like object is only supported by PyGTK >= 2.8") else: raise ValueError("filename must be a path or a file-like object") - + def get_default_filetype(self): return 'png' - + class FigureManagerGTK(FigureManagerBase): """ Public attributes @@ -403,7 +403,7 @@ def __init__(self, canvas, num): self.window = gtk.Window() self.window.set_title("Figure %d" % num) - + self.vbox = gtk.VBox() self.window.add(self.vbox) self.vbox.show() @@ -455,7 +455,7 @@ def destroy(self, *args): def show(self): # show the figure window self.window.show() - + def full_screen_toggle (self): self._full_screen_flag = not self._full_screen_flag if self._full_screen_flag: @@ -735,8 +735,8 @@ def __init__(self, canvas, window): self.fileselect = FileChooserDialog( title='Save the figure', parent=self.win, - formats=self.canvas.get_supported_filetypes(), - default_type=self.canvas.get_default_filetype()) + filetypes=self.canvas.get_supported_filetypes(), + default_filetype=self.canvas.get_default_filetype()) else: self._create_toolitems_2_2() self.update = self._update_2_2 @@ -905,53 +905,32 @@ def set_active(self, ind): self._ind = ind self._active = [ self._axes[i] for i in self._ind ] - def panx(self, button, arg): - """arg is either user callback data or a scroll event - """ - try: - if arg.direction == gdk.SCROLL_UP: direction=1 - else: direction=-1 - except AttributeError: - direction = arg + def panx(self, button, direction): + 'panx in direction' for a in self._active: - a.panx(direction) + a.xaxis.pan(direction) self.canvas.draw() return True - def pany(self, button, arg): - try: - if arg.direction == gdk.SCROLL_UP: direction=1 - else: direction=-1 - except AttributeError: - direction = arg - + def pany(self, button, direction): + 'pany in direction' for a in self._active: - a.pany(direction) + a.yaxis.pan(direction) self.canvas.draw() return True - def zoomx(self, button, arg): - try: - if arg.direction == gdk.SCROLL_UP: direction=1 - else: direction=-1 - except AttributeError: - direction = arg - + def zoomx(self, button, direction): + 'zoomx in direction' for a in self._active: - a.zoomx(direction) + a.xaxis.zoom(direction) self.canvas.draw() return True - def zoomy(self, button, arg): - try: - if arg.direction == gdk.SCROLL_UP: direction=1 - else: direction=-1 - except AttributeError: - direction = arg - + def zoomy(self, button, direction): + 'zoomy in direction' for a in self._active: - a.zoomy(direction) + a.yaxis.zoom(direction) self.canvas.draw() return True @@ -964,6 +943,7 @@ def save_figure(self, button): except Exception, e: error_msg_gtk(str(e), parent=self) + if gtk.pygtk_version >= (2,4,0): class FileChooserDialog(gtk.FileChooserDialog): """GTK+ 2.4 file selector which remembers the last file/directory @@ -1036,7 +1016,7 @@ def get_filename_from_user (self): break filename = self.get_filename() break - + self.hide() return filename, self.ext else: @@ -1068,7 +1048,7 @@ def get_filename_from_user(self, path=None, title=None): if ext.startswith('.'): ext = ext[1:] return filename, ext - + class DialogLineprops: """ diff --git a/lib/matplotlib/backends/backend_tkagg.py b/lib/matplotlib/backends/backend_tkagg.py index 1964ed3aea49..21e5ca06f0bf 100644 --- a/lib/matplotlib/backends/backend_tkagg.py +++ b/lib/matplotlib/backends/backend_tkagg.py @@ -486,46 +486,26 @@ def set_active(self, ind): self._ind = ind self._active = [ self._axes[i] for i in self._ind ] - def panx(self, arg): - try: arg.direction - except AttributeError: direction = arg - else: - if arg.direction == Tk.SCROLL_UP: direction=1 - else: direction=-1 + def panx(self, direction): for a in self._active: - a.panx(direction) + a.xaxis.pan(direction) self.canvas.draw() - def pany(self, arg): - try: arg.direction - except AttributeError: direction = arg - else: - if arg.direction == Tk.SCROLL_UP: direction=1 - else: direction=-1 + def pany(self, direction): for a in self._active: - a.pany(direction) + a.yaxis.pan(direction) self.canvas.draw() - def zoomx(self, arg): - try: arg.direction - except AttributeError: direction = arg - else: - if arg.direction == Tk.SCROLL_UP: direction=1 - else: direction=-1 + def zoomx(self, direction): for a in self._active: - a.zoomx(direction) + a.xaxis.zoom(direction) self.canvas.draw() - def zoomy(self, arg): - try: arg.direction - except AttributeError: direction = arg - else: - if arg.direction == Tk.SCROLL_UP: direction=1 - else: direction=-1 + def zoomy(self, direction): for a in self._active: - a.zoomy(direction) + a.yaxis.zoom(direction) self.canvas.draw() def save_figure(self): @@ -665,14 +645,14 @@ def save_figure(self): # so we just have to put it first default_filetype_name = filetypes[default_filetype] del filetypes[default_filetype] - + sorted_filetypes = filetypes.items() sorted_filetypes.sort() sorted_filetypes.insert(0, (default_filetype, default_filetype_name)) - + tk_filetypes = [ (name, '*.%s' % ext) for (ext, name) in sorted_filetypes] - + fname = asksaveasfilename( master=self.window, title='Save the figure', From e9c04648724b112df5aa652376bb0aefcd3a3fb3 Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Mon, 9 Jun 2008 20:07:15 +0000 Subject: [PATCH 102/324] don't install traits svn path=/branches/v0_91_maint/; revision=5442 --- setup.cfg.template | 3 ++- setupext.py | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/setup.cfg.template b/setup.cfg.template index 79d254b169f4..16a24eadc1ad 100644 --- a/setup.cfg.template +++ b/setup.cfg.template @@ -25,7 +25,8 @@ tag_svn_revision = 1 #pytz = False #dateutil = False # -## Experimental config package support: +## Experimental config package support, this should only be enabled by +## matplotlib developers, for matplotlib development #enthought.traits = False #configobj = False diff --git a/setupext.py b/setupext.py index 55de962f8d5b..ddc5bc56ce96 100644 --- a/setupext.py +++ b/setupext.py @@ -105,7 +105,7 @@ 'provide_pytz': 'auto', 'provide_dateutil': 'auto', 'provide_configobj': 'auto', - 'provide_traits': 'auto', + 'provide_traits': False, 'build_agg': True, 'build_gtk': 'auto', 'build_gtkagg': 'auto', @@ -140,7 +140,7 @@ try: options['provide_traits'] = config.getboolean("provide_packages", "enthought.traits") - except: options['provide_traits'] = 'auto' + except: options['provide_traits'] = False try: options['build_gtk'] = config.getboolean("gui_support", "gtk") except: options['build_gtk'] = 'auto' @@ -461,9 +461,11 @@ def check_provide_configobj(): return False def check_provide_traits(): - if options['provide_traits'] is True: - print_status("enthought.traits", "matplotlib will provide") - return True + # Let's not install traits by default for now, unless it is specifically + # asked for in setup.cfg AND it is not already installed +# if options['provide_traits'] is True: +# print_status("enthought.traits", "matplotlib will provide") +# return True try: from enthought import traits try: @@ -477,12 +479,16 @@ def check_provide_traits(): version = version.version except AttributeError: version = version.__version__ - if version.endswith('mpl'): - print_status("enthought.traits", "matplotlib will provide") - return True - else: - print_status("enthought.traits", version) - return False + # next 2 lines added temporarily while we figure out what to do + # with traits: + print_status("enthought.traits", version) + return False +# if version.endswith('mpl'): +# print_status("enthought.traits", "matplotlib will provide") +# return True +# else: +# print_status("enthought.traits", version) +# return False except ImportError: if options['provide_traits']: print_status("enthought.traits", "matplotlib will provide") From b9092cb77c0caa1a87ceb22d02d53016a23c04cf Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Mon, 9 Jun 2008 20:08:23 +0000 Subject: [PATCH 103/324] forgot CHANGELOG message svn path=/branches/v0_91_maint/; revision=5443 --- CHANGELOG | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 0e59f1280387..8828214d3d78 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +2008-06-09 Don't install Enthought.Traits along with matplotlib. For + matplotlib developers convenience, it can still be + installed by setting an option in setup.cfg while we figure + decide if there is a future for the traited config - DSD + 2008-06-02 Fix crash in Agg when drawing collections with no fill and/or edge color - MGD From 332390904be7be76553ff619f3ac6c037760c28c Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Thu, 12 Jun 2008 18:02:18 +0000 Subject: [PATCH 104/324] Support hold in quiver, contour, contourf svn path=/branches/v0_91_maint/; revision=5488 --- lib/matplotlib/axes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 5e4735ebb302..d29c92398176 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -4334,6 +4334,7 @@ def quiverkey(self, *args, **kw): quiverkey.__doc__ = mquiver.QuiverKey.quiverkey_doc def quiver(self, *args, **kw): + if not self._hold: self.cla() q = mquiver.Quiver(self, *args, **kw) self.add_collection(q) self.update_datalim_numerix(q.X, q.Y) @@ -5002,11 +5003,13 @@ def pcolorfast(self, *args, **kwargs): def contour(self, *args, **kwargs): + if not self._hold: self.cla() kwargs['filled'] = False return mcontour.ContourSet(self, *args, **kwargs) contour.__doc__ = mcontour.ContourSet.contour_doc def contourf(self, *args, **kwargs): + if not self._hold: self.cla() kwargs['filled'] = True return mcontour.ContourSet(self, *args, **kwargs) contourf.__doc__ = mcontour.ContourSet.contour_doc From 8c02ec27811ba607fe89134d3e7f287ea6fa203f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 17 Jun 2008 14:55:52 +0000 Subject: [PATCH 105/324] Fix STIX fonts on narrow Unicode platforms. svn path=/branches/v0_91_maint/; revision=5573 --- lib/matplotlib/_mathtext_data.py | 50 ++++++++++++++++++++++++++ lib/matplotlib/backends/backend_pdf.py | 6 ++-- lib/matplotlib/backends/backend_ps.py | 6 ++-- lib/matplotlib/mathtext.py | 29 ++++++++------- 4 files changed, 73 insertions(+), 18 deletions(-) diff --git a/lib/matplotlib/_mathtext_data.py b/lib/matplotlib/_mathtext_data.py index a74e07ce1577..c9567be4c6fd 100644 --- a/lib/matplotlib/_mathtext_data.py +++ b/lib/matplotlib/_mathtext_data.py @@ -39,6 +39,8 @@ r'\}' : ('cmex10', 130), r'\leftangle' : ('cmex10', 97), r'\rightangle' : ('cmex10', 64), + r'\langle' : ('cmex10', 97), + r'\rangle' : ('cmex10', 64), r'\widehat' : ('cmex10', 15), r'\widetilde' : ('cmex10', 52), @@ -1761,6 +1763,54 @@ tex2uni = { 'widehat': 0x0302, 'widetilde': 0x0303, +'langle': 0x27e8, +'rangle': 0x27e9, +'perp': 0x27c2, +'neq': 0x2260, +'Join': 0x2a1d, +'leqslant': 0x2a7d, +'geqslant': 0x2a7e, +'lessapprox': 0x2a85, +'gtrapprox': 0x2a86, +'lesseqqgtr': 0x2a8b, +'gtreqqless': 0x2a8c, +'triangleeq': 0x225c, +'eqslantless': 0x2a95, +'eqslantgtr': 0x2a96, +'backepsilon': 0x03f6, +'precapprox': 0x2ab7, +'succapprox': 0x2ab8, +'fallingdotseq': 0x2252, +'subseteqq': 0x2ac5, +'supseteqq': 0x2ac6, +'varpropto': 0x221d, +'precnapprox': 0x2ab9, +'succnapprox': 0x2aba, +'subsetneqq': 0x2acb, +'supsetneqq': 0x2acc, +'lnapprox': 0x2ab9, +'gnapprox': 0x2aba, +'longleftarrow': 0x27f5, +'longrightarrow': 0x27f6, +'longleftrightarrow': 0x27f7, +'Longleftarrow': 0x27f8, +'Longrightarrow': 0x27f9, +'Longleftrightarrow': 0x27fa, +'longmapsto': 0x27fc, +'leadsto': 0x21dd, +'dashleftarrow': 0x290e, +'dashrightarrow': 0x290f, +'circlearrowleft': 0x21ba, +'circlearrowright': 0x21bb, +'leftrightsquigarrow': 0x21ad, +'leftsquigarrow': 0x219c, +'rightsquigarrow': 0x219d, +'Game': 0x2141, +'hbar': 0x0127, +'hslash': 0x210f, +'ldots': 0x22ef, +'vdots': 0x22ee, +'doteqdot': 0x2251, 'doteq': 8784, 'partial': 8706, 'gg': 8811, diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 38edb7e6da7b..9dc4e7b8fac6 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -683,7 +683,7 @@ def get_char_width(charcode): differences = [] two_byte_chars = Set() for c in characters: - ccode = ord(c) + ccode = c gind = cmap.get(ccode) or 0 glyph_ids.append(gind) glyph_name = font.get_glyph_name(gind) @@ -799,7 +799,7 @@ def embedTTFType42(font, characters, descriptor): widths = [] max_ccode = 0 for c in characters: - ccode = ord(c) + ccode = c gind = cmap.get(ccode) or 0 glyph = font.load_char(ccode, flags=LOAD_NO_HINTING) widths.append((ccode, glyph.horiAdvance / 6)) @@ -1194,7 +1194,7 @@ def track_characters(self, font, s): realpath, stat_key = get_realpath_and_stat(fname) used_characters = self.used_characters.setdefault( stat_key, (realpath, Set())) - used_characters[1].update(s) + used_characters[1].update([ord(x) for x in s]) def merge_used_characters(self, other): for stat_key, (realpath, set) in other.items(): diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 59a95ffb614e..3ccd3374c881 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -151,14 +151,14 @@ def __init__(self, width, height, pswriter, dpi=72): self.mathtext_parser = MathTextParser("PS") self._clip_paths = dict() - + def track_characters(self, font, s): """Keeps track of which characters are required from each font.""" realpath, stat_key = get_realpath_and_stat(font.fname) used_characters = self.used_characters.setdefault( stat_key, (realpath, Set())) - used_characters[1].update(s) + used_characters[1].update([ord(x) for x in s]) def merge_used_characters(self, other): for stat_key, (realpath, set) in other.items(): @@ -1231,7 +1231,7 @@ def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w', cmap = font.get_charmap() glyph_ids = [] for c in chars: - gind = cmap.get(ord(c)) or 0 + gind = cmap.get(c) or 0 glyph_ids.append(gind) # The ttf to ps (subsetting) support doesn't work for # OpenType fonts that are Postscript inside (like the diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 5c0df372bfe4..b13a2e75bffb 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -522,7 +522,7 @@ def render_glyph(self, ox, oy, facename, font_class, sym, fontsize, dpi): realpath, stat_key = get_realpath_and_stat(info.font.fname) used_characters = self.used_characters.setdefault( stat_key, (realpath, Set())) - used_characters[1].update(unichr(info.num)) + used_characters[1].add(info.num) self.mathtext_backend.render_glyph(ox, oy, info) def render_rect_filled(self, x1, y1, x2, y2): @@ -655,8 +655,9 @@ def get_xheight(self, font, fontsize, dpi): return xHeight def get_underline_thickness(self, font, fontsize, dpi): - cached_font = self._get_font(font) - return cached_font.font.underline_thickness / 64.0 / fontsize * (10.0 * dpi / 100.0) + # This function used to grab underline thickness from the font, + # but that information is just too un-reliable, so it is now hardcoded. + return ((0.75 / 12.0) * fontsize * dpi) / 72.0 def get_kern(self, font1, fontclass1, sym1, fontsize1, font2, fontclass2, sym2, fontsize2, dpi): @@ -840,10 +841,11 @@ def _get_glyph(self, fontname, font_class, sym, fontsize): new_fontname = fontname if fontname == 'it': - unistring = unichr(uniindex) - if (not unicodedata.category(unistring)[0] == "L" - or unicodedata.name(unistring).startswith("GREEK CAPITAL")): - new_fontname = 'rm' + if uniindex < 0x10000: + unistring = unichr(uniindex) + if (not unicodedata.category(unistring)[0] == "L" + or unicodedata.name(unistring).startswith("GREEK CAPITAL")): + new_fontname = 'rm' slanted = (new_fontname == 'it') or sym in self._slanted_symbols found_symbol = False @@ -868,6 +870,8 @@ def _get_glyph(self, fontname, font_class, sym, fontsize): return self.cm_fallback._get_glyph( fontname, 'it', sym, fontsize) else: + if fontname == 'it' and isinstance(self, StixFonts): + return self._get_glyph('rm', font_class, sym, fontsize) warn("Substituting with a dummy symbol.", MathTextWarning) fontname = 'rm' new_fontname = fontname @@ -2031,7 +2035,8 @@ def __init__(self): bslash = Literal('\\') - accent = oneOf(self._accent_map.keys() + list(self._wide_accents)) + accent = oneOf(self._accent_map.keys() + + list(self._wide_accents)) function = oneOf(list(self._function_names)) @@ -2058,10 +2063,10 @@ def __init__(self): unicode_range = u"\U00000080-\U0001ffff" symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()\[\]|%s])|(\\[%%${}\[\]_|])" % unicode_range) - | Combine( + | (Combine( bslash + oneOf(tex2uni.keys()) - ) + ) + FollowedBy(Regex("[^A-Za-z]"))) ).setParseAction(self.symbol).leaveWhitespace() c_over_c =(Suppress(bslash) @@ -2498,14 +2503,14 @@ def subsuperscript(self, s, loc, toks): if super is not None: hlist = HCentered([super]) hlist.hpack(width, 'exactly') - vlist.extend([hlist, Kern(rule_thickness * 2.0)]) + vlist.extend([hlist, Kern(rule_thickness * 3.0)]) hlist = HCentered([nucleus]) hlist.hpack(width, 'exactly') vlist.append(hlist) if sub is not None: hlist = HCentered([sub]) hlist.hpack(width, 'exactly') - vlist.extend([Kern(rule_thickness * 2.0), hlist]) + vlist.extend([Kern(rule_thickness * 3.0), hlist]) shift = hlist.height + hlist.depth + rule_thickness * 2.0 vlist = Vlist(vlist) vlist.shift_amount = shift + nucleus.depth * 0.5 From 495c8d38c93756e7d69ffe7fd453541c7d61dab2 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Fri, 20 Jun 2008 04:51:47 +0000 Subject: [PATCH 106/324] Make set_default_size set the variable actually being used elsewhere svn path=/branches/v0_91_maint/; revision=5603 --- lib/matplotlib/font_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index 5c36387a924b..f09edc59cf35 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -921,7 +921,7 @@ def set_default_weight(self, weight): def set_default_size(self, size): "Set the default font size in points. The initial value is set by font.size in rc." - self.__default_size = size + self.default_size = size def update_fonts(self, filenames): """ From 8aea5404fb97dcb2689788cfb3c8b8f23c98dcb1 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Fri, 20 Jun 2008 04:53:28 +0000 Subject: [PATCH 107/324] Don't try to render a line collection with no segments svn path=/branches/v0_91_maint/; revision=5604 --- lib/matplotlib/collections.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index db4870052be1..1eb837152c48 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -760,6 +760,8 @@ def draw(self, renderer): transoffset.freeze() segments = self._segments + if not segments: + return offsets = self._offsets if self.have_units(): From 28a0a213d7c60d992d6966b9ac0febea75b56853 Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Sat, 21 Jun 2008 13:35:30 +0000 Subject: [PATCH 108/324] improve mlab.load docstring to address bug 1901536 svn path=/branches/v0_91_maint/; revision=5625 --- lib/matplotlib/mlab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 2e9e3f3f744a..3f9f08aa2aea 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1236,14 +1236,14 @@ def load(fname,comments='#',delimiter=None, converters=None,skiprows=0, skiprows is the number of rows from the top to skip usecols, if not None, is a sequence of integer column indexes to - extract where 0 is the first column, eg usecols=(1,4,5) to extract + extract where 0 is the first column, eg usecols=[1,4,5] to extract just the 2nd, 5th and 6th columns unpack, if True, will transpose the matrix allowing you to unpack into named arguments on the left hand side t,y = load('test.dat', unpack=True) # for two column data - x,y,z = load('somefile.dat', usecols=(3,5,7), unpack=True) + x,y,z = load('somefile.dat', usecols=[3,5,7], unpack=True) See examples/load_demo.py which exeercises many of these options. """ From db6b57dfb3b61be313feb09e1b391390521f77cb Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 22 Jun 2008 16:15:24 +0000 Subject: [PATCH 109/324] changed wx backend to respect extension over gui dialog default type svn path=/branches/v0_91_maint/; revision=5631 --- lib/matplotlib/backends/backend_wx.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 27b5897bb448..b030dc9e16f0 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -94,7 +94,7 @@ cvs_id = '$Id$' -import sys, os, os.path, math, StringIO +import sys, os, os.path, math, StringIO, warnings # Debugging settings here... # Debug level set here. If the debug level is less than 5, information @@ -1716,8 +1716,14 @@ def save(self, evt): filename = dlg.GetFilename() DEBUG_MSG('Save file dir:%s name:%s' % (dirname, filename), 3, self) format = exts[dlg.GetFilterIndex()] - # Explicitly pass in the selected filetype to override the - # actual extension if necessary + basename, ext = os.path.splitext(filename) + if ext.startswith('.'): + ext = ext[1:] + if ext in ('svg', 'pdf', 'ps', 'eps', 'png') and format!=ext: + #looks like they forgot to set the image type drop + #down, going with the extension. + warnings.warn('extension %s did not match the selected image type %s; going with %s'%(ext, format, ext), stacklevel=0) + format = ext try: self.canvas.print_figure( os.path.join(dirname, filename), format=format) From a17668f34ba0ca40a9027f5b560e5e63c571572a Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 22 Jun 2008 16:30:14 +0000 Subject: [PATCH 110/324] bumped the version num svn path=/branches/v0_91_maint/; revision=5634 --- lib/matplotlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index ca96494ad112..5511e4324868 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -55,7 +55,7 @@ """ from __future__ import generators -__version__ = '0.91.3' +__version__ = '0.91.4' __revision__ = '$Revision$' __date__ = '$Date$' From 1ee56a8402a7573615b377126b5084adbbae9c0b Mon Sep 17 00:00:00 2001 From: Charles Moad Date: Mon, 23 Jun 2008 02:11:08 +0000 Subject: [PATCH 111/324] minor rev bump svn path=/branches/v0_91_maint/; revision=5638 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 8828214d3d78..7bea27a80707 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +=============================================================== +2008-06-22 Released 0.91.4 at revision 5638 + 2008-06-09 Don't install Enthought.Traits along with matplotlib. For matplotlib developers convenience, it can still be installed by setting an option in setup.cfg while we figure From 5fa34fc62614ee4b3022fca9dd1b30d84fe2f02c Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 26 Jun 2008 12:28:48 +0000 Subject: [PATCH 112/324] Fix direction of horizontal and vertical hatching. svn path=/branches/v0_91_maint/; revision=5675 --- CHANGELOG | 2 ++ lib/matplotlib/backends/backend_ps.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7bea27a80707..351846870b30 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-06-26 Fix direction of horizontal/vertical hatches - MGD + =============================================================== 2008-06-22 Released 0.91.4 at revision 5638 diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 3ccd3374c881..4bae44f856d8 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -254,12 +254,12 @@ def do_hatch(angle, density): hatchr cvi hatchgap idiv hatchgap mul {hatcht moveto 0 hatchb hatcht sub rlineto} for - stroke + strokeCHAN grestore """ % (angle, 12/density) self._pswriter.write("gsave\n") - self._pswriter.write(do_hatch(0, hatches['horiz'])) - self._pswriter.write(do_hatch(90, hatches['vert'])) + self._pswriter.write(do_hatch(90, hatches['horiz'])) + self._pswriter.write(do_hatch(0, hatches['vert'])) self._pswriter.write(do_hatch(45, hatches['diag1'])) self._pswriter.write(do_hatch(-45, hatches['diag2'])) self._pswriter.write("grestore\n") From 491693c059403153f50eede7907ede5a37ec6bc0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 26 Jun 2008 12:36:15 +0000 Subject: [PATCH 113/324] Oops in last commit svn path=/branches/v0_91_maint/; revision=5677 --- lib/matplotlib/backends/backend_ps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 4bae44f856d8..db0731457f1f 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -254,7 +254,7 @@ def do_hatch(angle, density): hatchr cvi hatchgap idiv hatchgap mul {hatcht moveto 0 hatchb hatcht sub rlineto} for - strokeCHAN + stroke grestore """ % (angle, 12/density) self._pswriter.write("gsave\n") From 4af41166507cb0fd32f360d6e35cb85ecd450307 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 27 Jun 2008 12:49:34 +0000 Subject: [PATCH 114/324] Fix mathtext parsing bug. svn path=/branches/v0_91_maint/; revision=5684 --- CHANGELOG | 2 ++ lib/matplotlib/mathtext.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 351846870b30..d39798a844cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-06-26 Fix mathtext bug for expressions like $x_{\leftarrow}$ - MGD + 2008-06-26 Fix direction of horizontal/vertical hatches - MGD =============================================================== diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index b13a2e75bffb..c013a5bf310a 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -2087,7 +2087,7 @@ def __init__(self): start_group + ZeroOrMore( autoDelim - | simple) + ^ simple) + end_group ).setParseAction(self.group).setName("group") From bf8769abd02711b10e7aa17cb217bb9e0a7529cc Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Mon, 30 Jun 2008 13:24:13 +0000 Subject: [PATCH 115/324] removed Qt4's NavigationToolbar2.destroy method svn path=/branches/v0_91_maint/; revision=5700 --- CHANGELOG | 4 ++++ lib/matplotlib/backends/backend_qt4.py | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d39798a844cb..1fa0a81e0267 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to + have been unnecessary and caused a bug reported by P. + Raybaut - DSD + 2008-06-26 Fix mathtext bug for expressions like $x_{\leftarrow}$ - MGD 2008-06-26 Fix direction of horizontal/vertical hatches - MGD diff --git a/lib/matplotlib/backends/backend_qt4.py b/lib/matplotlib/backends/backend_qt4.py index 956fced11ef1..5b6cd8ba4433 100644 --- a/lib/matplotlib/backends/backend_qt4.py +++ b/lib/matplotlib/backends/backend_qt4.py @@ -340,13 +340,6 @@ def _init_toolbar( self ): # reference holder for subplots_adjust window self.adj_window = None - def destroy( self ): - for text, tooltip_text, image_file, callback in self.toolitems: - if text is not None: - QtCore.QObject.disconnect( self.buttons[ text ], - QtCore.SIGNAL( 'clicked()' ), - getattr( self, callback ) ) - def dynamic_update( self ): self.canvas.draw() From 84efa334f856a40624d5303ecceb97359dbc97ce Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 2 Jul 2008 15:36:38 +0000 Subject: [PATCH 116/324] Fix bug using autolegend with LineCollection. svn path=/branches/v0_91_maint/; revision=5706 --- lib/matplotlib/legend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index ee7efbfc34fd..c456d8a86baf 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -375,11 +375,11 @@ def _auto_legend_data(self): for handle in ax.collections: if isinstance(handle, LineCollection): - hlines = handle.get_lines() + hlines = handle._segments trans = handle.get_transform() for line in hlines: tline = trans.seq_xy_tups(line) - aline = [inv(v) for v in tline] + aline = [inv(tuple(v)) for v in tline] lines.append(aline) return [vertices, bboxes, lines] From 353624950b63ad6e1a9d701ec09f25666b12a5c3 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 8 Jul 2008 14:50:20 +0000 Subject: [PATCH 117/324] Improve mathtext superscript placement. svn path=/branches/v0_91_maint/; revision=5720 --- CHANGELOG | 2 ++ lib/matplotlib/mathtext.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 1fa0a81e0267..1df893f42931 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-07-08 Improve mathtext superscript placement - MGD + 2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to have been unnecessary and caused a bug reported by P. Raybaut - DSD diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index c013a5bf310a..be2bdca36fae 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -1167,7 +1167,7 @@ def get_underline_thickness(self, font, fontsize, dpi): # Percentage of x-height that sub/superscripts drop below the baseline SUBDROP = 0.3 # Percentage of x-height that superscripts drop below the baseline -SUP1 = 0.7 +SUP1 = 0.5 # Percentage of x-height that subscripts drop below the baseline SUB1 = 0.0 # Percentage of x-height that superscripts are offset relative to the subscript From caf170e41f7bd34a2b2ff9706cae16dcb1d43613 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 9 Jul 2008 13:33:13 +0000 Subject: [PATCH 118/324] Improve mathtext radical rendering svn path=/branches/v0_91_maint/; revision=5723 --- CHANGELOG | 2 + lib/matplotlib/mathtext.py | 76 ++++++++++++++++++++++++-------------- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1df893f42931..2695ed597182 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-07-09 Improve mathtext radical rendering - MGD + 2008-07-08 Improve mathtext superscript placement - MGD 2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index be2bdca36fae..b15bb41cd90c 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -190,7 +190,7 @@ from matplotlib.afm import AFM from matplotlib.cbook import enumerate, iterable, Bunch, get_realpath_and_stat, \ - is_string_like + is_string_like, maxdict from matplotlib.ft2font import FT2Font, FT2Image, KERNING_DEFAULT, LOAD_FORCE_AUTOHINT, LOAD_NO_HINTING from matplotlib.font_manager import findfont, FontProperties from matplotlib._mathtext_data import latex_to_bakoma, \ @@ -318,7 +318,13 @@ def render_glyph(self, ox, oy, info): self.image, ox, oy - info.metrics.ymax, info.glyph) def render_rect_filled(self, x1, y1, x2, y2): - self.image.draw_rect_filled(x1, y1, x2, max(y2 - 1, y1)) + height = max(int(y2 - y1) - 1, 0) + if height == 0: + center = (y2 + y1) / 2.0 + y = int(center - (height + 1) / 2.0) + else: + y = int(y1) + self.image.draw_rect_filled(int(x1), y, ceil(x2), y + height) def get_results(self, box): return (self.ox, @@ -477,8 +483,8 @@ def destroy(self): to be destroyed.""" self.used_characters = None - def get_kern(self, font1, sym1, fontsize1, - font2, sym2, fontsize2, dpi): + def get_kern(self, font1, fontclass1, sym1, fontsize1, + font2, fontclass2, sym2, fontsize2, dpi): """ Get the kerning distance for font between sym1 and sym2. @@ -666,7 +672,8 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1, info2 = self._get_info(font2, fontclass2, sym2, fontsize2, dpi) font = info1.font return font.get_kerning(info1.num, info2.num, KERNING_DEFAULT) / 64.0 - return 0.0 + return Fonts.get_kern(self, font1, fontclass1, sym1, fontsize1, + font2, fontclass2, sym2, fontsize2, dpi) class BakomaFonts(TruetypeFonts): """ @@ -1121,7 +1128,8 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1, font = info1.font return (font.get_kern_dist(info1.glyph, info2.glyph) * 0.001 * fontsize1) - return 0.0 + return Fonts.get_kern(self, font1, fontclass1, sym1, fontsize1, + font2, fontclass2, sym2, fontsize2, dpi) def get_xheight(self, font, fontsize, dpi): cached_font = self._get_font(font) @@ -1431,6 +1439,19 @@ def kern(self): new_children.append(kern) self.children = new_children + # This is a failed experiment to fake cross-font kerning. +# def get_kerning(self, next): +# if len(self.children) >= 2 and isinstance(self.children[-2], Char): +# if isinstance(next, Char): +# print "CASE A" +# return self.children[-2].get_kerning(next) +# elif isinstance(next, Hlist) and len(next.children) and isinstance(next.children[0], Char): +# print "CASE B" +# result = self.children[-2].get_kerning(next.children[0]) +# print result +# return result +# return 0.0 + def hpack(self, w=0., m='additional'): """The main duty of hpack is to compute the dimensions of the resulting boxes, and to adjust the glue if one of those dimensions is @@ -1442,8 +1463,8 @@ def hpack(self, w=0., m='additional'): w: specifies a width m: is either 'exactly' or 'additional'. - Thus, hpack(w, exactly) produces a box whose width is exactly w, while - hpack (w, additional ) yields a box whose width is the natural width + Thus, hpack(w, 'exactly') produces a box whose width is exactly w, while + hpack (w, 'additional') yields a box whose width is the natural width plus w. The default values produce a box with the natural width. node644, node649""" # I don't know why these get reset in TeX. Shift_amount is pretty @@ -1506,8 +1527,8 @@ def vpack(self, h=0., m='additional', l=float(inf)): m: is either 'exactly' or 'additional'. l: a maximum height - Thus, vpack(h, exactly) produces a box whose width is exactly w, while - vpack(w, additional) yields a box whose width is the natural width + Thus, vpack(h, 'exactly') produces a box whose width is exactly w, while + vpack(w, 'additional') yields a box whose width is the natural width plus w. The default values produce a box with the natural width. node644, node668""" # I don't know why these get reset in TeX. Shift_amount is pretty @@ -2603,13 +2624,6 @@ def sqrt(self, s, loc, toks): thickness = state.font_output.get_underline_thickness( state.font, state.fontsize, state.dpi) - if root is None: - root = Box(0., 0., 0.) - else: - root = Hlist([Char(x, state) for x in root]) - root.shrink() - root.shrink() - # Determine the height of the body, and add a little extra to # the height so it doesn't seem cramped height = body.height - body.shift_amount + thickness * 5.0 @@ -2626,10 +2640,18 @@ def sqrt(self, s, loc, toks): Fill(), padded_body]) # Stretch the glue between the hrule and the body - rightside.vpack(height + 1.0, depth, 'exactly') + rightside.vpack(height + (state.fontsize * state.dpi) / (100.0 * 12.0), + depth, 'exactly') # Add the root and shift it upward so it is above the tick. # The value of 0.6 is a hard-coded hack ;) + if root is None: + root = Box(check.width * 0.5, 0., 0.) + else: + root = Hlist([Char(x, state) for x in root]) + root.shrink() + root.shrink() + root_vlist = Vlist([Hlist([root])]) root_vlist.shift_amount = -height * 0.6 @@ -2673,12 +2695,12 @@ class MathTextParser(object): _parser = None _backend_mapping = { - 'Bitmap': MathtextBackendBitmap, - 'Agg' : MathtextBackendAgg, - 'PS' : MathtextBackendPs, - 'Pdf' : MathtextBackendPdf, - 'SVG' : MathtextBackendSvg, - 'Cairo' : MathtextBackendCairo + 'bitmap': MathtextBackendBitmap, + 'agg' : MathtextBackendAgg, + 'ps' : MathtextBackendPs, + 'pdf' : MathtextBackendPdf, + 'svg' : MathtextBackendSvg, + 'cairo' : MathtextBackendCairo } _font_type_mapping = { @@ -2689,8 +2711,8 @@ class MathTextParser(object): } def __init__(self, output): - self._output = output - self._cache = {} + self._output = output.lower() + self._cache = maxdict(50) def parse(self, s, dpi = 72, prop = None): if prop is None: @@ -2706,7 +2728,7 @@ def parse(self, s, dpi = 72, prop = None): else: backend = self._backend_mapping[self._output]() fontset = rcParams['mathtext.fontset'] - fontset_class = self._font_type_mapping.get(fontset) + fontset_class = self._font_type_mapping.get(fontset.lower()) if fontset_class is not None: font_output = fontset_class(prop, backend) else: From bf8b7632ace205d8bf6e7c5367c13d91bc21ea27 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sat, 12 Jul 2008 21:15:00 +0000 Subject: [PATCH 119/324] Handle markeredgecolor=None etc. consistently svn path=/branches/v0_91_maint/; revision=5753 --- lib/matplotlib/lines.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 3773acf02b87..0f4c26bc7d9d 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -238,12 +238,6 @@ def __init__(self, xdata, ydata, if linestyle is None : linestyle=rcParams['lines.linestyle'] if marker is None : marker=rcParams['lines.marker'] if color is None : color=rcParams['lines.color'] - if markeredgecolor is None : - markeredgecolor='auto' - if markerfacecolor is None : - markerfacecolor='auto' - if markeredgewidth is None : - markeredgewidth=rcParams['lines.markeredgewidth'] if markersize is None : markersize=rcParams['lines.markersize'] if antialiased is None : antialiased=rcParams['lines.antialiased'] @@ -654,6 +648,8 @@ def set_markeredgecolor(self, ec): ACCEPTS: any matplotlib color """ + if ec is None: + ec = 'auto' self._markeredgecolor = ec def set_markeredgewidth(self, ew): @@ -662,6 +658,8 @@ def set_markeredgewidth(self, ew): ACCEPTS: float value in points """ + if ew is None: + ew = rcParams['lines.markeredgewidth'] self._markeredgewidth = ew def set_markerfacecolor(self, fc): @@ -670,6 +668,8 @@ def set_markerfacecolor(self, fc): ACCEPTS: any matplotlib color """ + if fc is None: + fc = 'auto' self._markerfacecolor = fc def set_markersize(self, sz): From c5c511e513499047b32c10fbde22a3eb0359d42a Mon Sep 17 00:00:00 2001 From: Darren Dale Date: Thu, 17 Jul 2008 12:01:50 +0000 Subject: [PATCH 120/324] improve error reporting in texmanager svn path=/branches/v0_91_maint/; revision=5771 --- CHANGELOG | 3 +++ lib/matplotlib/texmanager.py | 33 ++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2695ed597182..17a0d0b9e2ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-07-16 Improve error handling in texmanager, thanks to Ian Henry + for reporting - DSD + 2008-07-09 Improve mathtext radical rendering - MGD 2008-07-08 Improve mathtext superscript placement - MGD diff --git a/lib/matplotlib/texmanager.py b/lib/matplotlib/texmanager.py index c604fc1d5fe2..f1b565a3649b 100644 --- a/lib/matplotlib/texmanager.py +++ b/lib/matplotlib/texmanager.py @@ -255,16 +255,22 @@ def make_dvi(self, tex, fontsize): %(os.path.split(texfile)[-1], outfile)) mpl.verbose.report(command, 'debug') exit_status = os.system(command) - fh = file(outfile) + try: + fh = file(outfile) + report = fh.read() + fh.close() + except IOError: + report = 'No latex error report available.' if exit_status: raise RuntimeError(('LaTeX was not able to process the following \ -string:\n%s\nHere is the full report generated by LaTeX: \n\n'% repr(tex)) + fh.read()) - else: mpl.verbose.report(fh.read(), 'debug') - fh.close() +string:\n%s\nHere is the full report generated by LaTeX: \n\n'% repr(tex)) + report) + else: mpl.verbose.report(report, 'debug') for fname in glob.glob(basefile+'*'): if fname.endswith('dvi'): pass elif fname.endswith('tex'): pass - else: os.remove(fname) + else: + try: os.remove(fname) + except OSError: pass return dvifile @@ -282,14 +288,19 @@ def make_png(self, tex, fontsize, dpi): os.path.split(dvifile)[-1], outfile)) mpl.verbose.report(command, 'debug') exit_status = os.system(command) - fh = file(outfile) + try: + fh = file(outfile) + report = fh.read() + fh.close() + except IOError: + report = 'No dvipng error report available.' if exit_status: raise RuntimeError('dvipng was not able to \ process the flowing file:\n%s\nHere is the full report generated by dvipng: \ -\n\n'% dvifile + fh.read()) - else: mpl.verbose.report(fh.read(), 'debug') - fh.close() - os.remove(outfile) +\n\n'% dvifile + report) + else: mpl.verbose.report(report, 'debug') + try: os.remove(outfile) + except OSError: pass return pngfile @@ -363,7 +374,7 @@ def get_grey(self, tex, fontsize=None, dpi=None): # white (1) this reduces to red = 1-alpha or alpha = 1-red #alpha = npy.sqrt(1-X[:,:,0]) # should this be sqrt here? alpha = 1-X[:,:,0] - + else: alpha = X[:,:,-1] From 25c2c9559aae2a621cdf56d47c53cbd34610c0f6 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 18 Jul 2008 14:46:32 +0000 Subject: [PATCH 121/324] added Tuukka's YAArrow fix for horiz and vertical lines svn path=/branches/v0_91_maint/; revision=5787 --- lib/matplotlib/patches.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 8304553bd71c..2dc3d31748fc 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -712,6 +712,12 @@ def getpoints(self, x1,y1,x2,y2, k): and the distance from x2,y2 ot the returned points is k """ x1,y1,x2,y2,k = map(float, (x1,y1,x2,y2,k)) + + if y2-y1 == 0: + return x2, y2+k, x2, y2-k + elif x2-x1 == 0: + return x2+k, y2, x2-k, y2 + m = (y2-y1)/(x2-x1) pm = -1./m a = 1 From 49e8253ba4635599eccdb9711f1cf2b1458f7e24 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 24 Jul 2008 12:58:19 +0000 Subject: [PATCH 122/324] removed mlab2 functions svn path=/branches/v0_91_maint/; revision=5832 --- API_CHANGES | 2 + lib/matplotlib/mlab.py | 158 +++++------------------------------------ 2 files changed, 20 insertions(+), 140 deletions(-) diff --git a/API_CHANGES b/API_CHANGES index 76b188885b18..9499a51b12cb 100644 --- a/API_CHANGES +++ b/API_CHANGES @@ -1,3 +1,5 @@ + Removed mlab2 functions from mlab + matplotlib.image.imread now no longer always returns RGBA -- if the image is luminance or RGB, it will return a MxN or MxNx3 array if possible. Also uint8 is no longer always forced to float. diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 3f9f08aa2aea..069816ee9346 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1765,177 +1765,55 @@ def fromfunction_kw(function, dimensions, **kwargs): ### end fperez numutils code -### begin mlab2 functions -# From MLab2: http://pdilib.sourceforge.net/MLab2.py -readme = \ - """ -MLab2.py, release 1 - -Created on February 2003 by Thomas Wendler as part of the Emotionis Project. -This script is supposed to implement Matlab functions that were left out in -numerix.mlab.py (part of Numeric Python). -For further information on the Emotionis Project or on this script, please -contact their authors: -Rodrigo Benenson, rodrigob at elo dot utfsm dot cl -Thomas Wendler, thomasw at elo dot utfsm dot cl -Look at: http://pdilib.sf.net for new releases. -""" -## mlab2 functions numpified and checked 2007/08/04 -_eps_approx = 1e-13 - -#from numpy import fix -def fix(x): - """ - Rounds towards zero. - x_rounded = fix(x) rounds the elements of x to the nearest integers - towards zero. - For negative numbers is equivalent to ceil and for positive to floor. - """ - warnings.warn("Use numpy.fix()", DeprecationWarning) - return np.fix(x) def rem(x,y): """ - Remainder after division. - rem(x,y) is equivalent to x - y.*fix(x./y) in case y is not zero. - By convention (but contrary to numpy), rem(x,0) returns None. - This also differs from numpy.remainder, which uses floor instead of - fix. + Deprecated -- see numpy.remainder """ - x,y = np.asarray(x), np.asarray(y) - if np.any(y == 0): - return None - return x - y * np.fix(x/y) - + raise NotImplementedError('Deprecated - see numpy.remainder') def norm(x,y=2): """ - Norm of a matrix or a vector according to Matlab. - The description is taken from Matlab: - - For matrices... - NORM(X) is the largest singular value of X, max(svd(X)). - NORM(X,2) is the same as NORM(X). - NORM(X,1) is the 1-norm of X, the largest column sum, - = max(sum(abs((X)))). - NORM(X,inf) is the infinity norm of X, the largest row sum, - = max(sum(abs((X')))). - NORM(X,'fro') is the Frobenius norm, sqrt(sum(diag(X'*X))). - NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'. - - For vectors... - NORM(V,P) = sum(abs(V).^P)^(1/P). - NORM(V) = norm(V,2). - NORM(V,inf) = max(abs(V)). - NORM(V,-inf) = min(abs(V)). + Deprecated -- see numpy.linalg.norm """ + raise NotImplementedError('Deprecated - see numpy.linalg.norm') - x = np.asarray(x) - if x.ndim == 2: - if y==2: - return np.max(np.linalg.svd(x)[1]) - elif y==1: - return np.max(np.sum(np.absolute((x)), axis=0)) - elif y=='inf': - return np.max(np.sum(np.absolute((np.transpose(x))), axis=0)) - elif y=='fro': - xx = np.dot(x.transpose(), x) - return np.sqrt(np.sum(np.diag(xx), axis=0)) - else: - raise ValueError('Second argument not permitted for matrices') - - else: - xa = np.absolute(x) - if y == 'inf': - return np.max(xa) - elif y == '-inf': - return np.min(xa) - else: - return np.power(np.sum(np.power(xa,y)),1/float(y)) def orth(A): """ - Orthogonalization procedure by Matlab. - The description is taken from its help: - - Q = ORTH(A) is an orthonormal basis for the range of A. - That is, Q'*Q = I, the columns of Q span the same space as - the columns of A, and the number of columns of Q is the - rank of A. + Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you + need this function """ - - A = np.asarray(A) - U,S,V = np.linalg.svd(A) - - m,n = A.shape - if m > 1: - s = S - elif m == 1: - s = S[0] - else: - s = 0 - - tol = max(m,n) * np.max(s) * _eps_approx - r = np.sum(s > tol) - Q = np.take(U,range(r),1) - - return Q + raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') def rank(x): """ - Returns the rank of a matrix. - The rank is understood here as the an estimation of the number of - linearly independent rows or columns (depending on the size of the - matrix). - Note that numerix.mlab.rank() is not equivalent to Matlab's rank. - This function is! + Deprecated -- see numpy.rank """ - x = np.asarray(x) - s = np.linalg.svd(x, compute_uv=False) - maxabs = np.max(np.absolute(s)) - maxdim = max(x.shape) - tol = maxabs * maxdim * _eps_approx - return np.sum(s > tol) + raise NotImplementedError('Deprecated - see numpy.rank') def sqrtm(x): """ - Returns the square root of a square matrix. - This means that s=sqrtm(x) implies dot(s,s) = x. - Note that s and x are matrices. + Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you + need this function """ - return mfuncC(np.sqrt, x) + raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') def mfuncC(f, x): """ - mfuncC(f, x) : matrix function with possibly complex eigenvalues. - Note: Numeric defines (v,u) = eig(x) => x*u.T = u.T * Diag(v) - This function is needed by sqrtm and allows further functions. + Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you + need this function """ - - x = np.asarray(x) - (v,uT) = np.linalg.eig(x) - V = np.diag(f(v+0j)) - # todo: warning: this is not exactly what matlab does - # MATLAB "B/A is roughly the same as B*inv(A)" - y = np.dot(uT, np.dot(V, np.linalg.inv(uT))) - return approx_real(y) + raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') def approx_real(x): - """ - approx_real(x) : returns x.real if |x.imag| < |x.real| * _eps_approx. - This function is needed by sqrtm and allows further functions. + Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you + need this function """ - ai = np.absolute(x.imag) - ar = np.absolute(x.real) - if np.max(ai) <= np.max(ar) * _eps_approx: - return x.real - else: - return x - -### end mlab2 functions + raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') #helpers for loading, saving, manipulating and viewing numpy record arrays From f95a59a0d5ccf176a206222365a1725557985533 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 24 Jul 2008 13:03:26 +0000 Subject: [PATCH 123/324] deprecated mlab2 functions from mlab svn path=/branches/v0_91_maint/; revision=5833 --- API_CHANGES | 2 +- lib/matplotlib/pylab.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/API_CHANGES b/API_CHANGES index 9499a51b12cb..775f3bdf9223 100644 --- a/API_CHANGES +++ b/API_CHANGES @@ -1,4 +1,4 @@ - Removed mlab2 functions from mlab + Deprecated all mlab2 functions in mlab matplotlib.image.imread now no longer always returns RGBA -- if the image is luminance or RGB, it will return a MxN or MxNx3 array diff --git a/lib/matplotlib/pylab.py b/lib/matplotlib/pylab.py index c2cc6a2a58c8..0a990b9f8b4a 100644 --- a/lib/matplotlib/pylab.py +++ b/lib/matplotlib/pylab.py @@ -233,7 +233,7 @@ from matplotlib.mlab import window_hanning, window_none,\ conv, detrend, detrend_mean, detrend_none, detrend_linear,\ polyfit, polyval, entropy, normpdf,\ - levypdf, find, trapz, prepca, fix, rem, norm, orth, rank,\ + levypdf, find, trapz, prepca, rem, norm, orth, rank,\ sqrtm, prctile, center_matrix, rk4, exp_safe, amap,\ sum_flat, mean_flat, rms_flat, l1norm, l2norm, norm, frange,\ diagonal_matrix, base_repr, binary_repr, log2, ispower2,\ @@ -255,7 +255,7 @@ mfuncC, approx_real, rec_append_field, rec_drop_fields, rec_join, csv2rec, rec2csv - + # old style--if True, override standard numpy with oldnumeric if False: From 5263e01b3622ce6d4d0d1b7b7b3eb4d601174f39 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 24 Jul 2008 13:15:23 +0000 Subject: [PATCH 124/324] deprecated mlab2 functions from mlab svn path=/branches/v0_91_maint/; revision=5834 --- lib/matplotlib/mlab.py | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 069816ee9346..f48125398bd4 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1768,52 +1768,47 @@ def fromfunction_kw(function, dimensions, **kwargs): def rem(x,y): """ - Deprecated -- see numpy.remainder + Deprecated - see numpy.remainder """ raise NotImplementedError('Deprecated - see numpy.remainder') def norm(x,y=2): """ - Deprecated -- see numpy.linalg.norm + Deprecated - see numpy.linalg.norm """ raise NotImplementedError('Deprecated - see numpy.linalg.norm') - def orth(A): """ - Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you - need this function + Deprecated - needs clean room implementation """ - raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') + raise NotImplementedError('Deprecated - needs clean room implementation') def rank(x): """ - Deprecated -- see numpy.rank + Deprecated - see numpy.rank """ raise NotImplementedError('Deprecated - see numpy.rank') def sqrtm(x): """ - Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you - need this function + Deprecated - needs clean room implementation """ - raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') + raise NotImplementedError('Deprecated - needs clean room implementation') def mfuncC(f, x): """ - Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you - need this function + Deprecated """ - raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') + raise NotImplementedError('Deprecated - needs clean room implementation') def approx_real(x): """ - Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you - need this function + Deprecated - needs clean room implementation """ - raise NotImplementedError('Deprecated -- use http://pdilib.sourceforge.net/MLab2.py if you need this function') + raise NotImplementedError('Deprecated - needs clean room implementation') #helpers for loading, saving, manipulating and viewing numpy record arrays From e9e31dcbf708fb3d3f8129fd1152bf09df7d1066 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 24 Jul 2008 18:35:53 +0000 Subject: [PATCH 125/324] updated api changes and changelog to reflect mlab2 deprecation svn path=/branches/v0_91_maint/; revision=5843 --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 17a0d0b9e2ed..7bfaaa554a21 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2008-07-24 Deprecated (raise NotImplementedError) all the mlab2 + functions from matplotlib.mlab out of concern that some of + them were not clean room implementations. JDH + 2008-07-16 Improve error handling in texmanager, thanks to Ian Henry for reporting - DSD From 4a5a4bbe820ce8fe5576371cc66f27a2a23fd4c7 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 24 Jul 2008 19:24:18 +0000 Subject: [PATCH 126/324] bumped version num svn path=/branches/v0_91_maint/; revision=5845 --- lib/matplotlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 5511e4324868..22679f9300e5 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -55,7 +55,7 @@ """ from __future__ import generators -__version__ = '0.91.4' +__version__ = '0.91.5' __revision__ = '$Revision$' __date__ = '$Date$' From 752f9da5773ebaf65dfa065e22610922d80b5e16 Mon Sep 17 00:00:00 2001 From: Sameer D'Costa Date: Thu, 24 Jul 2008 21:56:57 +0000 Subject: [PATCH 127/324] Fixing edge cases in rec_join in branch svn path=/branches/v0_91_maint/; revision=5852 --- lib/matplotlib/mlab.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index f48125398bd4..4716a7bd3441 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1951,9 +1951,11 @@ def rec_summarize(r, summaryfuncs): def rec_join(key, r1, r2, jointype='inner', defaults=None): """ join record arrays r1 and r2 on key; key is a tuple of field - names. if r1 and r2 have equal values on all the keys in the key + names. If r1 and r2 have equal values on all the keys in the key tuple, then their fields will be merged into a new record array - containing the intersection of the fields of r1 and r2 + containing the intersection of the fields of r1 and r2. + + r1 (also r2) must not have any duplicate keys. The jointype keyword can be 'inner', 'outer', 'leftouter'. To do a rightouter join just reverse r1 and r2. @@ -1993,9 +1995,6 @@ def makekey(row): right_ind = np.array([r2d[k] for k in right_keys]) right_len = len(right_ind) - r2 = rec_drop_fields(r2, r1.dtype.names) - - def key_desc(name): 'if name is a string key, use the larger size of r1 or r2 before merging' dt1 = r1.dtype[name] @@ -2027,21 +2026,18 @@ def key_desc(name): newrec[k] = v for field in r1.dtype.names: - newrec[field][:common_len] = r1[field][r1ind] - if jointype == "outer" or jointype == "leftouter": + if common_len: + newrec[field][:common_len] = r1[field][r1ind] + if (jointype == "outer" or jointype == "leftouter") and left_len: newrec[field][common_len:(common_len+left_len)] = r1[field][left_ind] for field in r2.dtype.names: - newrec[field][:common_len] = r2[field][r2ind] - if jointype == "outer": - newrec[field][-right_len:] = r2[field][right_ind[right_ind.argsort()]] - - # sort newrec using the same order as r1 - sort_indices = r1ind.copy() - if jointype == "outer" or jointype == "leftouter": - sort_indices = np.append(sort_indices, left_ind) - newrec[:(common_len+left_len)] = newrec[sort_indices.argsort()] + if field not in key and common_len: + newrec[field][:common_len] = r2[field][r2ind] + if jointype == "outer" and right_len: + newrec[field][-right_len:] = r2[field][right_ind] + newrec.sort(order=key) return newrec.view(np.recarray) From 7d5461db2076640d02cdc22254ae97daab528967 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 1 Aug 2008 15:00:35 +0000 Subject: [PATCH 128/324] Backport memory leak fixes in _ttconv.cpp svn path=/branches/v0_91_maint/; revision=5945 --- CHANGELOG | 4 +++- src/_ttconv.cpp | 58 +++++++++++++++++++++++++++++-------------------- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7bfaaa554a21..be227fc45c2c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,10 @@ +2008-08-01 Backported memory leak fixes in _ttconv.cpp - MGD + 2008-07-24 Deprecated (raise NotImplementedError) all the mlab2 functions from matplotlib.mlab out of concern that some of them were not clean room implementations. JDH -2008-07-16 Improve error handling in texmanager, thanks to Ian Henry +2008-07-16 Improve error handling in texmanager, thanks to Ian Henry for reporting - DSD 2008-07-09 Improve mathtext radical rendering - MGD diff --git a/src/_ttconv.cpp b/src/_ttconv.cpp index 64d8c6532b01..df7ff8fd97a7 100644 --- a/src/_ttconv.cpp +++ b/src/_ttconv.cpp @@ -25,22 +25,23 @@ class PythonFileWriter : public TTStreamWriter { } ~PythonFileWriter() { - if (_write_method) - Py_DECREF(_write_method); + Py_XDECREF(_write_method); } void set(PyObject* write_method) { - if (_write_method) - Py_DECREF(_write_method); + Py_XDECREF(_write_method); _write_method = write_method; - if (_write_method) - Py_INCREF(_write_method); + Py_XINCREF(_write_method); } virtual void write(const char* a) { - if (_write_method) - if (! PyObject_CallFunction(_write_method, (char *)"s", a)) + PyObject* result = NULL; + if (_write_method) { + result = PyObject_CallFunction(_write_method, (char *)"s", a); + if (! result) throw PythonExceptionOccurred(); + Py_DECREF(result); + } } }; @@ -54,6 +55,7 @@ int fileobject_to_PythonFileWriter(PyObject* object, void* address) { } file_writer->set(write_method); + Py_DECREF(write_method); return 1; } @@ -68,11 +70,14 @@ int pyiterable_to_vector_int(PyObject* object, void* address) { PyObject* item; while ( (item = PyIter_Next(iterator)) ) { long value = PyInt_AsLong(item); + Py_DECREF(item); if (value == -1 && PyErr_Occurred()) return 0; result->push_back(value); } + Py_DECREF(iterator); + return 1; } @@ -83,11 +88,11 @@ convert_ttf_to_ps(PyObject* self, PyObject* args, PyObject* kwds) { int fonttype; std::vector glyph_ids; - static const char *kwlist[] = { + static const char *kwlist[] = { "filename", "output", "fonttype", "glyph_ids", NULL }; if (! PyArg_ParseTupleAndKeywords - (args, kwds, - "sO&i|O&:convert_ttf_to_ps", + (args, kwds, + "sO&i|O&:convert_ttf_to_ps", (char**)kwlist, &filename, fileobject_to_PythonFileWriter, @@ -96,9 +101,9 @@ convert_ttf_to_ps(PyObject* self, PyObject* args, PyObject* kwds) { pyiterable_to_vector_int, &glyph_ids)) return NULL; - + if (fonttype != 3 && fonttype != 42) { - PyErr_SetString(PyExc_ValueError, + PyErr_SetString(PyExc_ValueError, "fonttype must be either 3 (raw Postscript) or 42 " "(embedded Truetype)"); return NULL; @@ -109,7 +114,7 @@ convert_ttf_to_ps(PyObject* self, PyObject* args, PyObject* kwds) { } catch (TTException& e) { PyErr_SetString(PyExc_RuntimeError, e.getMessage()); return NULL; - } catch (PythonExceptionOccurred& e) { + } catch (PythonExceptionOccurred& ) { return NULL; } catch (...) { PyErr_SetString(PyExc_RuntimeError, "Unknown C++ exception"); @@ -130,9 +135,13 @@ class PythonDictionaryCallback : public TTDictionaryCallback { virtual void add_pair(const char* a, const char* b) { PyObject* value = PyString_FromString(b); - if (value) - if (PyDict_SetItemString(_dict, a, value)) + if (value) { + if (PyDict_SetItemString(_dict, a, value)) { + Py_DECREF(value); throw PythonExceptionOccurred(); + } + } + Py_DECREF(value); } }; @@ -144,8 +153,8 @@ py_get_pdf_charprocs(PyObject* self, PyObject* args, PyObject* kwds) { static const char *kwlist[] = { "filename", "glyph_ids", NULL }; if (! PyArg_ParseTupleAndKeywords - (args, kwds, - "s|O&:convert_ttf_to_ps", + (args, kwds, + "s|O&:get_pdf_charprocs", (char **)kwlist, &filename, pyiterable_to_vector_int, @@ -161,11 +170,14 @@ py_get_pdf_charprocs(PyObject* self, PyObject* args, PyObject* kwds) { try { ::get_pdf_charprocs( filename, glyph_ids, dict ); } catch (TTException& e) { + Py_DECREF(result); PyErr_SetString(PyExc_RuntimeError, e.getMessage()); return NULL; - } catch (PythonExceptionOccurred& e) { + } catch (PythonExceptionOccurred& ) { + Py_DECREF(result); return NULL; } catch (...) { + Py_DECREF(result); PyErr_SetString(PyExc_RuntimeError, "Unknown C++ exception"); return NULL; } @@ -174,7 +186,7 @@ py_get_pdf_charprocs(PyObject* self, PyObject* args, PyObject* kwds) { } static PyMethodDef ttconv_methods[] = { - {"convert_ttf_to_ps", (PyCFunction)convert_ttf_to_ps, METH_KEYWORDS, + {"convert_ttf_to_ps", (PyCFunction)convert_ttf_to_ps, METH_KEYWORDS, "convert_ttf_to_ps(filename, output, fonttype, glyph_ids)\n" "\n" "Converts the Truetype font into a Type 3 or Type 42 Postscript font, " @@ -191,7 +203,7 @@ static PyMethodDef ttconv_methods[] = { "then all glyphs will be included. If any of the glyphs specified are " "composite glyphs, then the component glyphs will also be included." }, - {"get_pdf_charprocs", (PyCFunction)py_get_pdf_charprocs, METH_KEYWORDS, + {"get_pdf_charprocs", (PyCFunction)py_get_pdf_charprocs, METH_KEYWORDS, "get_pdf_charprocs(filename, glyph_ids)\n" "\n" "Given a Truetype font file, returns a dictionary containing the PDF Type 3\n" @@ -204,14 +216,14 @@ static PyMethodDef ttconv_methods[] = { "the values are the stream content needed to render that glyph. This\n" "is useful to generate the CharProcs dictionary in a PDF Type 3 font.\n" }, - {NULL} /* Sentinel */ + {0, 0, 0, 0} /* Sentinel */ }; #ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ #define PyMODINIT_FUNC void #endif PyMODINIT_FUNC -initttconv(void) +initttconv(void) { PyObject* m; From a57332ce95d2739d524cff7ed674b78d8e643f6d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 25 Aug 2008 22:21:49 +0000 Subject: [PATCH 129/324] Fix locale problems in SVG backend (thanks, Mathieu Leplatre for reporting) svn path=/branches/v0_91_maint/; revision=6050 --- CHANGELOG | 2 + lib/matplotlib/backends/backend_svg.py | 70 +++++++++++++------------- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index be227fc45c2c..09294b38e6c6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-08-25 Fix locale issues in SVG backend - MGD + 2008-08-01 Backported memory leak fixes in _ttconv.cpp - MGD 2008-07-24 Deprecated (raise NotImplementedError) all the mlab2 diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index baa97445c4b4..f02ea917b074 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -116,13 +116,13 @@ def _get_style(self, gc, rgbFace): if seq is None: dashes = '' else: - dashes = 'stroke-dasharray: %s; stroke-dashoffset: %s;' % ( - ','.join(['%s'%val for val in seq]), offset) + dashes = 'stroke-dasharray: %s; stroke-dashoffset: %f;' % ( + ','.join(['%f'%val for val in seq]), offset) linewidth = gc.get_linewidth() if linewidth: - return 'fill: %s; stroke: %s; stroke-width: %s; ' \ - 'stroke-linejoin: %s; stroke-linecap: %s; %s opacity: %s' % ( + return 'fill: %s; stroke: %s; stroke-width: %f; ' \ + 'stroke-linejoin: %s; stroke-linecap: %s; %s opacity: %f' % ( fill, rgb2hex(gc.get_rgb()), linewidth, @@ -132,7 +132,7 @@ def _get_style(self, gc, rgbFace): gc.get_alpha(), ) else: - return 'fill: %s; opacity: %s' % (\ + return 'fill: %s; opacity: %f' % (\ fill, gc.get_alpha(), ) @@ -170,7 +170,7 @@ def _get_gc_clip_svg(self, gc): box = """\ - @@ -195,7 +195,7 @@ def draw_arc(self, gc, rgbFace, x, y, width, height, angle1, angle2, rotation): """ Ignores angles for now """ - details = 'cx="%s" cy="%s" rx="%s" ry="%s" transform="rotate(%1.1f %s %s)"' % \ + details = 'cx="%f" cy="%f" rx="%f" ry="%f" transform="rotate(%1.1f %f %f)"' % \ (x, self.height-y, width/2.0, height/2.0, -rotation, x, self.height-y) self._draw_svg_element('ellipse', details, gc, rgbFace) @@ -214,7 +214,7 @@ def draw_image(self, x, y, im, bbox): trans[4] += trans[0] trans[5] += trans[3] trans[5] = -trans[5] - transstr = 'transform="matrix(%s %s %s %s %s %s)" '%tuple(trans) + transstr = 'transform="matrix(%f %f %f %f %f %f)" '%tuple(trans) assert trans[1] == 0 assert trans[2] == 0 numrows,numcols = im.get_size() @@ -258,12 +258,12 @@ def draw_image(self, x, y, im, bbox): hrefstr = filename self._svgwriter.write ( - '\n'%(x/trans[0], (self.height-y)/trans[3]-h, w, h, hrefstr, transstr) ) def draw_line(self, gc, x1, y1, x2, y2): - details = 'd="M%s,%sL%s,%s"' % (x1, self.height-y1, + details = 'd="M%f,%fL%f,%f"' % (x1, self.height-y1, x2, self.height-y2) self._draw_svg_element('path', details, gc, None) @@ -273,9 +273,9 @@ def draw_lines(self, gc, x, y, transform=None): raise ValueError('x and y must be the same length') y = self.height - y - details = ['d="M%s,%s' % (x[0], y[0])] + details = ['d="M%f,%f' % (x[0], y[0])] xys = zip(x[1:], y[1:]) - details.extend(['L%s,%s' % tup for tup in xys]) + details.extend(['L%f,%f' % tup for tup in xys]) details.append('"') details = ''.join(details) self._draw_svg_element('path', details, gc, None) @@ -285,12 +285,12 @@ def draw_point(self, gc, x, y): self.draw_arc(gc, gc.get_rgb(), x, y, 1, 0, 0, 0, 0) def draw_polygon(self, gc, rgbFace, points): - details = 'points = "%s"' % ' '.join(['%s,%s'%(x,self.height-y) + details = 'points = "%s"' % ' '.join(['%f,%f'%(x,self.height-y) for x, y in points]) self._draw_svg_element('polygon', details, gc, rgbFace) def draw_rectangle(self, gc, rgbFace, x, y, width, height): - details = 'width="%s" height="%s" x="%s" y="%s"' % (width, height, x, + details = 'width="%f" height="%f" x="%f" y="%f"' % (width, height, x, self.height-y-height) self._draw_svg_element('rect', details, gc, rgbFace) @@ -319,12 +319,12 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath): write(path) write('\n') - svg = ['\n' % (fontsize / self.FONT_SCALE)) + svg.append('translate(%f,%f)' % (x, y)) + svg.append('scale(%f)">\n' % (fontsize / self.FONT_SCALE)) cmap = font.get_charmap() lastgind = None @@ -347,7 +347,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath): svg.append('\n') currx += (glyph.linearHoriAdvance / 65536.0) / (self.FONT_SCALE / fontsize) @@ -358,16 +358,16 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath): fontfamily = font.family_name fontstyle = prop.get_style() - style = ('font-size: %f; font-family: %s; font-style: %s; fill: %s; opacity: %s' % + style = ('font-size: %f; font-family: %s; font-style: %s; fill: %s; opacity: %f' % (fontsize, fontfamily,fontstyle, color, gc.get_alpha())) if angle!=0: - transform = 'transform="translate(%s,%s) rotate(%1.1f) translate(%s,%s)"' % (x,y,-angle,-x,-y) + transform = 'transform="translate(%f,%f) rotate(%1.1f) translate(%f,%f)"' % (x,y,-angle,-x,-y) # Inkscape doesn't support rotate(angle x y) else: transform = '' svg = """\ -%(thetext)s +%(thetext)s """ % locals() write(svg) @@ -389,17 +389,17 @@ def _add_char_def(self, prop, char): currx, curry = 0.0, 0.0 for step in glyph.path: if step[0] == 0: # MOVE_TO - path_data.append("M%s %s" % + path_data.append("M%f %f" % (step[1], -step[2])) elif step[0] == 1: # LINE_TO - path_data.append("l%s %s" % + path_data.append("l%f %f" % (step[1] - currx, -step[2] - curry)) elif step[0] == 2: # CURVE3 - path_data.append("q%s %s %s %s" % + path_data.append("q%f %f %f %f" % (step[1] - currx, -step[2] - curry, step[3] - currx, -step[4] - curry)) elif step[0] == 3: # CURVE4 - path_data.append("c%s %s %s %s %s %s" % + path_data.append("c%f %f %f %f %f %f" % (step[1] - currx, -step[2] - curry, step[3] - currx, -step[4] - curry, step[5] - currx, -step[6] - curry)) @@ -453,16 +453,16 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle): svg = ['\n') for font, fontsize, thetext, new_x, new_y_mtc, metrics in svg_glyphs: charid = self._get_char_def_id(font, thetext) - svg.append('\n' % + svg.append('\n' % (charid, new_x, -new_y_mtc, fontsize / self.FONT_SCALE)) svg.append('\n') else: # not rcParams['svg.embed_char_paths'] @@ -481,15 +481,15 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle): svg.append('\n') for x, y, width, height in svg_rects: - svg.append('' % (x, -y + height, width, height)) + svg.append('' % (x, -y + height, width, height)) svg.append("") self.open_group("mathtext") From b474cd63bb4f5b50e564de0fd1c5d0df33a1331d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 7 Sep 2008 11:19:13 +0000 Subject: [PATCH 130/324] Changed full arrows slightly to avoid an xpdf rendering problem reported by Friedrich Hagedorn. svn path=/branches/v0_91_maint/; revision=6073 --- CHANGELOG | 3 +++ lib/matplotlib/patches.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 09294b38e6c6..32a74f949466 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-09-07 Changed full arrows slightly to avoid an xpdf rendering + problem reported by Friedrich Hagedorn. - JKS + 2008-08-25 Fix locale issues in SVG backend - MGD 2008-08-01 Backported memory leak fixes in _ttconv.cpp - MGD diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 2dc3d31748fc..806de0f4b542 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -634,7 +634,11 @@ def __init__(self, x, y, dx, dy, width=0.001, length_includes_head=False, \ if shape == 'right': coords = right_half_arrow elif shape == 'full': - coords=npy.concatenate([left_half_arrow,right_half_arrow[::-1]]) + # The half-arrows contain the midpoint of the stem, + # which we can omit from the full arrow. Including it + # twice caused a problem with xpdf. + coords=npy.concatenate([left_half_arrow[:-1], + right_half_arrow[-2::-1]]) else: raise ValueError, "Got unknown shape: %s" % shape cx = float(dx)/distance From 15a4174cf22d3b09e2ca78e6eb31052c086359c3 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 11 Sep 2008 20:28:11 +0000 Subject: [PATCH 131/324] Fix backticks in PS output. svn path=/branches/v0_91_maint/; revision=6086 --- CHANGELOG | 2 ++ lib/matplotlib/backends/backend_ps.py | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 32a74f949466..52c8197d63d8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-09-11 Fix use of backticks in PS - MGD + 2008-09-07 Changed full arrows slightly to avoid an xpdf rendering problem reported by Friedrich Hagedorn. - JKS diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index db0731457f1f..5e0b12fef043 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -97,6 +97,7 @@ def quote_ps_string(s): s=s.replace("(", "\\(") s=s.replace(")", "\\)") s=s.replace("'", "\\251") + s=s.replace("`", "\\301") s=re.sub(r"[^ -~\n]", lambda x: r"\%03o"%ord(x.group()), s) return s From 72c10b46913bc244ac91fd4b481bc6876f37e0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 5 Oct 2008 10:02:16 +0000 Subject: [PATCH 132/324] Fix problem with AFM files that don't specify the font's full name or family name svn path=/branches/v0_91_maint/; revision=6149 --- API_CHANGES | 5 +++++ CHANGELOG | 3 +++ lib/matplotlib/afm.py | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/API_CHANGES b/API_CHANGES index 775f3bdf9223..5f0290d4fca0 100644 --- a/API_CHANGES +++ b/API_CHANGES @@ -1,3 +1,8 @@ + AFM.get_fullname() and get_familyname() no longer raise an + exception if the AFM file does not specify these optional + attributes, but returns a guess based on the required FontName + attribute. + Deprecated all mlab2 functions in mlab matplotlib.image.imread now no longer always returns RGBA -- if diff --git a/CHANGELOG b/CHANGELOG index 52c8197d63d8..f8a93f289552 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2008-10-05 Fix problem with AFM files that don't specify the font's + full name or family name. - JKS + 2008-09-11 Fix use of backticks in PS - MGD 2008-09-07 Changed full arrows slightly to avoid an xpdf rendering diff --git a/lib/matplotlib/afm.py b/lib/matplotlib/afm.py index 86871c25d08d..724d2ea505c1 100644 --- a/lib/matplotlib/afm.py +++ b/lib/matplotlib/afm.py @@ -34,7 +34,7 @@ John D. Hunter """ -import sys, os +import sys, os, re from _mathtext_data import uni2type1 #Convert string the a python type @@ -433,11 +433,21 @@ def get_fontname(self): def get_fullname(self): "Return the font full name, eg, Times-Roman" - return self._header['FullName'] + name = self._header.get('FullName') + if name is None: # use FontName as a substitute + name = self._header['FontName'] + return name def get_familyname(self): "Return the font family name, eg, Times" - return self._header['FamilyName'] + name = self._header.get('FamilyName') + if name is not None: + return name + + # FamilyName not specified so we'll make a guess + name = self.get_fullname() + extras = r'(?i)([ -](regular|plain|italic|oblique|bold|semibold|light|ultralight|extra|condensed))+$' + return re.sub(extras, '', name) def get_weight(self): "Return the font weight, eg, 'Bold' or 'Roman'" From 2f6ee5eaa4409fe7af979689509dce9a4a12a274 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 5 Nov 2008 15:15:28 +0000 Subject: [PATCH 133/324] Fix bug in zoom rectangle with twin axes svn path=/branches/v0_91_maint/; revision=6365 --- CHANGELOG | 2 ++ lib/matplotlib/backend_bases.py | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f8a93f289552..06f4d7f3d92d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2008-11-05 Fix bug with zoom to rectangle and twin axes - MGD + 2008-10-05 Fix problem with AFM files that don't specify the font's full name or family name. - JKS diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index b0d391d16a5f..1e448ead473c 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -903,7 +903,7 @@ def sort_artists(artists): # can't delete the artist while h: print "Removing",h - if h.remove(): + if h.remove(): self.draw_idle() break parent = None @@ -912,7 +912,7 @@ def sort_artists(artists): parent = p break h = parent - + def onHilite(self, ev): """ Mouse event processor which highlights the artists @@ -1087,7 +1087,7 @@ def get_width_height(self): # a) otherwise we'd have cyclical imports, since all of these # classes inherit from FigureCanvasBase # b) so we don't import a bunch of stuff the user may never use - + def print_emf(self, *args, **kwargs): from backends.backend_emf import FigureCanvasEMF # lazy import emf = self.switch_backends(FigureCanvasEMF) @@ -1097,7 +1097,7 @@ def print_eps(self, *args, **kwargs): from backends.backend_ps import FigureCanvasPS # lazy import ps = self.switch_backends(FigureCanvasPS) return ps.print_eps(*args, **kwargs) - + def print_pdf(self, *args, **kwargs): from backends.backend_pdf import FigureCanvasPdf # lazy import pdf = self.switch_backends(FigureCanvasPdf) @@ -1107,7 +1107,7 @@ def print_png(self, *args, **kwargs): from backends.backend_agg import FigureCanvasAgg # lazy import agg = self.switch_backends(FigureCanvasAgg) return agg.print_png(*args, **kwargs) - + def print_ps(self, *args, **kwargs): from backends.backend_ps import FigureCanvasPS # lazy import ps = self.switch_backends(FigureCanvasPS) @@ -1123,12 +1123,12 @@ def print_svg(self, *args, **kwargs): from backends.backend_svg import FigureCanvasSVG # lazy import svg = self.switch_backends(FigureCanvasSVG) return svg.print_svg(*args, **kwargs) - + def print_svgz(self, *args, **kwargs): from backends.backend_svg import FigureCanvasSVG # lazy import svg = self.switch_backends(FigureCanvasSVG) return svg.print_svgz(*args, **kwargs) - + def get_supported_filetypes(self): return self.filetypes @@ -1138,7 +1138,7 @@ def get_supported_filetypes_grouped(self): groupings.setdefault(name, []).append(ext) groupings[name].sort() return groupings - + def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w', orientation='portrait', format=None, **kwargs): """ @@ -1176,7 +1176,7 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w', if dpi is None: dpi = rcParams['savefig.dpi'] - + origDPI = self.figure.dpi.get() origfacecolor = self.figure.get_facecolor() origedgecolor = self.figure.get_edgecolor() @@ -1199,12 +1199,12 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w', self.figure.set_edgecolor(origedgecolor) self.figure.set_canvas(self) self.figure.canvas.draw() - + return result def get_default_filetype(self): raise NotImplementedError - + def set_window_title(self, title): """ Set the title text of the window containing the figure. Note that @@ -1696,6 +1696,8 @@ def release_zoom(self, event): for cur_xypress in self._xypress: x, y = event.x, event.y lastx, lasty, a, ind, lim, trans = cur_xypress + if a._sharex or a._sharey: + continue # ignore singular clicks - 5 pixels is a threshold if abs(x-lastx)<5 or abs(y-lasty)<5: self._xypress = None From c22ad48bb353d1fcb97f7a169175c0fb5cb9e8c4 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 21 Nov 2008 11:14:12 +0000 Subject: [PATCH 134/324] fixed poly between svn path=/branches/v0_91_maint/; revision=6427 --- lib/matplotlib/mlab.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 4716a7bd3441..05d242353ae1 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1429,27 +1429,17 @@ def inside_poly(points, verts): res, = np.nonzero(nxutils.points_inside_poly(points, verts)) return res -def poly_below(xmin, xs, ys): +def poly_below(ymin, xs, ys): """ given a sequence of xs and ys, return the vertices of a polygon - that has a horzontal base at xmin and an upper bound at the ys. - xmin is a scalar. + that has a horzintal base at ymin and an upper bound at the ys. + ymin is a scalar, and xs and ys are arrays intended for use with Axes.fill, eg xv, yv = poly_below(0, x, y) ax.fill(xv, yv) """ - xs = np.asarray(xs) - ys = np.asarray(ys) - Nx = len(xs) - Ny = len(ys) - assert(Nx==Ny) - x = xmin*np.ones(2*Nx) - y = np.ones(2*Nx) - x[:Nx] = xs - y[:Nx] = ys - y[Nx:] = ys[::-1] - return x, y + return poly_between(xs, ys, xmin) def poly_between(x, ylower, yupper): From 75f8bfae9a01140db352e2718935445da224ab87 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 21 Nov 2008 11:15:04 +0000 Subject: [PATCH 135/324] fixed poly below svn path=/branches/v0_91_maint/; revision=6428 --- lib/matplotlib/mlab.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 05d242353ae1..f350c7075aa2 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1435,9 +1435,10 @@ def poly_below(ymin, xs, ys): that has a horzintal base at ymin and an upper bound at the ys. ymin is a scalar, and xs and ys are arrays - intended for use with Axes.fill, eg - xv, yv = poly_below(0, x, y) - ax.fill(xv, yv) + intended for use with Axes.fill, eg:: + + xv, yv = poly_below(0, x, y) + ax.fill(xv, yv) """ return poly_between(xs, ys, xmin) From cc73d49a9abad2caf852c6412efda3136b65fbf4 Mon Sep 17 00:00:00 2001 From: Manuel Metz Date: Wed, 18 Feb 2009 14:44:08 +0000 Subject: [PATCH 136/324] Added scatter_hist example svn path=/branches/v0_98_5_maint/; revision=6920 --- examples/pylab_examples/scatter_hist.py | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 examples/pylab_examples/scatter_hist.py diff --git a/examples/pylab_examples/scatter_hist.py b/examples/pylab_examples/scatter_hist.py new file mode 100644 index 000000000000..39636738c168 --- /dev/null +++ b/examples/pylab_examples/scatter_hist.py @@ -0,0 +1,49 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.ticker import NullFormatter + +# the random data +x = np.random.randn(1000) +y = np.random.randn(1000) + +nullfmt = NullFormatter() # no labels + +# definitions for the axes +left, width = 0.1, 0.65 +bottom, height = 0.1, 0.65 +bottom_h = left_h = left+width+0.02 + +rect_scatter = [left, bottom, width, height] +rect_histx = [left, bottom_h, width, 0.2] +rect_histy = [left_h, bottom, 0.2, height] + +# start with a rectangular Figure +plt.figure(1, figsize=(8,8)) + +axScatter = plt.axes(rect_scatter) +axHistx = plt.axes(rect_histx) +axHisty = plt.axes(rect_histy) + +# no labels +axHistx.xaxis.set_major_formatter(nullfmt) +axHisty.yaxis.set_major_formatter(nullfmt) + +# the scatter plot: +axScatter.scatter(x, y) + +# now determine nice limits by hand: +binwidth = 0.25 +xymax = np.max( [np.max(np.fabs(x)), np.max(np.fabs(y))] ) +lim = ( int(xymax/binwidth) + 1) * binwidth + +axScatter.set_xlim( (-lim, lim) ) +axScatter.set_ylim( (-lim, lim) ) + +bins = np.arange(-lim, lim + binwidth, binwidth) +axHistx.hist(x, bins=bins) +axHisty.hist(y, bins=bins, orientation='horizontal') + +axHistx.set_xlim( axScatter.get_xlim() ) +axHisty.set_ylim( axScatter.get_ylim() ) + +plt.show() From 7c5096c287dac7a9406e279b0511124c0b7e558f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 23 Feb 2009 14:58:08 +0000 Subject: [PATCH 137/324] Applied Fernando Perez's fix for LaTeX output. svn path=/branches/v0_98_5_maint/; revision=6925 --- doc/sphinxext/inheritance_diagram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sphinxext/inheritance_diagram.py b/doc/sphinxext/inheritance_diagram.py index ff569b2e04a3..018e81775252 100644 --- a/doc/sphinxext/inheritance_diagram.py +++ b/doc/sphinxext/inheritance_diagram.py @@ -352,7 +352,7 @@ def latex_output_graph(self, node): graph.run_dot(['-Tpdf', '-o%s' % pdf_path], name, parts, graph_options={'size': '"6.0,6.0"'}) - return '\\includegraphics{%s}' % pdf_path + return '\n\\includegraphics{%s}\n\n' % pdf_path def visit_inheritance_diagram(inner_func): """ From 9b9a50a7889a154439802c5fd82214e8a261ccee Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 23 Feb 2009 17:30:07 +0000 Subject: [PATCH 138/324] Add credit to Allen Haldane in comments. svn path=/branches/v0_98_5_maint/; revision=6927 --- src/agg_py_path_iterator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agg_py_path_iterator.h b/src/agg_py_path_iterator.h index 8324fa1cf27f..3c35c84e4465 100644 --- a/src/agg_py_path_iterator.h +++ b/src/agg_py_path_iterator.h @@ -264,7 +264,7 @@ class SimplifyPath //are close to parallel, I calculate the distance moved perpendicular to the //last line. Once it gets too big, the lines cannot be combined. - // This code was originally written by someone else (John Hunter?) and I + // This code was originally written by Allen Haldane and I // have modified to work in-place -- meaning not creating an entirely // new path list each time. In order to do that without too much // additional code complexity, it keeps a small queue around so that From 73239afde5081929b9555dad05647c6c09a3dbaa Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 23 Feb 2009 17:38:35 +0000 Subject: [PATCH 139/324] C++ standards compliance for use with Sun C++ compiler. These should be equivalent to what was there before on gcc. svn path=/branches/v0_98_5_maint/; revision=6928 --- CXX/Extensions.hxx | 290 +++++++++++++++--------------- agg24/include/agg_alpha_mask_u8.h | 76 ++++---- 2 files changed, 183 insertions(+), 183 deletions(-) diff --git a/CXX/Extensions.hxx b/CXX/Extensions.hxx index 83738c9af939..b7735ac3c0fe 100644 --- a/CXX/Extensions.hxx +++ b/CXX/Extensions.hxx @@ -61,7 +61,7 @@ extern "C" namespace Py { class ExtensionModuleBase; - + // Make an Exception Type for use in raising custom exceptions class ExtensionExceptionType : public Object { @@ -74,44 +74,44 @@ namespace Py void init( ExtensionModuleBase &module, const std::string& name ); }; - - class MethodTable + + class MethodTable { public: MethodTable(); virtual ~MethodTable(); - + void add(const char* method_name, PyCFunction f, const char* doc="", int flag=1); PyMethodDef* table(); - + protected: std::vector t; // accumulator of PyMethodDef's PyMethodDef *mt; // Actual method table produced when full - + static PyMethodDef method (const char* method_name, PyCFunction f, int flags = 1, const char* doc=""); - + private: // // prevent the compiler generating these unwanted functions // MethodTable(const MethodTable& m); //unimplemented void operator=(const MethodTable& m); //unimplemented - + }; // end class MethodTable - + extern "C" { typedef PyObject *(*method_varargs_call_handler_t)( PyObject *_self, PyObject *_args ); typedef PyObject *(*method_keyword_call_handler_t)( PyObject *_self, PyObject *_args, PyObject *_dict ); - }; - + } + template class MethodDefExt : public PyMethodDef { public: typedef Object (T::*method_varargs_function_t)( const Tuple &args ); typedef Object (T::*method_keyword_function_t)( const Tuple &args, const Dict &kws ); - + MethodDefExt ( const char *_name, @@ -124,11 +124,11 @@ namespace Py ext_meth_def.ml_meth = _handler; ext_meth_def.ml_flags = METH_VARARGS; ext_meth_def.ml_doc = const_cast(_doc); - + ext_varargs_function = _function; ext_keyword_function = NULL; } - + MethodDefExt ( const char *_name, @@ -141,57 +141,57 @@ namespace Py ext_meth_def.ml_meth = method_varargs_call_handler_t( _handler ); ext_meth_def.ml_flags = METH_VARARGS|METH_KEYWORDS; ext_meth_def.ml_doc = const_cast(_doc); - + ext_varargs_function = NULL; ext_keyword_function = _function; } - + ~MethodDefExt() {} - + PyMethodDef ext_meth_def; - method_varargs_function_t ext_varargs_function; - method_keyword_function_t ext_keyword_function; + method_varargs_function_t ext_varargs_function; + method_keyword_function_t ext_keyword_function; }; - + class ExtensionModuleBase { public: ExtensionModuleBase( const char *name ); virtual ~ExtensionModuleBase(); - + Module module(void) const; // only valid after initialize() has been called Dict moduleDictionary(void) const; // only valid after initialize() has been called - + virtual Object invoke_method_keyword( const std::string &_name, const Tuple &_args, const Dict &_keywords ) = 0; virtual Object invoke_method_varargs( const std::string &_name, const Tuple &_args ) = 0; - + const std::string &name() const; const std::string &fullName() const; - + protected: // Initialize the module void initialize( const char *module_doc ); - + const std::string module_name; const std::string full_module_name; MethodTable method_table; - + private: - + // // prevent the compiler generating these unwanted functions // ExtensionModuleBase( const ExtensionModuleBase & ); //unimplemented void operator=( const ExtensionModuleBase & ); //unimplemented - + }; - + extern "C" PyObject *method_keyword_call_handler( PyObject *_self_and_name_tuple, PyObject *_args, PyObject *_keywords ); extern "C" PyObject *method_varargs_call_handler( PyObject *_self_and_name_tuple, PyObject *_args ); extern "C" void do_not_dealloc( void * ); - - + + template class ExtensionModule : public ExtensionModuleBase { @@ -201,16 +201,16 @@ namespace Py {} virtual ~ExtensionModule() {} - + protected: typedef Object (T::*method_varargs_function_t)( const Tuple &args ); typedef Object (T::*method_keyword_function_t)( const Tuple &args, const Dict &kws ); typedef std::map *> method_map_t; - + static void add_varargs_method( const char *name, method_varargs_function_t function, const char *doc="" ) { method_map_t &mm = methods(); - + MethodDefExt *method_definition = new MethodDefExt ( name, @@ -218,14 +218,14 @@ namespace Py method_varargs_call_handler, doc ); - + mm[std::string( name )] = method_definition; } - + static void add_keyword_method( const char *name, method_keyword_function_t function, const char *doc="" ) { method_map_t &mm = methods(); - + MethodDefExt *method_definition = new MethodDefExt ( name, @@ -233,7 +233,7 @@ namespace Py method_keyword_call_handler, doc ); - + mm[std::string( name )] = method_definition; } @@ -241,46 +241,46 @@ namespace Py { ExtensionModuleBase::initialize( module_doc ); Dict dict( moduleDictionary() ); - + // // put each of the methods into the modules dictionary // so that we get called back at the function in T. // method_map_t &mm = methods(); EXPLICIT_TYPENAME method_map_t::iterator i; - + for( i=mm.begin(); i != mm.end(); ++i ) { MethodDefExt *method_definition = (*i).second; - + static PyObject *self = PyCObject_FromVoidPtr( this, do_not_dealloc ); - + Tuple args( 2 ); args[0] = Object( self ); args[1] = String( (*i).first ); - + PyObject *func = PyCFunction_New ( &method_definition->ext_meth_def, new_reference_to( args ) ); - + dict[ (*i).first ] = Object( func ); } } - + protected: // Tom Malcolmson reports that derived classes need access to these - + static method_map_t &methods(void) { static method_map_t *map_of_methods = NULL; if( map_of_methods == NULL ) map_of_methods = new method_map_t; - + return *map_of_methods; } - - + + // this invoke function must be called from within a try catch block virtual Object invoke_method_keyword( const std::string &name, const Tuple &args, const Dict &keywords ) { @@ -292,13 +292,13 @@ namespace Py error_msg += name; throw RuntimeError( error_msg ); } - + // cast up to the derived class T *self = static_cast(this); - + return (self->*meth_def->ext_keyword_function)( args, keywords ); } - + // this invoke function must be called from within a try catch block virtual Object invoke_method_varargs( const std::string &name, const Tuple &args ) { @@ -310,13 +310,13 @@ namespace Py error_msg += name; throw RuntimeError( error_msg ); } - + // cast up to the derived class T *self = static_cast(this); - + return (self->*meth_def->ext_varargs_function)( args ); } - + private: // // prevent the compiler generating these unwanted functions @@ -324,17 +324,17 @@ namespace Py ExtensionModule( const ExtensionModule & ); //unimplemented void operator=( const ExtensionModule & ); //unimplemented }; - - + + class PythonType { public: - // if you define one sequence method you must define + // if you define one sequence method you must define // all of them except the assigns - + PythonType (size_t base_size, int itemsize, const char *default_name ); virtual ~PythonType (); - + const char *getName () const; const char *getDoc () const; @@ -342,7 +342,7 @@ namespace Py PythonType & name (const char* nam); PythonType & doc (const char* d); PythonType & dealloc(void (*f)(PyObject*)); - + PythonType & supportPrint(void); PythonType & supportGetattr(void); PythonType & supportSetattr(void); @@ -354,61 +354,61 @@ namespace Py PythonType & supportHash(void); PythonType & supportCall(void); PythonType & supportIter(void); - + PythonType & supportSequenceType(void); PythonType & supportMappingType(void); PythonType & supportNumberType(void); PythonType & supportBufferType(void); - + protected: PyTypeObject *table; PySequenceMethods *sequence_table; PyMappingMethods *mapping_table; PyNumberMethods *number_table; PyBufferProcs *buffer_table; - + void init_sequence(); void init_mapping(); void init_number(); void init_buffer(); - + private: // // prevent the compiler generating these unwanted functions // PythonType (const PythonType& tb); // unimplemented void operator=(const PythonType& t); // unimplemented - + }; // end of PythonType - - - + + + // Class PythonExtension is what you inherit from to create // a new Python extension type. You give your class itself // as the template paramter. - + // There are two ways that extension objects can get destroyed. // 1. Their reference count goes to zero // 2. Someone does an explicit delete on a pointer. - // In (1) the problem is to get the destructor called + // In (1) the problem is to get the destructor called // We register a special deallocator in the Python type object // (see behaviors()) to do this. // In (2) there is no problem, the dtor gets called. - - // PythonExtension does not use the usual Python heap allocator, + + // PythonExtension does not use the usual Python heap allocator, // instead using new/delete. We do the setting of the type object - // and reference count, usually done by PyObject_New, in the + // and reference count, usually done by PyObject_New, in the // base class ctor. - + // This special deallocator does a delete on the pointer. - - + + class PythonExtensionBase : public PyObject { public: PythonExtensionBase(); virtual ~PythonExtensionBase(); - + public: virtual int print( FILE *, int ); virtual Object getattr( const char * ) = 0; @@ -422,7 +422,7 @@ namespace Py virtual Object call( const Object &, const Object & ); virtual Object iter(); virtual PyObject* iternext(); - + // Sequence methods virtual int sequence_length(); virtual Object sequence_concat( const Object & ); @@ -431,12 +431,12 @@ namespace Py virtual Object sequence_slice( Py_ssize_t, Py_ssize_t ); virtual int sequence_ass_item( Py_ssize_t, const Object & ); virtual int sequence_ass_slice( Py_ssize_t, Py_ssize_t, const Object & ); - + // Mapping virtual int mapping_length(); virtual Object mapping_subscript( const Object & ); virtual int mapping_ass_subscript( const Object &, const Object & ); - + // Number virtual int number_nonzero(); virtual Object number_negative(); @@ -460,38 +460,38 @@ namespace Py virtual Object number_xor( const Object & ); virtual Object number_or( const Object & ); virtual Object number_power( const Object &, const Object & ); - + // Buffer virtual Py_ssize_t buffer_getreadbuffer( Py_ssize_t, void** ); virtual Py_ssize_t buffer_getwritebuffer( Py_ssize_t, void** ); virtual Py_ssize_t buffer_getsegcount( Py_ssize_t* ); - + private: void missing_method( void ); static PyObject *method_call_handler( PyObject *self, PyObject *args ); }; - + template - class PythonExtension: public PythonExtensionBase + class PythonExtension: public PythonExtensionBase { public: - static PyTypeObject* type_object() + static PyTypeObject* type_object() { return behaviors().type_object(); } - + static int check( PyObject *p ) { // is p like me? return p->ob_type == type_object(); } - + static int check( const Object& ob ) { return check( ob.ptr()); } - - + + // // every object needs getattr implemented // to support methods @@ -500,7 +500,7 @@ namespace Py { return getattr_methods( name ); } - + protected: explicit PythonExtension() : PythonExtensionBase() @@ -511,18 +511,18 @@ namespace Py ob_refcnt = 1; ob_type = type_object(); #endif - + // every object must support getattr behaviors().supportGetattr(); } - + virtual ~PythonExtension() - {} - + {} + static PythonType &behaviors() { static PythonType* p; - if( p == NULL ) + if( p == NULL ) { #if defined( _CPPRTTI ) || defined(__GNUG__) const char *default_name = (typeid ( T )).name(); @@ -532,15 +532,15 @@ namespace Py p = new PythonType( sizeof( T ), 0, default_name ); p->dealloc( extension_object_deallocator ); } - + return *p; } - - + + typedef Object (T::*method_varargs_function_t)( const Tuple &args ); typedef Object (T::*method_keyword_function_t)( const Tuple &args, const Dict &kws ); typedef std::map *> method_map_t; - + // support the default attributes, __name__, __doc__ and methods virtual Object getattr_default( const char *_name ) { @@ -576,39 +576,39 @@ namespace Py virtual Object getattr_methods( const char *_name ) { std::string name( _name ); - + method_map_t &mm = methods(); - + if( name == "__methods__" ) { List methods; - + for( EXPLICIT_TYPENAME method_map_t::iterator i = mm.begin(); i != mm.end(); ++i ) methods.append( String( (*i).first ) ); - + return methods; } - + // see if name exists if( mm.find( name ) == mm.end() ) throw AttributeError( name ); - + Tuple self( 2 ); - + self[0] = Object( this ); self[1] = String( name ); - + MethodDefExt *method_definition = mm[ name ]; - + PyObject *func = PyCFunction_New( &method_definition->ext_meth_def, self.ptr() ); - + return Object(func, true); } - + static void add_varargs_method( const char *name, method_varargs_function_t function, const char *doc="" ) { method_map_t &mm = methods(); - + MethodDefExt *method_definition = new MethodDefExt ( name, @@ -616,14 +616,14 @@ namespace Py method_varargs_call_handler, doc ); - + mm[std::string( name )] = method_definition; } - + static void add_keyword_method( const char *name, method_keyword_function_t function, const char *doc="" ) { method_map_t &mm = methods(); - + MethodDefExt *method_definition = new MethodDefExt ( name, @@ -631,45 +631,45 @@ namespace Py method_keyword_call_handler, doc ); - + mm[std::string( name )] = method_definition; } - + private: static method_map_t &methods(void) { static method_map_t *map_of_methods = NULL; if( map_of_methods == NULL ) map_of_methods = new method_map_t; - + return *map_of_methods; } - + static PyObject *method_keyword_call_handler( PyObject *_self_and_name_tuple, PyObject *_args, PyObject *_keywords ) { try { Tuple self_and_name_tuple( _self_and_name_tuple ); - + PyObject *self_in_cobject = self_and_name_tuple[0].ptr(); T *self = static_cast( self_in_cobject ); - + String name( self_and_name_tuple[1] ); - + method_map_t &mm = methods(); MethodDefExt *meth_def = mm[ name ]; if( meth_def == NULL ) return 0; - + Tuple args( _args ); // _keywords may be NULL so be careful about the way the dict is created Dict keywords; if( _keywords != NULL ) keywords = Dict( _keywords ); - + Object result( (self->*meth_def->ext_keyword_function)( args, keywords ) ); - + return new_reference_to( result.ptr() ); } catch( Exception & ) @@ -677,27 +677,27 @@ namespace Py return 0; } } - + static PyObject *method_varargs_call_handler( PyObject *_self_and_name_tuple, PyObject *_args ) { try { Tuple self_and_name_tuple( _self_and_name_tuple ); - + PyObject *self_in_cobject = self_and_name_tuple[0].ptr(); T *self = static_cast( self_in_cobject ); - + String name( self_and_name_tuple[1] ); - + method_map_t &mm = methods(); MethodDefExt *meth_def = mm[ name ]; if( meth_def == NULL ) return 0; - + Tuple args( _args ); - + Object result; - + // TMM: 7Jun'01 - Adding try & catch in case of STL debug-mode exceptions. #ifdef _STLP_DEBUG try @@ -712,7 +712,7 @@ namespace Py #else result = (self->*meth_def->ext_varargs_function)( args ); #endif // _STLP_DEBUG - + return new_reference_to( result.ptr() ); } catch( Exception & ) @@ -720,19 +720,19 @@ namespace Py return 0; } } - + static void extension_object_deallocator ( PyObject* t ) { delete (T *)( t ); } - + // // prevent the compiler generating these unwanted functions // explicit PythonExtension( const PythonExtension& other ); void operator=( const PythonExtension& rhs ); }; - + // // ExtensionObject is an Object that will accept only T's. // @@ -740,30 +740,30 @@ namespace Py class ExtensionObject: public Object { public: - + explicit ExtensionObject ( PyObject *pyob ) : Object( pyob ) { validate(); } - + ExtensionObject( const ExtensionObject& other ) : Object( *other ) { validate(); } - + ExtensionObject( const Object& other ) : Object( *other ) { validate(); } - + ExtensionObject& operator= ( const Object& rhs ) { return (*this = *rhs ); } - + ExtensionObject& operator= ( PyObject* rhsp ) { if( ptr() == rhsp ) @@ -771,12 +771,12 @@ namespace Py set( rhsp ); return *this; } - + virtual bool accepts ( PyObject *pyob ) const { return ( pyob && T::check( pyob )); - } - + } + // // Obtain a pointer to the PythonExtension object // @@ -785,7 +785,7 @@ namespace Py return static_cast( ptr() ); } }; - + } // Namespace Py // End of CXX_Extensions.h #endif diff --git a/agg24/include/agg_alpha_mask_u8.h b/agg24/include/agg_alpha_mask_u8.h index e301c100880d..0f1fc37ea43e 100644 --- a/agg24/include/agg_alpha_mask_u8.h +++ b/agg24/include/agg_alpha_mask_u8.h @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -30,15 +30,15 @@ namespace agg { static unsigned calculate(const int8u* p) { return *p; } }; - + //=====================================================rgb_to_gray_mask_u8 template struct rgb_to_gray_mask_u8 { - static unsigned calculate(const int8u* p) - { - return (p[R]*77 + p[G]*150 + p[B]*29) >> 8; + static unsigned calculate(const int8u* p) + { + return (p[R]*77 + p[G]*150 + p[B]*29) >> 8; } }; @@ -50,7 +50,7 @@ namespace agg typedef int8u cover_type; typedef alpha_mask_u8 self_type; enum cover_scale_e - { + { cover_shift = 8, cover_none = 0, cover_full = 255 @@ -64,12 +64,12 @@ namespace agg MaskF& mask_function() { return m_mask_function; } const MaskF& mask_function() const { return m_mask_function; } - + //-------------------------------------------------------------------- cover_type pixel(int x, int y) const { - if(x >= 0 && y >= 0 && - x < (int)m_rbuf->width() && + if(x >= 0 && y >= 0 && + x < (int)m_rbuf->width() && y < (int)m_rbuf->height()) { return (cover_type)m_mask_function.calculate( @@ -81,13 +81,13 @@ namespace agg //-------------------------------------------------------------------- cover_type combine_pixel(int x, int y, cover_type val) const { - if(x >= 0 && y >= 0 && - x < (int)m_rbuf->width() && + if(x >= 0 && y >= 0 && + x < (int)m_rbuf->width() && y < (int)m_rbuf->height()) { - return (cover_type)((cover_full + val * + return (cover_type)((cover_full + val * m_mask_function.calculate( - m_rbuf->row_ptr(y) + x * Step + Offset)) >> + m_rbuf->row_ptr(y) + x * Step + Offset)) >> cover_shift); } return 0; @@ -112,7 +112,7 @@ namespace agg if(x < 0) { count += x; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -126,7 +126,7 @@ namespace agg { int rest = x + count - xmax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -162,7 +162,7 @@ namespace agg if(x < 0) { count += x; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -176,7 +176,7 @@ namespace agg { int rest = x + count - xmax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -187,8 +187,8 @@ namespace agg const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { - *covers = (cover_type)((cover_full + (*covers) * - m_mask_function.calculate(mask)) >> + *covers = (cover_type)((cover_full + (*covers) * + m_mask_function.calculate(mask)) >> cover_shift); ++covers; mask += Step; @@ -214,7 +214,7 @@ namespace agg if(y < 0) { count += y; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -228,7 +228,7 @@ namespace agg { int rest = y + count - ymax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -263,7 +263,7 @@ namespace agg if(y < 0) { count += y; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -277,7 +277,7 @@ namespace agg { int rest = y + count - ymax - 1; count -= rest; - if(count <= 0) + if(count <= 0) { memset(dst, 0, num_pix * sizeof(cover_type)); return; @@ -288,8 +288,8 @@ namespace agg const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { - *covers = (cover_type)((cover_full + (*covers) * - m_mask_function.calculate(mask)) >> + *covers = (cover_type)((cover_full + (*covers) * + m_mask_function.calculate(mask)) >> cover_shift); ++covers; mask += m_rbuf->stride(); @@ -302,10 +302,10 @@ namespace agg alpha_mask_u8(const self_type&); const self_type& operator = (const self_type&); - rendering_buffer* m_rbuf; + agg::rendering_buffer* m_rbuf; MaskF m_mask_function; }; - + typedef alpha_mask_u8<1, 0> alpha_mask_gray8; //----alpha_mask_gray8 @@ -354,7 +354,7 @@ namespace agg typedef int8u cover_type; typedef amask_no_clip_u8 self_type; enum cover_scale_e - { + { cover_shift = 8, cover_none = 0, cover_full = 255 @@ -376,13 +376,13 @@ namespace agg m_rbuf->row_ptr(y) + x * Step + Offset); } - + //-------------------------------------------------------------------- cover_type combine_pixel(int x, int y, cover_type val) const { - return (cover_type)((cover_full + val * + return (cover_type)((cover_full + val * m_mask_function.calculate( - m_rbuf->row_ptr(y) + x * Step + Offset)) >> + m_rbuf->row_ptr(y) + x * Step + Offset)) >> cover_shift); } @@ -407,8 +407,8 @@ namespace agg const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { - *dst = (cover_type)((cover_full + (*dst) * - m_mask_function.calculate(mask)) >> + *dst = (cover_type)((cover_full + (*dst) * + m_mask_function.calculate(mask)) >> cover_shift); ++dst; mask += Step; @@ -436,8 +436,8 @@ namespace agg const int8u* mask = m_rbuf->row_ptr(y) + x * Step + Offset; do { - *dst = (cover_type)((cover_full + (*dst) * - m_mask_function.calculate(mask)) >> + *dst = (cover_type)((cover_full + (*dst) * + m_mask_function.calculate(mask)) >> cover_shift); ++dst; mask += m_rbuf->stride(); @@ -449,10 +449,10 @@ namespace agg amask_no_clip_u8(const self_type&); const self_type& operator = (const self_type&); - rendering_buffer* m_rbuf; + agg::rendering_buffer* m_rbuf; MaskF m_mask_function; }; - + typedef amask_no_clip_u8<1, 0> amask_no_clip_gray8; //----amask_no_clip_gray8 From 8ae4265cbacaf5e219705402612d525ba0b7ddbf Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 25 Feb 2009 15:39:34 +0000 Subject: [PATCH 140/324] Fix crashes with empty data and step draw style. svn path=/branches/v0_98_5_maint/; revision=6934 --- lib/matplotlib/lines.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 330aa8f87f71..808f7c9bed44 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -458,10 +458,11 @@ def draw(self, renderer): funcname = self._lineStyles.get(self._linestyle, '_draw_nothing') if funcname != '_draw_nothing': tpath, affine = self._transformed_path.get_transformed_path_and_affine() - self._lineFunc = getattr(self, funcname) - funcname = self.drawStyles.get(self._drawstyle, '_draw_lines') - drawFunc = getattr(self, funcname) - drawFunc(renderer, gc, tpath, affine.frozen()) + if len(tpath.vertices): + self._lineFunc = getattr(self, funcname) + funcname = self.drawStyles.get(self._drawstyle, '_draw_lines') + drawFunc = getattr(self, funcname) + drawFunc(renderer, gc, tpath, affine.frozen()) if self._marker is not None: gc = renderer.new_gc() @@ -472,8 +473,9 @@ def draw(self, renderer): funcname = self._markers.get(self._marker, '_draw_nothing') if funcname != '_draw_nothing': tpath, affine = self._transformed_path.get_transformed_points_and_affine() - markerFunc = getattr(self, funcname) - markerFunc(renderer, gc, tpath, affine.frozen()) + if len(tpath.vertices): + markerFunc = getattr(self, funcname) + markerFunc(renderer, gc, tpath, affine.frozen()) renderer.close_group('line2d') From 345d0187d2577fc5183333e447560b1ca0dbb032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Thu, 26 Feb 2009 19:54:48 +0000 Subject: [PATCH 141/324] Support image clipping in the pdf backend svn path=/branches/v0_98_5_maint/; revision=6938 --- CHANGELOG | 2 ++ lib/matplotlib/backends/backend_pdf.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0712db8832b3..36d596f91179 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2009-02-26 Support image clipping in pdf backend. - JKS + 2009-02-16 Move plot_directive.py to the installed source tree. Add support for inline code content - MGD diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 32657ba8f292..12b70c2e1041 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -39,7 +39,7 @@ from matplotlib.ft2font import FT2Font, FIXED_WIDTH, ITALIC, LOAD_NO_SCALE, \ LOAD_NO_HINTING, KERNING_UNFITTED from matplotlib.mathtext import MathTextParser -from matplotlib.transforms import Affine2D, Bbox, BboxBase +from matplotlib.transforms import Affine2D, Bbox, BboxBase, TransformedPath from matplotlib.path import Path from matplotlib import ttconv @@ -1235,10 +1235,12 @@ def get_image_magnification(self): return self.image_dpi/72.0 def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): - # MGDTODO: Support clippath here gc = self.new_gc() if bbox is not None: gc.set_clip_rectangle(bbox) + if clippath is not None: + clippath = TransformedPath(clippath, clippath_trans) + gc.set_clip_path(clippath) self.check_gc(gc) h, w = im.get_size_out() From 001365b41d5e81a0b80cbf54619995335f557efa Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 27 Feb 2009 13:30:13 +0000 Subject: [PATCH 142/324] Fix glyph alignment with STIX mathtext svn path=/branches/v0_98_5_maint/; revision=6941 --- src/ft2font.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ft2font.cpp b/src/ft2font.cpp index 09437be6c758..e000e0d13cff 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -1256,8 +1256,14 @@ FT2Font::draw_glyph_to_bitmap(const Py::Tuple & args) { throw Py::TypeError("Usage: draw_glyph_to_bitmap(bitmap, x,y,glyph)"); FT2Image* im = static_cast(args[0].ptr()); - long x = Py::Int(args[1]); - long y = Py::Int(args[2]); + double xd = Py::Float(args[1]); + double yd = Py::Float(args[2]); + long x = (long)mpl_round(xd); + long y = (long)mpl_round(yd); + FT_Vector sub_offset; + sub_offset.x = int((xd - (double)x) * 64.0); + sub_offset.y = int((yd - (double)y) * 64.0); + if (!Glyph::check(args[3].ptr())) throw Py::TypeError("Usage: draw_glyph_to_bitmap(bitmap, x,y,glyph)"); Glyph* glyph = static_cast(args[3].ptr()); @@ -1267,7 +1273,7 @@ FT2Font::draw_glyph_to_bitmap(const Py::Tuple & args) { error = FT_Glyph_To_Bitmap(&glyphs[glyph->glyphInd], ft_render_mode_normal, - 0, //no additional translation + &sub_offset, //no additional translation 1 //destroy image; ); if (error) From 69aa2756738a972e06ecf3096b2c3b609cc041e4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 2 Mar 2009 22:50:44 +0000 Subject: [PATCH 143/324] Fix bug in doc build. svn path=/branches/v0_98_5_maint/; revision=6946 --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index fa48ec687df9..f5e23c3021a3 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -28,7 +28,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['matplotlib.sphinxext.mathmpl', 'math_symbol_table', - 'sphinx.ext.autodoc', # 'matplotlib.sphinxext.only_directives', + 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives', 'matplotlib.sphinxext.plot_directive', 'inheritance_diagram', 'gen_gallery', 'gen_rst'] From 8a87b224cd871b24f9decbd5029a5aa52ca6ca8e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 3 Mar 2009 13:25:23 +0000 Subject: [PATCH 144/324] Fix plotting() docstring. svn path=/branches/v0_98_5_maint/; revision=6948 --- lib/matplotlib/pyplot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 41fb94e41736..bb46cd2fe31f 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1138,6 +1138,7 @@ def thetagrids(*args, **kwargs): def plotting(): """ Plotting commands + =============== ========================================================= Command Description =============== ========================================================= From 14f2569ef24d92bb4e986fb9145f651063f0afb9 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 3 Mar 2009 22:06:53 +0000 Subject: [PATCH 145/324] Add workaround for change in handling of absolute paths in image directive in recent Sphinx hg versions. svn path=/branches/v0_98_5_maint/; revision=6950 --- lib/matplotlib/sphinxext/plot_directive.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 40c2b1f62d53..35608134bdc8 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -30,6 +30,10 @@ from docutils.parsers.rst.directives.images import Image align = Image.align from docutils import nodes +import sphinx + +sphinx_version = sphinx.__version__.split(".") +sphinx_version = tuple([int(x) for x in sphinx_version[:2]]) import matplotlib import matplotlib.cbook as cbook @@ -92,11 +96,11 @@ def write_char(s): [%(links)s] - .. image:: %(tmpdir)s/%(outname)s.png + .. image:: %(prefix)s%(tmpdir)s/%(outname)s.png %(options)s .. latexonly:: - .. image:: %(tmpdir)s/%(outname)s.pdf + .. image:: %(prefix)s%(tmpdir)s/%(outname)s.pdf %(options)s """ @@ -262,7 +266,17 @@ def plot_directive(name, arguments, options, content, lineno, # tmpdir is where we build all the output files. This way the # plots won't have to be redone when generating latex after html. - tmpdir = os.path.abspath(os.path.join('build', outdir)) + + # Prior to Sphinx 0.6, absolute image paths were treated as + # relative to the root of the filesystem. 0.6 and after, they are + # treated as relative to the root of the documentation tree. We need + # to support both methods here. + tmpdir = os.path.join('build', outdir) + if sphinx_version < (0, 6): + tmpdir = os.path.abspath(tmpdir) + prefix = '' + else: + prefix = '/' if not os.path.exists(tmpdir): cbook.mkdirs(tmpdir) From 3e8c687e951648189a8bb62f66b449b69671d510 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 4 Mar 2009 13:25:41 +0000 Subject: [PATCH 146/324] Fix for Python 2.4 compatibility. svn path=/branches/v0_98_5_maint/; revision=6952 --- lib/matplotlib/sphinxext/plot_directive.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 35608134bdc8..29409afd5f01 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -136,8 +136,6 @@ def runfile(fullpath): try: fd = open(fname) module = imp.load_module("__main__", fd, fname, ('py', 'r', imp.PY_SOURCE)) - except: - raise finally: del sys.path[0] os.chdir(pwd) From ae28cb25230e977d000688ae9cb3c59d1918ca02 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sat, 7 Mar 2009 19:19:40 +0000 Subject: [PATCH 147/324] Remove references to handle graphics; it is registered trademark of Mathworks, and the pyplot resemblance is only superficial. svn path=/branches/v0_98_5_maint/; revision=6960 --- doc/_templates/index.html | 6 +++--- doc/pyplots/tex_demo.png | Bin 22881 -> 24722 bytes doc/users/pyplot_tutorial.rst | 4 ++-- examples/pylab_examples/axes_props.py | 2 +- lib/matplotlib/pylab.py | 4 ++-- lib/matplotlib/pyplot.py | 10 +++++----- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/_templates/index.html b/doc/_templates/index.html index 156cb65f98ea..8aa9228ce0f1 100644 --- a/doc/_templates/index.html +++ b/doc/_templates/index.html @@ -35,7 +35,7 @@

Welcome

For the power user, you have full control of line styles, font properties, axes properties, etc, via an object oriented interface - or via a handle graphics interface familiar to Matlab® users. + or via a set of functions familiar to Matlab® users. The pylab mode provides all of the pyplot plotting functions listed below, as well as non-plotting functions from numpy and @@ -473,7 +473,7 @@

Plotting commands


- get a handle graphics property + get a graphics property @@ -781,7 +781,7 @@

Plotting commands


- set a handle graphics property + set a graphics property diff --git a/doc/pyplots/tex_demo.png b/doc/pyplots/tex_demo.png index 6eaea7a882b7fa06db12186d158d297ffeb4cb23..f491ebc52d7d00fa14a0677ec2e9c0dd25bbf633 100644 GIT binary patch literal 24722 zcmbq*by!vHw=JPy(IV1F2-2Mb2B9FJG}0w0NQ%VXASw+4(xo6G5}Oc^+#uZ|Eh$KM zH~Y@5zjN<%&iV8D_&q*;?Dg)o<~!dp#~5=igC43X5?!FVfP;fWbpM{5It~t=E)EXv z+j9i)f1E`a;^B`oE_d#0o`YZB=PUx@@8_T0({sVWAu+}Nhx=JJ%LWIB3Fp4tZB38l zfyXM*Lr@fu-*EsvhuW^hlVQe(!;&7yz5+XeM74ozWr+RJgo`meufB*>5s?LnQfPLH~TabuKgOwe~NdvuTNhbEn7ox zVnQ(M+;xz;Cb2fSwa$7;$Vz4_VT)QOc}sc%rQ9n_BnQ7fCUFnrl9G{;4HMCFGsCZx z!aD39KdJve{yMBzgwMoWRN{yGK8r9u9%pgMFE(~KO`iFdV!%EUA@k6P_%dZ{P;{W{ z%#>NToE!o5RU8A}_n!#j6Y*^A{GMGscg8oG-7inyZ>-X9roHimgbpV-#P20uxl@+y zj8czWzCODYIdi*-zr38qyK$rUAFl0|ir6)v8AyH%maPjA5(mC{z(z=dH)zBqb%9y= z_f>ebj6X9xRZl&1=^BeDM0MmY7Qk}~Mt=&*(8b4}IydM|K{4AbCs$#PUGrmh_Ao|~ z`IdQxb^hUz->2(NO8j5Ss5p2;WSd;+#c}K>cx%!L2pS?Qb90B08JLMGJ)>N?>(kip zVUbUYh-Pm@8z22ze!tuENI-#$oXor^F{xi-OjPp1x3OCsXI$NI{rzw8a}cbH33r6c z(lQWSxadd8Wuf@Mf>X8k7TiF2uV9Cc=9$pYc&d=`3m1F`wBP5edZ#5xNqv^ROpYP& zzonOuydTIqb>j{*vy$PXNbyb4n>R;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+sfNQNNVq4!P}@V>J>n zy}39%a}JIwVlBBAn_)?hP%JRvWf`|V8m|Kjl%oHi>;ccBq9R>p1q7@NB6ls#P{c7B z9{P!uUI*6u1p5Mp0T?2C{j{ zCZ0RDHSBY_Uq>qzTsWd|wn0yKi;s5T2DU;mmdtP)$)xoR?RA=lFQIc!evz2a*xUr6N`i`MuSHUyCI_R5%}9@` v^%8ob_DO9;ZhWmzA*$nk`YFFX1X=nZukBRBlFp) diff --git a/doc/users/pyplot_tutorial.rst b/doc/users/pyplot_tutorial.rst index 4c215021f3e5..fc71eed05708 100644 --- a/doc/users/pyplot_tutorial.rst +++ b/doc/users/pyplot_tutorial.rst @@ -78,10 +78,10 @@ several ways to set line properties line.set_antialiased(False) # turn off antialising * Use the :func:`~matplotlib.pyplot.setp` command. The example below - uses matlab handle graphics style command to set multiple properties + uses a Matlab-style command to set multiple properties on a list of lines. ``setp`` works transparently with a list of objects or a single object. You can either use python keyword arguments or - matlab-style string/value pairs:: + Matlab-style string/value pairs:: lines = plt.plot(x1, y1, x2, y2) # use keyword args diff --git a/examples/pylab_examples/axes_props.py b/examples/pylab_examples/axes_props.py index 2709314c6670..b6d2bfdf9cd2 100644 --- a/examples/pylab_examples/axes_props.py +++ b/examples/pylab_examples/axes_props.py @@ -10,7 +10,7 @@ plot(t, s) grid(True) -# matlab handle graphics style +# matlab style xticklines = getp(gca(), 'xticklines') yticklines = getp(gca(), 'yticklines') xgridlines = getp(gca(), 'xgridlines') diff --git a/lib/matplotlib/pylab.py b/lib/matplotlib/pylab.py index bb42b3df48da..386227ebb92c 100644 --- a/lib/matplotlib/pylab.py +++ b/lib/matplotlib/pylab.py @@ -42,7 +42,7 @@ gca - return the current axes gcf - return the current figure gci - get the current image, or None - getp - get a handle graphics property + getp - get a graphics property grid - set whether gridding is on hist - make a histogram hold - set the axes hold state @@ -69,7 +69,7 @@ rgrids - customize the radial grids and labels for polar savefig - save the current figure scatter - make a scatter plot - setp - set a handle graphics property + setp - set a graphics property semilogx - log x axis semilogy - log y axis show - show the figures diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index bb46cd2fe31f..e1e5a1505aa0 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -193,7 +193,7 @@ def figure(num=None, # autoincrement if None, else integer from 1-N *number* attribute holding this number. If *num* is an integer, and ``figure(num)`` already exists, make it - active and return the handle to it. If ``figure(num)`` does not exist + active and return a reference to it. If ``figure(num)`` does not exist it will be created. Numbering starts at 1, matlab style:: figure(1) @@ -264,7 +264,7 @@ def make_active(event): return figManager.canvas.figure def gcf(): - "Return a handle to the current figure." + "Return a reference to the current figure." figManager = _pylab_helpers.Gcf.get_active() if figManager is not None: @@ -1166,7 +1166,7 @@ def plotting(): gca return the current axes gcf return the current figure gci get the current image, or None - getp get a handle graphics property + getp get a graphics property hist make a histogram hold set the hold state on current axes legend add a legend to the axes @@ -1182,7 +1182,7 @@ def plotting(): rc control the default params savefig save the current figure scatter make a scatter plot - setp set a handle graphics property + setp set a graphics property semilogx log x axis semilogy log y axis show show the figures @@ -1229,7 +1229,7 @@ def get_plot_commands(): return ( 'axes', 'axis', 'bar', 'boxplot', 'cla', 'clf' def colors(): """ - This is a do nothing function to provide you with help on how + This is a do-nothing function to provide you with help on how matplotlib handles colors. Commands which take color arguments can use several formats to From f254fe150cc6618b89057b74a892efc61aecf450 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Wed, 11 Mar 2009 19:36:22 +0000 Subject: [PATCH 148/324] Ensure wx version >= 2.8; Sandro Tosi patch plus change to backend svn path=/branches/v0_98_5_maint/; revision=6972 --- CHANGELOG | 3 ++ examples/user_interfaces/embedding_in_wx2.py | 24 ++++++----- examples/user_interfaces/embedding_in_wx3.py | 43 +++++++++++--------- examples/user_interfaces/embedding_in_wx4.py | 30 ++++++++------ examples/user_interfaces/embedding_in_wx5.py | 4 ++ lib/matplotlib/backends/backend_wx.py | 15 ++++++- lib/matplotlib/backends/backend_wxagg.py | 5 +-- 7 files changed, 77 insertions(+), 47 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 36d596f91179..c124068b273c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2009-03-11 Ensure wx version >= 2.8; thanks to Sandro Tosi and + Chris Barker. - EF + 2009-02-26 Support image clipping in pdf backend. - JKS 2009-02-16 Move plot_directive.py to the installed source tree. Add diff --git a/examples/user_interfaces/embedding_in_wx2.py b/examples/user_interfaces/embedding_in_wx2.py index 3a64b2678276..b35c65af2bc0 100644 --- a/examples/user_interfaces/embedding_in_wx2.py +++ b/examples/user_interfaces/embedding_in_wx2.py @@ -4,6 +4,10 @@ toolbar - comment out the setA_toolbar line for no toolbar """ +# Used to guarantee to use at least Wx2.8 +import wxversion +wxversion.ensureMinimal('2.8') + from numpy import arange, sin, pi import matplotlib @@ -20,15 +24,15 @@ from matplotlib.figure import Figure -from wx import * +import wx -class CanvasFrame(Frame): +class CanvasFrame(wx.Frame): def __init__(self): - Frame.__init__(self,None,-1, + wx.Frame.__init__(self,None,-1, 'CanvasFrame',size=(550,350)) - self.SetBackgroundColour(NamedColor("WHITE")) + self.SetBackgroundColour(wx.NamedColor("WHITE")) self.figure = Figure() self.axes = self.figure.add_subplot(111) @@ -38,8 +42,8 @@ def __init__(self): self.axes.plot(t,s) self.canvas = FigureCanvas(self, -1, self.figure) - self.sizer = BoxSizer(VERTICAL) - self.sizer.Add(self.canvas, 1, LEFT | TOP | GROW) + self.sizer = wx.BoxSizer(wx.VERTICAL) + self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.SetSizer(self.sizer) self.Fit() @@ -49,7 +53,7 @@ def __init__(self): def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() - if Platform == '__WXMAC__': + if wx.Platform == '__WXMAC__': # Mac platform (OSX 10.3, MacPython) does not seem to cope with # having a toolbar in a sizer. This work-around gets the buttons # back, but at the expense of having the toolbar at the top @@ -62,8 +66,8 @@ def add_toolbar(self): # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. # As noted above, doesn't work for Mac. - self.toolbar.SetSize(Size(fw, th)) - self.sizer.Add(self.toolbar, 0, LEFT | EXPAND) + self.toolbar.SetSize(wx.Size(fw, th)) + self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND) # update the axes menu on the toolbar self.toolbar.update() @@ -71,7 +75,7 @@ def add_toolbar(self): def OnPaint(self, event): self.canvas.draw() -class App(App): +class App(wx.App): def OnInit(self): 'Create the main window and insert the custom frame' diff --git a/examples/user_interfaces/embedding_in_wx3.py b/examples/user_interfaces/embedding_in_wx3.py index bcb1daa3b4f4..809dc699dea9 100644 --- a/examples/user_interfaces/embedding_in_wx3.py +++ b/examples/user_interfaces/embedding_in_wx3.py @@ -18,6 +18,11 @@ Thanks to matplotlib and wx teams for creating such great software! """ + +# Used to guarantee to use at least Wx2.8 +import wxversion +wxversion.ensureMinimal('2.8') + import sys, time, os, gc import matplotlib matplotlib.use('WXAgg') @@ -26,18 +31,18 @@ from matplotlib.figure import Figure import numpy as npy -from wx import * -from wx.xrc import * +import wx +import wx.xrc as xrc ERR_TOL = 1e-5 # floating point slop for peak-detection matplotlib.rc('image', origin='lower') -class PlotPanel(Panel): +class PlotPanel(wx.Panel): def __init__(self, parent): - Panel.__init__(self, parent, -1) + wx.Panel.__init__(self, parent, -1) self.fig = Figure((5,4), 75) self.canvas = FigureCanvasWxAgg(self, -1, self.fig) @@ -46,11 +51,11 @@ def __init__(self, parent): #self.toolbar.set_active([0,1]) # Now put all into a sizer - sizer = BoxSizer(VERTICAL) + sizer = wx.BoxSizer(wx.VERTICAL) # This way of adding to sizer allows resizing - sizer.Add(self.canvas, 1, LEFT|TOP|GROW) + sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW) # Best to allow the toolbar to resize! - sizer.Add(self.toolbar, 0, GROW) + sizer.Add(self.toolbar, 0, wx.GROW) self.SetSizer(sizer) self.Fit() @@ -94,43 +99,43 @@ def onEraseBackground(self, evt): # this is supposed to prevent redraw flicker on some X servers... pass -class MyApp(App): +class MyApp(wx.App): def OnInit(self): xrcfile = os.path.join(os.path.dirname(__file__),"..","data", "embedding_in_wx3.xrc") - self.res = XmlResource(xrcfile) + self.res = xrc.XmlResource(xrcfile) # main frame and panel --------- self.frame = self.res.LoadFrame(None,"MainFrame") - self.panel = XRCCTRL(self.frame,"MainPanel") + self.panel = xrc.XRCCTRL(self.frame,"MainPanel") # matplotlib panel ------------- # container for matplotlib panel (I like to make a container # panel for our panel so I know where it'll go when in XRCed.) - plot_container = XRCCTRL(self.frame,"plot_container_panel") - sizer = BoxSizer(VERTICAL) + plot_container = xrc.XRCCTRL(self.frame,"plot_container_panel") + sizer = wx.BoxSizer(wx.VERTICAL) # matplotlib panel itself self.plotpanel = PlotPanel(plot_container) self.plotpanel.init_plot_data() # wx boilerplate - sizer.Add(self.plotpanel, 1, EXPAND) + sizer.Add(self.plotpanel, 1, wx.EXPAND) plot_container.SetSizer(sizer) # whiz button ------------------ - whiz_button = XRCCTRL(self.frame,"whiz_button") - EVT_BUTTON(whiz_button, whiz_button.GetId(), - self.plotpanel.OnWhiz) + whiz_button = xrc.XRCCTRL(self.frame,"whiz_button") + wx.EVT_BUTTON(whiz_button, whiz_button.GetId(), + self.plotpanel.OnWhiz) # bang button ------------------ - bang_button = XRCCTRL(self.frame,"bang_button") - EVT_BUTTON(bang_button, bang_button.GetId(), - self.OnBang) + bang_button = xrc.XRCCTRL(self.frame,"bang_button") + wx.EVT_BUTTON(bang_button, bang_button.GetId(), + self.OnBang) # final setup ------------------ diff --git a/examples/user_interfaces/embedding_in_wx4.py b/examples/user_interfaces/embedding_in_wx4.py index 26853381d8e4..c770cb2af940 100644 --- a/examples/user_interfaces/embedding_in_wx4.py +++ b/examples/user_interfaces/embedding_in_wx4.py @@ -4,6 +4,10 @@ toolbar """ +# Used to guarantee to use at least Wx2.8 +import wxversion +wxversion.ensureMinimal('2.8') + from numpy import arange, sin, pi import matplotlib @@ -16,13 +20,13 @@ from matplotlib.figure import Figure from numpy.random import rand -from wx import * +import wx class MyNavigationToolbar(NavigationToolbar2WxAgg): """ Extend the default wx toolbar with your own event handlers """ - ON_CUSTOM = NewId() + ON_CUSTOM = wx.NewId() def __init__(self, canvas, cankill): NavigationToolbar2WxAgg.__init__(self, canvas) @@ -30,7 +34,7 @@ def __init__(self, canvas, cankill): # probably want to add your own. self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'), 'Click me', 'Activate custom contol') - EVT_TOOL(self, self.ON_CUSTOM, self._on_custom) + wx.EVT_TOOL(self, self.ON_CUSTOM, self._on_custom) def _on_custom(self, evt): # add some text to the axes in a random location in axes (0,1) @@ -51,13 +55,13 @@ def _on_custom(self, evt): evt.Skip() -class CanvasFrame(Frame): +class CanvasFrame(wx.Frame): def __init__(self): - Frame.__init__(self,None,-1, + wx.Frame.__init__(self,None,-1, 'CanvasFrame',size=(550,350)) - self.SetBackgroundColour(NamedColor("WHITE")) + self.SetBackgroundColour(wx.NamedColor("WHITE")) self.figure = Figure(figsize=(5,4), dpi=100) self.axes = self.figure.add_subplot(111) @@ -68,14 +72,14 @@ def __init__(self): self.canvas = FigureCanvas(self, -1, self.figure) - self.sizer = BoxSizer(VERTICAL) - self.sizer.Add(self.canvas, 1, TOP | LEFT | EXPAND) + self.sizer = wx.BoxSizer(wx.VERTICAL) + self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND) # Capture the paint message - EVT_PAINT(self, self.OnPaint) + wx.EVT_PAINT(self, self.OnPaint) self.toolbar = MyNavigationToolbar(self.canvas, True) self.toolbar.Realize() - if Platform == '__WXMAC__': + if wx.Platform == '__WXMAC__': # Mac platform (OSX 10.3, MacPython) does not seem to cope with # having a toolbar in a sizer. This work-around gets the buttons # back, but at the expense of having the toolbar at the top @@ -88,8 +92,8 @@ def __init__(self): # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. # As noted above, doesn't work for Mac. - self.toolbar.SetSize(Size(fw, th)) - self.sizer.Add(self.toolbar, 0, LEFT | EXPAND) + self.toolbar.SetSize(wx.Size(fw, th)) + self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND) # update the axes menu on the toolbar self.toolbar.update() @@ -101,7 +105,7 @@ def OnPaint(self, event): self.canvas.draw() event.Skip() -class App(App): +class App(wx.App): def OnInit(self): 'Create the main window and insert the custom frame' diff --git a/examples/user_interfaces/embedding_in_wx5.py b/examples/user_interfaces/embedding_in_wx5.py index 1da64d682782..fd3969aca881 100644 --- a/examples/user_interfaces/embedding_in_wx5.py +++ b/examples/user_interfaces/embedding_in_wx5.py @@ -1,3 +1,7 @@ +# Used to guarantee to use at least Wx2.8 +import wxversion +wxversion.ensureMinimal('2.8') + import wx import wx.aui import matplotlib as mpl diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 1a67aa330ef0..9595439cdc43 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -108,12 +108,23 @@ import traceback, pdb _DEBUG_lvls = {1 : 'Low ', 2 : 'Med ', 3 : 'High', 4 : 'Error' } +missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython >=2.8" + +try: + import wxversion +except ImportError: + raise ImportError(missingwx) + +try: + wxversion.ensureMinimal('2.8') +except wxversion.AlreadyImportedError: + pass try: import wx backend_version = wx.VERSION_STRING -except: - raise ImportError("Matplotlib backend_wx requires wxPython be installed") +except ImportError: + raise ImportError(missingwx) #!!! this is the call that is causing the exception swallowing !!! #wx.InitAllImageHandlers() diff --git a/lib/matplotlib/backends/backend_wxagg.py b/lib/matplotlib/backends/backend_wxagg.py index 515ccc46ac54..2041c86f9c48 100644 --- a/lib/matplotlib/backends/backend_wxagg.py +++ b/lib/matplotlib/backends/backend_wxagg.py @@ -16,16 +16,15 @@ """ -import wx import matplotlib from matplotlib.figure import Figure from backend_agg import FigureCanvasAgg -import backend_wx +import backend_wx # already uses wxversion.ensureMinimal('2.8') from backend_wx import FigureManager, FigureManagerWx, FigureCanvasWx, \ FigureFrameWx, DEBUG_MSG, NavigationToolbar2Wx, error_msg_wx, \ draw_if_interactive, show, Toolbar, backend_version - +import wx class FigureFrameWxAgg(FigureFrameWx): def get_canvas(self, fig): From d77e059b95134a224346b819dd899de28ac294b1 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Tue, 17 Mar 2009 19:15:01 +0000 Subject: [PATCH 149/324] Fix bug in alpha handling. The alpha kwarg was multiplying the existing alpha instead of replacing it. Thanks to Jae-Joon Lee. svn path=/branches/v0_98_5_maint/; revision=6984 --- lib/matplotlib/colors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index de4702658cdb..fa0475ddad95 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -331,7 +331,7 @@ def to_rgba(self, arg, alpha=None): return tuple(arg) if alpha < 0.0 or alpha > 1.0: raise ValueError("alpha must be in range 0-1") - return arg[0], arg[1], arg[2], arg[3] * alpha + return arg[0], arg[1], arg[2], alpha r,g,b = arg[:3] if [x for x in (r,g,b) if (float(x) < 0) or (x > 1)]: raise ValueError('number in rbg sequence outside 0-1 range') From b3714475477b675bebaac198006e206558d71ba2 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Tue, 17 Mar 2009 19:34:27 +0000 Subject: [PATCH 150/324] In contourf, don't accidentally set the edgecolor. svn path=/branches/v0_98_5_maint/; revision=6985 --- CHANGELOG | 3 +++ lib/matplotlib/contour.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c124068b273c..804791815e1b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2009-03-17 Fix bugs in edge color handling by contourf, found + by Jae-Joon Lee. - EF + 2009-03-11 Ensure wx version >= 2.8; thanks to Sandro Tosi and Chris Barker. - EF diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index bc2b4d051069..84f4885c2584 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -629,8 +629,10 @@ def changed(self): self.to_rgba(self.cvalues, alpha=self.alpha)] self.tcolors = tcolors for color, collection in zip(tcolors, self.collections): - collection.set_alpha(self.alpha) - collection.set_color(color) + if self.filled: + collection.set_facecolor(color) + else: + collection.set_color(color) for label, cv in zip(self.labelTexts, self.labelCValues): label.set_alpha(self.alpha) label.set_color(self.labelMappable.to_rgba(cv)) From a89f7825762baa372b99e14d1d072f799d52ca05 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 18 Mar 2009 15:48:30 +0000 Subject: [PATCH 151/324] Fix race condition in tempfile creation in PS backend. If two mpl processes try to create PS files with the same file name and the same time, they will use the same tempfile, and madness, crashing and burning will ensue. svn path=/branches/v0_98_5_maint/; revision=6990 --- lib/matplotlib/backends/backend_ps.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 7964ad32831f..3e4a7c41a2c3 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -11,7 +11,7 @@ def _fn_name(): return sys._getframe(1).f_code.co_name except ImportError: from md5 import md5 #Deprecated in 2.5 -from tempfile import gettempdir +from tempfile import mkstemp from cStringIO import StringIO from matplotlib import verbose, __version__, rcParams from matplotlib._pylab_helpers import Gcf @@ -911,15 +911,15 @@ def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w', """ isEPSF = format == 'eps' passed_in_file_object = False + fd, tmpfile = mkstemp() if is_string_like(outfile): title = outfile - tmpfile = os.path.join(gettempdir(), md5(outfile).hexdigest()) elif is_writable_file_like(outfile): title = None - tmpfile = os.path.join(gettempdir(), md5(str(hash(outfile))).hexdigest()) passed_in_file_object = True else: raise ValueError("outfile must be a path or a file-like object") + os.close(fd) fh = file(tmpfile, 'w') # find the appropriate papertype @@ -1054,7 +1054,8 @@ def _print_figure_tex(self, outfile, format, dpi, facecolor, edgecolor, title = outfile # write to a temp file, we'll move it to outfile when done - tmpfile = os.path.join(gettempdir(), md5(outfile).hexdigest()) + fd, tmpfile = mkstemp() + os.close(fd) fh = file(tmpfile, 'w') self.figure.dpi = 72 # ignore the dpi kwarg From a69d5b90ecadb7e6cbb26b04ed865660328058d3 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 19 Mar 2009 12:52:46 +0000 Subject: [PATCH 152/324] Fix wavy baseline with STIX fonts -- again. svn path=/branches/v0_98_5_maint/; revision=6995 --- lib/matplotlib/mathtext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index a3ca8171681a..a408c989f844 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -201,7 +201,7 @@ def set_canvas_size(self, w, h, d): def render_glyph(self, ox, oy, info): info.font.draw_glyph_to_bitmap( - self.image, ox, oy - info.metrics.ymax, info.glyph) + self.image, ox, oy - info.metrics.iceberg, info.glyph) def render_rect_filled(self, x1, y1, x2, y2): height = max(int(y2 - y1) - 1, 0) From c551a41e56aa27e42e5fa4cd6e301994ba32a6f1 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 19 Mar 2009 13:15:00 +0000 Subject: [PATCH 153/324] Fix bug in Cairo backend related to clipping -- thanks Nathaniel Smith svn path=/branches/v0_98_5_maint/; revision=6997 --- lib/matplotlib/backends/backend_cairo.py | 52 +++++++++++++----------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index 0b282d4cee46..6d389a52b007 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -109,6 +109,23 @@ def set_width_height(self, width, height): # font transform? + def _do_clip(self, ctx, cliprect, clippath): + if cliprect is not None: + x,y,w,h = cliprect.bounds + # pixel-aligned clip-regions are faster + x,y,w,h = round(x), round(y), round(w), round(h) + ctx.new_path() + ctx.rectangle (x, self.height - h - y, w, h) + ctx.clip () + + if clippath is not None: + tpath, affine = clippath.get_transformed_path_and_affine() + ctx.new_path() + affine = affine + Affine2D().scale(1.0, -1.0).translate(0.0, self.height) + tpath = affine.transform_path(tpath) + RendererCairo.convert_path(ctx, tpath) + ctx.clip() + def _fill_and_stroke (self, ctx, fill_c, alpha): if fill_c is not None: ctx.save() @@ -120,7 +137,6 @@ def _fill_and_stroke (self, ctx, fill_c, alpha): ctx.restore() ctx.stroke() - #@staticmethod def convert_path(ctx, tpath): for points, code in tpath.iter_segments(): @@ -144,6 +160,9 @@ def draw_path(self, gc, path, transform, rgbFace=None): raise ValueError("The Cairo backend can not draw paths longer than 18980 points.") ctx = gc.ctx + ctx.save() + self._do_clip(ctx, gc._cliprect, gc._clippath) + transform = transform + \ Affine2D().scale(1.0, -1.0).translate(0, self.height) tpath = transform.transform_path(path) @@ -152,6 +171,7 @@ def draw_path(self, gc, path, transform, rgbFace=None): self.convert_path(ctx, tpath) self._fill_and_stroke(ctx, rgbFace, gc.get_alpha()) + ctx.restore() def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): # bbox - not currently used @@ -164,9 +184,16 @@ def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): buf, cairo.FORMAT_ARGB32, cols, rows, cols*4) # function does not pass a 'gc' so use renderer.ctx ctx = self.ctx + ctx.save() + if clippath is not None: + tpath = clippath_trans.transform_path(clippath) + ctx.new_path() + RendererCairo.convert_path(ctx, tpath) + ctx.clip() y = self.height - y - rows ctx.set_source_surface (surface, x, y) ctx.paint() + ctx.restore() im.flipud_out() @@ -324,30 +351,9 @@ def set_capstyle(self, cs): def set_clip_rectangle(self, rectangle): self._cliprect = rectangle - if rectangle is None: - return - - x,y,w,h = rectangle.bounds - # pixel-aligned clip-regions are faster - x,y,w,h = round(x), round(y), round(w), round(h) - ctx = self.ctx - ctx.new_path() - ctx.rectangle (x, self.renderer.height - h - y, w, h) - ctx.clip () - # Alternative: just set _cliprect here and actually set cairo clip rect - # in fill_and_stroke() inside ctx.save() ... ctx.restore() - def set_clip_path(self, path): - if path is not None: - tpath, affine = path.get_transformed_path_and_affine() - ctx = self.ctx - ctx.new_path() - affine = affine + Affine2D().scale(1.0, -1.0).translate(0.0, self.renderer.height) - tpath = affine.transform_path(tpath) - RendererCairo.convert_path(ctx, tpath) - ctx.clip() - + self._clippath = path def set_dashes(self, offset, dashes): self._dashes = offset, dashes From ae80997348c850bc1257b7fad7666db212bdda9a Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 23 Mar 2009 18:52:29 +0000 Subject: [PATCH 154/324] Fix typo. Thanks to Sandro Tosi. svn path=/branches/v0_98_5_maint/; revision=7001 --- doc/users/screenshots.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index 8dd500321212..c17c38ecc366 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -82,7 +82,7 @@ Pie charts ========== The :func:`~matplotlib.pyplot.pie` command -uses a matlab(TM) compatible syntax to produce py charts. Optional +uses a matlab(TM) compatible syntax to produce pie charts. Optional features include auto-labeling the percentage of area, exploding one or more wedges out from the center of the pie, and a shadow effect. Take a close look at the attached code that produced this figure; nine @@ -268,6 +268,3 @@ matplotlib in a wx application, see :ref:`user_interfaces-mpl_with_glade`. .. image:: ../_static/eeg_small.png - - - From 6e317270e1cfc0ffbcad823e0e0ad1a4faf7695a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 31 Mar 2009 14:50:12 +0000 Subject: [PATCH 155/324] Remove some global caches in order to remove a theoretical threading problem. svn path=/branches/v0_98_5_maint/; revision=7014 --- lib/matplotlib/mathtext.py | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index a408c989f844..5a49c01a29d6 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -652,17 +652,16 @@ class BakomaFonts(TruetypeFonts): 'sf' : 'cmss10', 'ex' : 'cmex10' } - fontmap = {} def __init__(self, *args, **kwargs): self._stix_fallback = StixFonts(*args, **kwargs) TruetypeFonts.__init__(self, *args, **kwargs) - if not len(self.fontmap): - for key, val in self._fontmap.iteritems(): - fullpath = findfont(val) - self.fontmap[key] = fullpath - self.fontmap[val] = fullpath + self.fontmap = {} + for key, val in self._fontmap.iteritems(): + fullpath = findfont(val) + self.fontmap[key] = fullpath + self.fontmap[val] = fullpath _slanted_symbols = set(r"\int \oint".split()) @@ -764,7 +763,6 @@ class UnicodeFonts(TruetypeFonts): This class will "fallback" on the Bakoma fonts when a required symbol can not be found in the font. """ - fontmap = {} use_cmex = True def __init__(self, *args, **kwargs): @@ -774,14 +772,14 @@ def __init__(self, *args, **kwargs): else: self.cm_fallback = None TruetypeFonts.__init__(self, *args, **kwargs) - if not len(self.fontmap): - for texfont in "cal rm tt it bf sf".split(): - prop = rcParams['mathtext.' + texfont] - font = findfont(prop) - self.fontmap[texfont] = font - prop = FontProperties('cmex10') + self.fontmap = {} + for texfont in "cal rm tt it bf sf".split(): + prop = rcParams['mathtext.' + texfont] font = findfont(prop) - self.fontmap['ex'] = font + self.fontmap[texfont] = font + prop = FontProperties('cmex10') + font = findfont(prop) + self.fontmap['ex'] = font _slanted_symbols = set(r"\int \oint".split()) @@ -890,18 +888,17 @@ class StixFonts(UnicodeFonts): 4 : 'STIXSize4', 5 : 'STIXSize5' } - fontmap = {} use_cmex = False cm_fallback = False _sans = False def __init__(self, *args, **kwargs): TruetypeFonts.__init__(self, *args, **kwargs) - if not len(self.fontmap): - for key, name in self._fontmap.iteritems(): - fullpath = findfont(name) - self.fontmap[key] = fullpath - self.fontmap[name] = fullpath + self.fontmap = {} + for key, name in self._fontmap.iteritems(): + fullpath = findfont(name) + self.fontmap[key] = fullpath + self.fontmap[name] = fullpath def _map_virtual_font(self, fontname, font_class, uniindex): # Handle these "fonts" that are actually embedded in From 3b3bd8607551247dc1541b6b89175151324cf78e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 31 Mar 2009 15:22:06 +0000 Subject: [PATCH 156/324] Fix bug when specifying both scale and label in the axes constructor. Change to use new numpy putmask API. svn path=/branches/v0_98_5_maint/; revision=7016 --- lib/matplotlib/axes.py | 7 +++++++ lib/matplotlib/transforms.py | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 17d19b366678..2b55de3392ae 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -439,6 +439,8 @@ def __init__(self, fig, rect, sharex=None, # use Axes instance's xaxis info sharey=None, # use Axes instance's yaxis info label='', + xscale=None, + yscale=None, **kwargs ): """ @@ -543,6 +545,11 @@ def __init__(self, fig, rect, self.set_navigate(True) self.set_navigate_mode(None) + if xscale: + self.set_xscale(xscale) + if yscale: + self.set_yscale(yscale) + if len(kwargs): martist.setp(self, **kwargs) if self.xaxis is not None: diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index 82c5c2b15148..d059ea70f61f 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -975,8 +975,7 @@ def get_points(self): if self._invalid: points = self._transform.transform(self._bbox.get_points()) if ma.isMaskedArray(points): - points.putmask(0.0) - points = np.asarray(points) + np.putmask(points, points.mask, 0.0) self._points = points self._invalid = 0 return self._points From 5916eec0781e05c48a93672f01d168b41e7c3d95 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 31 Mar 2009 17:47:27 +0000 Subject: [PATCH 157/324] Fix putmask update -- use np.ma.filled instead. svn path=/branches/v0_98_5_maint/; revision=7018 --- lib/matplotlib/transforms.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index d059ea70f61f..9c9b303ea9a4 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -974,8 +974,7 @@ def __repr__(self): def get_points(self): if self._invalid: points = self._transform.transform(self._bbox.get_points()) - if ma.isMaskedArray(points): - np.putmask(points, points.mask, 0.0) + points = np.ma.filled(points, 0.0) self._points = points self._invalid = 0 return self._points From eabbb36d29b61160c53cfa777ceab25e2f4329fb Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sun, 5 Apr 2009 01:37:26 +0000 Subject: [PATCH 158/324] Fix PatchCollection bug 2723527; thanks to Thomas Robitaille svn path=/branches/v0_98_5_maint/; revision=7024 --- lib/matplotlib/collections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index af1eb2a29671..db65b8d07ca7 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -1108,7 +1108,7 @@ def determine_facecolor(patch): facecolors = [determine_facecolor(p) for p in patches] edgecolors = [p.get_edgecolor() for p in patches] - linewidths = [p.get_linewidths() for p in patches] + linewidths = [p.get_linewidth() for p in patches] antialiaseds = [p.get_antialiased() for p in patches] Collection.__init__( From 244812e5c51b19e25da9ecb49f46e7910a84cd9a Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sun, 5 Apr 2009 02:16:44 +0000 Subject: [PATCH 159/324] Fix PatchCollection bug 2732455 by letting to_rgba handle 'none' svn path=/branches/v0_98_5_maint/; revision=7025 --- lib/matplotlib/colors.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index fa0475ddad95..9f1766fb9d82 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -318,9 +318,17 @@ def to_rgba(self, arg, alpha=None): Returns an *RGBA* tuple of four floats from 0-1. For acceptable values of *arg*, see :meth:`to_rgb`. + In addition, if *arg* is "none" (case-insensitive), + then (0,0,0,0) will be returned. If *arg* is an *RGBA* sequence and *alpha* is not *None*, *alpha* will replace the original *A*. """ + try: + if arg.lower() == 'none': + return (0.0, 0.0, 0.0, 0.0) + except AttributeError: + pass + try: if not cbook.is_string_like(arg) and cbook.iterable(arg): if len(arg) == 4: From e2c86e479e727d2120be39443cdc4939e4f9dc6e Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sun, 5 Apr 2009 22:06:05 +0000 Subject: [PATCH 160/324] pngsuite test: plot images in grayscale if the input array is 2 dimensional svn path=/branches/v0_98_5_maint/; revision=7027 --- examples/tests/pngsuite/pngsuite.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/tests/pngsuite/pngsuite.py b/examples/tests/pngsuite/pngsuite.py index b29b71f3ff06..ca8d162bc265 100644 --- a/examples/tests/pngsuite/pngsuite.py +++ b/examples/tests/pngsuite/pngsuite.py @@ -8,6 +8,7 @@ """ from matplotlib import pyplot as plt +import matplotlib.cm as cm import glob files = glob.glob("basn*.png") @@ -17,7 +18,11 @@ for i, fname in enumerate(files): data = plt.imread(fname) - plt.imshow(data, extent=[i,i+1,0,1]) + cmap = None # use default colormap + if data.ndim==2: + # keep grayscale images gray + cmap = cm.gray + plt.imshow(data, extent=[i,i+1,0,1], cmap=cmap) plt.gca().get_frame().set_facecolor("#ddffff") plt.gca().set_xlim(0, len(files)) From bde58aa3be84d858f606dc9cb590747ea1ec8590 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sun, 5 Apr 2009 22:07:01 +0000 Subject: [PATCH 161/324] read 12 bit PNGs (patch from Tobias Wood) svn path=/branches/v0_98_5_maint/; revision=7028 --- src/_png.cpp | 94 +++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/src/_png.cpp b/src/_png.cpp index 69c2c8f01299..e82e3b49e8fc 100644 --- a/src/_png.cpp +++ b/src/_png.cpp @@ -208,38 +208,37 @@ _png_module::read_png(const Py::Tuple& args) { png_init_io(png_ptr, fp); png_set_sig_bytes(png_ptr, 8); - png_read_info(png_ptr, info_ptr); png_uint_32 width = info_ptr->width; png_uint_32 height = info_ptr->height; - bool do_gray_conversion = (info_ptr->bit_depth < 8 && - info_ptr->color_type == PNG_COLOR_TYPE_GRAY); int bit_depth = info_ptr->bit_depth; - if (bit_depth == 16) { - png_set_strip_16(png_ptr); - } else if (bit_depth < 8) { + + // Unpack 1, 2, and 4-bit images + if (bit_depth < 8) png_set_packing(png_ptr); - } - // convert misc color types to rgb for simplicity - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY || - info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - png_set_gray_to_rgb(png_ptr); - } else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { + // If sig bits are set, shift data + png_color_8p sig_bit; + if ((info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) && png_get_sBIT(png_ptr, info_ptr, &sig_bit)) + png_set_shift(png_ptr, sig_bit); + + // Convert big endian to little + if (bit_depth == 16) + png_set_swap(png_ptr); + + // Convert palletes to full RGB + if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr); - } + + // If there's an alpha channel convert gray to RGB + if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); png_set_interlace_handling(png_ptr); png_read_update_info(png_ptr, info_ptr); - bool rgba = info_ptr->color_type == PNG_COLOR_TYPE_RGBA; - if ( (info_ptr->color_type != PNG_COLOR_TYPE_RGB) && !rgba) { - std::cerr << "Found color type " << (int)info_ptr->color_type << std::endl; - throw Py::RuntimeError("_image_module::readpng: cannot handle color_type"); - } - /* read file */ if (setjmp(png_jmpbuf(png_ptr))) throw Py::RuntimeError("_image_module::readpng: error during read_image"); @@ -255,37 +254,36 @@ _png_module::read_png(const Py::Tuple& args) { npy_intp dimensions[3]; dimensions[0] = height; //numrows dimensions[1] = width; //numcols - dimensions[2] = 4; - - PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(3, dimensions, PyArray_FLOAT); - - if (do_gray_conversion) { - float max_value = (float)((1L << bit_depth) - 1); - for (png_uint_32 y = 0; y < height; y++) { - png_byte* row = row_pointers[y]; - for (png_uint_32 x = 0; x < width; x++) { - float value = row[x] / max_value; - size_t offset = y*A->strides[0] + x*A->strides[1]; - *(float*)(A->data + offset + 0*A->strides[2]) = value; - *(float*)(A->data + offset + 1*A->strides[2]) = value; - *(float*)(A->data + offset + 2*A->strides[2]) = value; - *(float*)(A->data + offset + 3*A->strides[2]) = 1.0f; - } - } - } else { - for (png_uint_32 y = 0; y < height; y++) { - png_byte* row = row_pointers[y]; - for (png_uint_32 x = 0; x < width; x++) { - png_byte* ptr = (rgba) ? &(row[x*4]) : &(row[x*3]); - size_t offset = y*A->strides[0] + x*A->strides[1]; - *(float*)(A->data + offset + 0*A->strides[2]) = (float)(ptr[0]/255.0); - *(float*)(A->data + offset + 1*A->strides[2]) = (float)(ptr[1]/255.0); - *(float*)(A->data + offset + 2*A->strides[2]) = (float)(ptr[2]/255.0); - *(float*)(A->data + offset + 3*A->strides[2]) = rgba ? (float)(ptr[3]/255.0) : 1.0f; - } + if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) + dimensions[2] = 4; //RGBA images + else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) + dimensions[2] = 3; //RGB images + else + dimensions[2] = 1; //Greyscale images + //For gray, return an x by y array, not an x by y by 1 + int num_dims = (info_ptr->color_type & PNG_COLOR_MASK_COLOR) ? 3 : 2; + + double max_value = (1 << ((bit_depth < 8) ? 8 : bit_depth)) - 1; + PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(num_dims, dimensions, PyArray_FLOAT); + + for (png_uint_32 y = 0; y < height; y++) { + png_byte* row = row_pointers[y]; + for (png_uint_32 x = 0; x < width; x++) { + size_t offset = y*A->strides[0] + x*A->strides[1]; + if (bit_depth == 16) { + png_uint_16* ptr = &reinterpret_cast (row)[x * dimensions[2]]; + for (png_uint_32 p = 0; p < dimensions[2]; p++) + *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value; + } else { + png_byte* ptr = &(row[x * dimensions[2]]); + for (png_uint_32 p = 0; p < dimensions[2]; p++) + { + *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value; + } + } } } - + //free the png memory png_read_end(png_ptr, info_ptr); png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); From bda0a8bea7282adb45945e79aa39c769be1b1738 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sun, 5 Apr 2009 22:07:34 +0000 Subject: [PATCH 162/324] trivial: remove trailing whitespace from source code svn path=/branches/v0_98_5_maint/; revision=7029 --- src/_png.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_png.cpp b/src/_png.cpp index e82e3b49e8fc..830dd3ef4013 100644 --- a/src/_png.cpp +++ b/src/_png.cpp @@ -214,7 +214,7 @@ _png_module::read_png(const Py::Tuple& args) { png_uint_32 height = info_ptr->height; int bit_depth = info_ptr->bit_depth; - + // Unpack 1, 2, and 4-bit images if (bit_depth < 8) png_set_packing(png_ptr); @@ -231,7 +231,7 @@ _png_module::read_png(const Py::Tuple& args) { // Convert palletes to full RGB if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr); - + // If there's an alpha channel convert gray to RGB if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb(png_ptr); @@ -262,7 +262,7 @@ _png_module::read_png(const Py::Tuple& args) { dimensions[2] = 1; //Greyscale images //For gray, return an x by y array, not an x by y by 1 int num_dims = (info_ptr->color_type & PNG_COLOR_MASK_COLOR) ? 3 : 2; - + double max_value = (1 << ((bit_depth < 8) ? 8 : bit_depth)) - 1; PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(num_dims, dimensions, PyArray_FLOAT); @@ -283,7 +283,7 @@ _png_module::read_png(const Py::Tuple& args) { } } } - + //free the png memory png_read_end(png_ptr, info_ptr); png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); From 3c8fe939918ce688090b4f47f7daf477392f6f5e Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sun, 5 Apr 2009 22:08:24 +0000 Subject: [PATCH 163/324] trivial: remove outdated comment svn path=/branches/v0_98_5_maint/; revision=7030 --- lib/matplotlib/image.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 86c480fec9a0..dda2cd65d4ab 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -720,8 +720,6 @@ def imread(fname): `_ is installed, it will use it to load the image and return an array (if possible) which can be used with :func:`~matplotlib.pyplot.imshow`. - - TODO: support RGB and grayscale return values in _image.readpng """ def pilread(): From 82880e686b3f675af42987fa2bfbe575b6c8000a Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sun, 5 Apr 2009 22:09:45 +0000 Subject: [PATCH 164/324] update changelog about Tobias' patch svn path=/branches/v0_98_5_maint/; revision=7031 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 804791815e1b..da71cbe47dc2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2009-04-05 _png.read_png() reads 12 bit PNGs (patch from + Tobias Wood) - ADS + 2009-03-17 Fix bugs in edge color handling by contourf, found by Jae-Joon Lee. - EF From 3a20ff9c91815274bc180dc1195fe6c7db543e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Mon, 6 Apr 2009 17:03:09 +0000 Subject: [PATCH 165/324] texmanager.make_dvi now raises an error if LaTeX failed to create an output file svn path=/branches/v0_98_5_maint/; revision=7033 --- CHANGELOG | 4 ++++ lib/matplotlib/texmanager.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index da71cbe47dc2..f8c4e495e8cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2009-04-06 texmanager.make_dvi now raises an error if LaTeX failed to + create an output file. Thanks to Joao Luis Silva for reporting + this. - JKS + 2009-04-05 _png.read_png() reads 12 bit PNGs (patch from Tobias Wood) - ADS diff --git a/lib/matplotlib/texmanager.py b/lib/matplotlib/texmanager.py index 8ae5470750c4..4b4933dd6ba0 100644 --- a/lib/matplotlib/texmanager.py +++ b/lib/matplotlib/texmanager.py @@ -285,7 +285,12 @@ def make_dvi(self, tex, fontsize): fh.close() except IOError: report = 'No latex error report available.' - if exit_status: + try: + os.stat(dvifile) + exists = True + except OSError: + exists = False + if exit_status or not exists: raise RuntimeError(('LaTeX was not able to process the following \ string:\n%s\nHere is the full report generated by LaTeX: \n\n'% repr(tex)) + report) else: mpl.verbose.report(report, 'debug') From 1ccd6d26cb177b1953535299958365c5279bebe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Mon, 6 Apr 2009 18:59:47 +0000 Subject: [PATCH 166/324] The pdf backend now escapes newlines and linefeeds in strings - fixes #2708559 svn path=/branches/v0_98_5_maint/; revision=7035 --- CHANGELOG | 3 +++ examples/pylab_examples/usetex_demo.py | 4 ++++ lib/matplotlib/backends/backend_pdf.py | 17 +++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f8c4e495e8cb..165a46162a01 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2009-04-06 The pdf backend now escapes newlines and linefeeds in strings. + Fixes sf bug #2708559; thanks to Tiago Pereira for the report. + 2009-04-06 texmanager.make_dvi now raises an error if LaTeX failed to create an output file. Thanks to Joao Luis Silva for reporting this. - JKS diff --git a/examples/pylab_examples/usetex_demo.py b/examples/pylab_examples/usetex_demo.py index dd68bc8f6e03..c348aa99bc89 100644 --- a/examples/pylab_examples/usetex_demo.py +++ b/examples/pylab_examples/usetex_demo.py @@ -56,4 +56,8 @@ ## phase field equations pylab.text(0.2, 0.15, r'$\mathcal{F} = \int f\left( \phi, c \right) dV,$ \newline $ \frac{ \partial \phi } { \partial t } = -M_{ \phi } \frac{ \delta \mathcal{F} } { \delta \phi }$', {'color' : 'b', 'fontsize' : 20}) +## these went wrong in pdf in a previous version +pylab.text(-.9,.42,r'gamma: $\gamma$', {'color': 'r', 'fontsize': 20}) +pylab.text(-.9,.36,r'Omega: $\Omega$', {'color': 'b', 'fontsize': 20}) + pylab.show() diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 12b70c2e1041..7f30771806c1 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -112,7 +112,20 @@ def fill(strings, linelen=75): result.append(' '.join(strings[lasti:])) return '\n'.join(result) -_string_escape_regex = re.compile(r'([\\()])') +# PDF strings are supposed to be able to include any eight-bit data, +# except that unbalanced parens and backslashes must be escaped by a +# backslash. However, sf bug #2708559 shows that the carriage return +# character may get read as a newline; these characters correspond to +# \gamma and \Omega in TeX's math font encoding. Escaping them fixes +# the bug. +_string_escape_regex = re.compile(r'([\\()\r\n])') +def _string_escape(match): + m = match.group(0) + if m in r'\()': return '\\' + m + elif m == '\n': return r'\n' + elif m == '\r': return r'\r' + assert False + def pdfRepr(obj): """Map Python objects to PDF syntax.""" @@ -138,7 +151,7 @@ def pdfRepr(obj): # simpler to escape them all. TODO: cut long strings into lines; # I believe there is some maximum line length in PDF. elif is_string_like(obj): - return '(' + _string_escape_regex.sub(r'\\\1', obj) + ')' + return '(' + _string_escape_regex.sub(_string_escape, obj) + ')' # Dictionaries. The keys must be PDF names, so if we find strings # there, we make Name objects from them. The values may be From 152c00389c421d4576bf8bddfac7654858d24e3d Mon Sep 17 00:00:00 2001 From: Charles Moad Date: Sat, 11 Apr 2009 02:24:37 +0000 Subject: [PATCH 167/324] added python 2.6 / tcltk 8.5 check svn path=/branches/v0_98_5_maint/; revision=7037 --- setupext.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setupext.py b/setupext.py index 69fe9159316b..4ae86b8c9476 100644 --- a/setupext.py +++ b/setupext.py @@ -958,11 +958,14 @@ def add_tk_flags(module): message = None if sys.platform == 'win32': major, minor1, minor2, s, tmp = sys.version_info - if major == 2 and minor1 in [3, 4, 5]: - module.include_dirs.extend(['win32_static/include/tcl8.4']) + if major == 2 and minor1 == 6: + module.include_dirs.extend(['win32_static/include/tcl85']) + module.libraries.extend(['tk85', 'tcl85']) + elif major == 2 and minor1 in [3, 4, 5]: + module.include_dirs.extend(['win32_static/include/tcl84']) module.libraries.extend(['tk84', 'tcl84']) elif major == 2 and minor1 == 2: - module.include_dirs.extend(['win32_static/include/tcl8.3']) + module.include_dirs.extend(['win32_static/include/tcl83']) module.libraries.extend(['tk83', 'tcl83']) else: raise RuntimeError('No tk/win32 support for this python version yet') From 10e4c5a6d1912122737aeb0cc5eec4afe9fc23e2 Mon Sep 17 00:00:00 2001 From: Charles Moad Date: Mon, 13 Apr 2009 02:22:30 +0000 Subject: [PATCH 168/324] minor rev bump svn path=/branches/v0_98_5_maint/; revision=7038 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 165a46162a01..000dc2340202 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +====================================================================== +2008-04-12 Release 0.98.5.3 at r7038 + 2009-04-06 The pdf backend now escapes newlines and linefeeds in strings. Fixes sf bug #2708559; thanks to Tiago Pereira for the report. From b740e5386f43f7ab080cfe96f0467557e68650b4 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 13 Apr 2009 02:56:11 +0000 Subject: [PATCH 169/324] fixed csv2rec bug referenced in sf bug 2745173 svn path=/branches/v0_98_5_maint/; revision=7039 --- doc/matplotlibrc | 1 - lib/matplotlib/mlab.py | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/matplotlibrc b/doc/matplotlibrc index 4a33ab7cddf3..f7088e15440e 100644 --- a/doc/matplotlibrc +++ b/doc/matplotlibrc @@ -27,7 +27,6 @@ # the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg # WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template backend : Agg -numerix : numpy # numpy, Numeric or numarray #maskedarray : False # True to use external maskedarray module # instead of numpy.ma; this is a temporary # setting for testing maskedarray. diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 2ac8ac82d9f7..e20a5d889235 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -2532,8 +2532,14 @@ def get_converters(reader): fh.seek(0) reader = csv.reader(fh, delimiter=delimiter) process_skiprows(reader) + if needheader: - skipheader = reader.next() + while 1: + # skip past any comments and consume one line of column header + row = reader.next() + if len(row) and row[0].startswith(comments): + continue + break # iterate over the remaining rows and convert the data to date # objects, ints, or floats as approriate From c484ac231dde77225b2a9ca4bbaf1d001836fb77 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 15 Apr 2009 17:47:18 +0000 Subject: [PATCH 170/324] fix for tkagg filextension bug reported by fperez svn path=/branches/v0_98_5_maint/; revision=7042 --- lib/matplotlib/backends/backend_tkagg.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_tkagg.py b/lib/matplotlib/backends/backend_tkagg.py index 91330fa90e4e..7e7bd8603a8f 100644 --- a/lib/matplotlib/backends/backend_tkagg.py +++ b/lib/matplotlib/backends/backend_tkagg.py @@ -708,11 +708,17 @@ def save_figure(self): tk_filetypes = [ (name, '*.%s' % ext) for (ext, name) in sorted_filetypes] + # adding a default extension seems to break the + # asksaveasfilename dialog when you choose various save types + # from the dropdown. Passing in the empty string seems to + # work - JDH + #defaultextension = self.canvas.get_default_filetype() + defaultextension = '' fname = asksaveasfilename( master=self.window, title='Save the figure', filetypes = tk_filetypes, - defaultextension = self.canvas.get_default_filetype() + defaultextension = defaultextension ) if fname == "" or fname == (): From 07ef0fff0550a82da9efff6c8717c523819bb084 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 19 Apr 2009 14:26:12 +0000 Subject: [PATCH 171/324] force a copy of the colormap input data svn path=/branches/v0_98_5_maint/; revision=7054 --- lib/matplotlib/colors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 9f1766fb9d82..1c53a6f75fac 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -483,7 +483,9 @@ def __call__(self, X, alpha=1.0, bytes=False): xa = np.array([X]) else: vtype = 'array' - xma = ma.asarray(X) + # force a copy here -- the ma.array and filled functions + # do force a cop of the data by default - JDH + xma = ma.array(X, copy=True) xa = xma.filled(0) mask_bad = ma.getmask(xma) if xa.dtype.char in np.typecodes['Float']: From 8baaa1665e032a9dba9f112f9e2e44f8acd15c46 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 30 Apr 2009 13:27:04 +0000 Subject: [PATCH 172/324] Fix solaris builds where "putchar" is a macro. svn path=/branches/v0_98_5_maint/; revision=7072 --- ttconv/pprdrv.h | 2 +- ttconv/pprdrv_tt.cpp | 20 ++++++++++---------- ttconv/pprdrv_tt2.cpp | 2 +- ttconv/ttutil.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ttconv/pprdrv.h b/ttconv/pprdrv.h index 2cefd923046b..d8a2049e4307 100644 --- a/ttconv/pprdrv.h +++ b/ttconv/pprdrv.h @@ -40,7 +40,7 @@ class TTStreamWriter { virtual void write(const char*) = 0; virtual void printf(const char* format, ...); - virtual void putchar(int val); + virtual void put_char(int val); virtual void puts(const char* a); virtual void putline(const char* a); }; diff --git a/ttconv/pprdrv_tt.cpp b/ttconv/pprdrv_tt.cpp index d7c3a8ed3166..ba86a91ad6df 100644 --- a/ttconv/pprdrv_tt.cpp +++ b/ttconv/pprdrv_tt.cpp @@ -482,20 +482,20 @@ void sfnts_pputBYTE(TTStreamWriter& stream, BYTE n) if(!in_string) { - stream.putchar('<'); + stream.put_char('<'); string_len=0; line_len++; in_string=TRUE; } - stream.putchar( hexdigits[ n / 16 ] ); - stream.putchar( hexdigits[ n % 16 ] ); + stream.put_char( hexdigits[ n / 16 ] ); + stream.put_char( hexdigits[ n % 16 ] ); string_len++; line_len+=2; if(line_len > 70) { - stream.putchar('\n'); + stream.put_char('\n'); line_len=0; } @@ -548,7 +548,7 @@ void sfnts_end_string(TTStreamWriter& stream) #endif sfnts_pputBYTE(stream, 0); /* extra byte for pre-2013 compatibility */ - stream.putchar('>'); + stream.put_char('>'); line_len++; } in_string=FALSE; @@ -955,7 +955,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) /* a BuildGlyph and BuildChar proceedures. */ if( font->target_type == PS_TYPE_3 ) { - stream.putchar('\n'); + stream.put_char('\n'); stream.putline("/BuildGlyph"); stream.putline(" {exch begin"); /* start font dictionary */ @@ -964,7 +964,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) stream.putline(" true 3 1 roll get exec"); stream.putline(" end}_d"); - stream.putchar('\n'); + stream.put_char('\n'); /* This proceedure is for compatiblity with */ /* level 1 interpreters. */ @@ -973,7 +973,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) stream.putline(" 1 index /BuildGlyph get exec"); stream.putline("}_d"); - stream.putchar('\n'); + stream.put_char('\n'); } /* If we are generating a type 42 font, we need to check to see */ @@ -985,7 +985,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) /* setup instructions and part of BuildGlyph came from. */ else if( font->target_type == PS_TYPE_42 ) { - stream.putchar('\n'); + stream.put_char('\n'); /* If we have no "resourcestatus" command, or FontType 42 */ /* is unknown, leave "true" on the stack. */ @@ -1066,7 +1066,7 @@ void ttfont_trailer(TTStreamWriter& stream, struct TTFONT *font) /* if the printer has no built-in TrueType */ /* rasterizer. */ stream.putline("}if"); - stream.putchar('\n'); + stream.put_char('\n'); } /* end of if Type 42 not understood. */ stream.putline("FontName currentdict end definefont pop"); diff --git a/ttconv/pprdrv_tt2.cpp b/ttconv/pprdrv_tt2.cpp index e7a93f9b82a9..13a8717a9a39 100644 --- a/ttconv/pprdrv_tt2.cpp +++ b/ttconv/pprdrv_tt2.cpp @@ -104,7 +104,7 @@ void GlyphToType3::stack(TTStreamWriter& stream, int new_elem) { /* have a log of points. */ if(stack_depth == 0) { - stream.putchar('{'); + stream.put_char('{'); stack_depth=1; } diff --git a/ttconv/ttutil.cpp b/ttconv/ttutil.cpp index 540d849fa072..e9976d5af0a5 100644 --- a/ttconv/ttutil.cpp +++ b/ttconv/ttutil.cpp @@ -52,7 +52,7 @@ void TTStreamWriter::printf(const char* format, ...) va_end(arg_list); } -void TTStreamWriter::putchar(int val) +void TTStreamWriter::put_char(int val) { char c[2]; c[0] = (char)val; From 25e88d355079dce99701649e0058e92ac7495efd Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 4 May 2009 19:05:38 +0000 Subject: [PATCH 173/324] [2723470] UnboundLocalError in ticker.py svn path=/branches/v0_98_5_maint/; revision=7080 --- lib/matplotlib/ticker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index a20bbcd7fa1d..7e670082599a 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -930,6 +930,8 @@ def bin_boundaries(self, vmin, vmax): vmax -= offset raw_step = (vmax-vmin)/nbins scaled_raw_step = raw_step/scale + best_vmax = vmax + best_vmin = vmin for step in self._steps: if step < scaled_raw_step: From aa72bc67b36f4b68482d3f166f48681ae7a96b56 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Mon, 4 May 2009 20:05:57 +0000 Subject: [PATCH 174/324] Fix bug that Text.Annotation is still drawn while set to not visible svn path=/branches/v0_98_5_maint/; revision=7082 --- CHANGELOG | 3 +++ lib/matplotlib/text.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 000dc2340202..4199b5b7bc82 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,7 @@ ====================================================================== +2009-05-04 Fix bug that Text.Annotation is still drawn while set to + not visible.-JJL + 2008-04-12 Release 0.98.5.3 at r7038 2009-04-06 The pdf backend now escapes newlines and linefeeds in strings. diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 3e961ca1763c..4a1b0137ad3e 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1602,6 +1602,11 @@ def draw(self, renderer): """ Draw the :class:`Annotation` object to the given *renderer*. """ + + if renderer is not None: + self._renderer = renderer + if not self.get_visible(): return + self.update_positions(renderer) self.update_bbox_position_size(renderer) From cdd56737890a9c4848cead86d1c992bbfcf69dec Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 17 May 2009 14:11:35 +0000 Subject: [PATCH 175/324] tagging changelog for release svn path=/branches/v0_98_5_maint/; revision=7106 --- CHANGELOG | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4199b5b7bc82..19e86bbad88e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,8 @@ ====================================================================== -2009-05-04 Fix bug that Text.Annotation is still drawn while set to - not visible.-JJL +2008-05-17 Release 0.98.5.3 at r7105 -2008-04-12 Release 0.98.5.3 at r7038 +2009-05-04 Fix bug that Text.Annotation is still drawn while set to + not visible.-JJL 2009-04-06 The pdf backend now escapes newlines and linefeeds in strings. Fixes sf bug #2708559; thanks to Tiago Pereira for the report. @@ -11,7 +11,7 @@ create an output file. Thanks to Joao Luis Silva for reporting this. - JKS -2009-04-05 _png.read_png() reads 12 bit PNGs (patch from +2009-04-05 _png.read_png() reads 12 bit PNGs (patch from Tobias Wood) - ADS 2009-03-17 Fix bugs in edge color handling by contourf, found From 71d51af7105a688c1036b6189f8ac2465812705d Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 17 May 2009 14:13:14 +0000 Subject: [PATCH 176/324] removed some deprecation warnings from mlab svn path=/branches/v0_98_5_maint/; revision=7107 --- lib/matplotlib/mlab.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index e20a5d889235..c7c8c09df8ed 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -272,11 +272,6 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none, pad_to = NFFT if scale_by_freq is None: - warnings.warn("psd, csd, and specgram have changed to scale their " - "densities by the sampling frequency for better MatLab " - "compatibility. You can pass scale_by_freq=False to disable " - "this behavior. Also, one-sided densities are scaled by a " - "factor of 2.") scale_by_freq = True # For real x, ignore the negative frequencies unless told otherwise @@ -1880,8 +1875,6 @@ def identity(n, rank=2, dtype='l', typecode=None): much faster. """ if typecode is not None: - warnings.warn("Use dtype kwarg instead of typecode", - DeprecationWarning) dtype = typecode iden = np.zeros((n,)*rank, dtype) for i in range(n): From 654417c6f4e36ae04bc95c38909c8686bdf3adb4 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 17 May 2009 14:22:31 +0000 Subject: [PATCH 177/324] tag changelog for release svn path=/branches/v0_98_5_maint/; revision=7108 --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 19e86bbad88e..029a62178e75 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,5 @@ ====================================================================== -2008-05-17 Release 0.98.5.3 at r7105 +2008-05-17 Release 0.98.5.3 at r7107 2009-05-04 Fix bug that Text.Annotation is still drawn while set to not visible.-JJL From 2a51f4ac0b6ded9df9ab641907e9d238bb47d1c9 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 17 May 2009 14:51:09 +0000 Subject: [PATCH 178/324] updated url in release doc svn path=/branches/v0_98_5_maint/; revision=7109 --- doc/devel/release_guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/devel/release_guide.rst b/doc/devel/release_guide.rst index 58f0b54aca7e..ee48310d10d5 100644 --- a/doc/devel/release_guide.rst +++ b/doc/devel/release_guide.rst @@ -75,7 +75,7 @@ Uploading sftp> put matplotlib-0.98.2.tar.gz Uploading matplotlib-0.98.2.tar.gz to /incoming/j/jd/jdh2358/uploads/matplotlib-0.98.2.tar.gz -* go https://sourceforge.net/project/admin/?group_id=80706 and do a +* go https://sourceforge.net/project/admin/editpackages.php?group_id=80706 and do a file release. Click on the "Admin" tab to log in as an admin, and then the "File Releases" tab. Go to the bottom and click "add release" and enter the package name but not the version number in From 6546a60685efd539043bf0d3bbbcd14cb093d728 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Sun, 17 May 2009 22:04:38 +0000 Subject: [PATCH 179/324] Fix bug(#2749174) that some properties of minor ticks are not conserved. svn path=/branches/v0_98_5_maint/; revision=7115 --- CHANGELOG | 3 +++ lib/matplotlib/axis.py | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 029a62178e75..b2973d66091a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2009-05-17 Fix bug(#2749174) that some properties of minor ticks are + not conserved -JJL + ====================================================================== 2008-05-17 Release 0.98.5.3 at r7107 diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 20526b6f6f09..82a7d1174f2d 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -1273,8 +1273,12 @@ def set_ticks_position(self, position): assert position in ('top', 'bottom', 'both', 'default', 'none') - ticks = list( self.get_major_ticks() ) # a copy - ticks.extend( self.get_minor_ticks() ) + # The first ticks of major & minor ticks should always be + # included, otherwise, the information can be lost. Thus, use + # majorTicks instead of get_major_ticks() which may return + # empty list. + ticks = list( self.majorTicks ) # a copy + ticks.extend( self.minorTicks ) if position == 'top': for t in ticks: @@ -1514,8 +1518,12 @@ def set_ticks_position(self, position): """ assert position in ('left', 'right', 'both', 'default', 'none') - ticks = list( self.get_major_ticks() ) # a copy - ticks.extend( self.get_minor_ticks() ) + # The first ticks of major & minor ticks should always be + # included, otherwise, the information can be lost. Thus, use + # majorTicks instead of get_major_ticks() which may return + # empty list. + ticks = list( self.majorTicks ) # a copy + ticks.extend( self.minorTicks ) if position == 'right': self.set_offset_position('right') From a79d8753e485b39af432f8751be0cea12abe19e6 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 3 Jun 2009 12:15:06 +0000 Subject: [PATCH 180/324] Bugfix in FltkAgg backend, thanks to Daniel svn path=/branches/v0_98_5_maint/; revision=7176 --- lib/matplotlib/backends/backend_fltkagg.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/backends/backend_fltkagg.py b/lib/matplotlib/backends/backend_fltkagg.py index 92fcd442d16f..f0c0fe8b89b7 100644 --- a/lib/matplotlib/backends/backend_fltkagg.py +++ b/lib/matplotlib/backends/backend_fltkagg.py @@ -115,6 +115,7 @@ def new_figure_manager(num, *args, **kwargs): window = Fltk.Fl_Double_Window(10,10,30,30) canvas = FigureCanvasFltkAgg(figure) window.end() + #Fltk.Fl.visual(Fltk.FL_DOUBLE) window.show() window.make_current() figManager = FigureManagerFltkAgg(canvas, num, window) @@ -157,7 +158,7 @@ def blit(self,bbox=None): def handle(self, event): x=Fltk.Fl.event_x() y=Fltk.Fl.event_y() - yf=self._source.figure.bbox.height() - y + yf=self._source.figure.bbox.height - y if event == Fltk.FL_FOCUS or event == Fltk.FL_UNFOCUS: return 1 elif event == Fltk.FL_KEYDOWN: @@ -230,7 +231,7 @@ def __init__(self, figure): def resize(self,size): w, h = size # compute desired figure size in inches - dpival = self.figure.dpi.get() + dpival = self.figure.dpi winch = w/dpival hinch = h/dpival self.figure.set_size_inches(winch,hinch) @@ -405,7 +406,7 @@ class NavigationToolbar: """ def __init__(self, canvas, figman): - #xmin, xmax = canvas.figure.bbox.intervalx().get_bounds() + #xmin, xmax = canvas.figure.bbox.intervalx #height, width = 50, xmax-xmin self.canvas = canvas self.figman = figman From e1ee001b84b8eb595ac2e3194ca9b7ad4f2efaa7 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 10 Jun 2009 17:39:22 +0000 Subject: [PATCH 181/324] remove gw32c from setupext svn path=/branches/v0_98_5_maint/; revision=7209 --- setupext.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setupext.py b/setupext.py index 4ae86b8c9476..7e6943b02442 100644 --- a/setupext.py +++ b/setupext.py @@ -549,8 +549,12 @@ def add_ft2font_flags(module): add_base_flags(module) module.libraries.append('z') - if sys.platform == 'win32' and win32_compiler == 'mingw32': - module.libraries.append('gw32c') + # JDH: this file does not appear to be shipped w/ mingw32. I saw + # some discussion on the web that libpng needs it -- could this be + # the problem we are having with libpng? + + #if sys.platform == 'win32' and win32_compiler == 'mingw32': + # module.libraries.append('gw32c') # put this last for library link order module.libraries.extend(std_libs) From d013280682750260691b1f0124baf7158f2d6e59 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 12 Jun 2009 13:39:59 +0000 Subject: [PATCH 182/324] Fix PDFs for use with ReportLab's pedantic parser svn path=/branches/v0_98_5_maint/; revision=7211 --- lib/matplotlib/backends/backend_pdf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 7f30771806c1..a63602aafbe7 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -1177,7 +1177,10 @@ def writeXref(self): 'No offset for object %d (%s)' % (i, name) borken = True else: - self.write("%010d %05d n \n" % (offset, generation)) + if name == 'the zero object': + self.write("%010d %05d f \n" % (offset, generation)) + else: + self.write("%010d %05d n \n" % (offset, generation)) i += 1 if borken: raise AssertionError, 'Indirect object does not exist' From 3a670b393a59313ce63e34449e447b88923146ed Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Fri, 19 Jun 2009 04:39:24 +0000 Subject: [PATCH 183/324] fix sf bug 2806283 (patch by Joonas Paalasmaa) svn path=/branches/v0_98_5_maint/; revision=7227 --- lib/matplotlib/colorbar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index 324c85123d40..a56441182b31 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -29,6 +29,7 @@ import matplotlib.patches as patches import matplotlib.collections as collections import matplotlib.contour as contour +import matplotlib.artist as martist make_axes_kw_doc = ''' @@ -625,9 +626,10 @@ def __init__(self, ax, mappable, **kw): self.mappable = mappable kw['cmap'] = mappable.cmap kw['norm'] = mappable.norm - kw['alpha'] = mappable.get_alpha() + if isinstance(mappable, contour.ContourSet): CS = mappable + kw['alpha'] = mappable.get_alpha() kw['boundaries'] = CS._levels kw['values'] = CS.cvalues kw['extend'] = CS.extend @@ -638,6 +640,9 @@ def __init__(self, ax, mappable, **kw): if not CS.filled: self.add_lines(CS) else: + if isinstance(mappable, martist.Artist): + kw['alpha'] = mappable.get_alpha() + ColorbarBase.__init__(self, ax, **kw) From 2bc67efdca4f1cd87d7de06bf953103e3d51bc39 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Sun, 21 Jun 2009 18:44:53 +0000 Subject: [PATCH 184/324] fixed axes.scatter bug that circular symbol style is ignored svn path=/branches/v0_98_5_maint/; revision=7229 --- lib/matplotlib/axes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 2b55de3392ae..cc5b591f35fa 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -5018,7 +5018,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None, syms = { # a dict from symbol to (numsides, angle) 's' : (4,math.pi/4.0,0), # square - 'o' : (20,3,0), # circle + 'o' : (0,0,3), # circle '^' : (3,0,0), # triangle up '>' : (3,math.pi/2.0,0), # triangle right 'v' : (3,math.pi,0), # triangle down @@ -5095,7 +5095,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None, numsides, rotation = marker[0], marker[2] sym = True - if marker[1] in (1,2): + if marker[1] in (1,2,3): symstyle = marker[1] else: From f830e37891aa16657d0b330a68c3feafec256a00 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 1 Jul 2009 19:55:17 +0000 Subject: [PATCH 185/324] Fix out-of-memory errors leading to segfaults svn path=/branches/v0_98_5_maint/; revision=7245 --- src/_path.cpp | 6 ++++++ src/_png.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/_path.cpp b/src/_path.cpp index adfd941aa07d..dffe1275aff0 100644 --- a/src/_path.cpp +++ b/src/_path.cpp @@ -882,6 +882,9 @@ Py::Object _path_module::clip_path_to_rect(const Py::Tuple &args) size_t size = p->size(); dims[0] = p->size(); PyArrayObject* pyarray = (PyArrayObject*)PyArray_SimpleNew(2, dims, PyArray_DOUBLE); + if (pyarray == NULL) { + throw Py::MemoryError("Could not allocate result array"); + } for (size_t i = 0; i < size; ++i) { ((double *)pyarray->data)[2*i] = (*p)[i].x; @@ -951,6 +954,9 @@ Py::Object _path_module::affine_transform(const Py::Tuple& args) result = (PyArrayObject*)PyArray_SimpleNew (PyArray_NDIM(vertices), PyArray_DIMS(vertices), PyArray_DOUBLE); + if (result == NULL) { + throw Py::MemoryError("Could not allocate memory for path"); + } if (PyArray_NDIM(vertices) == 2) { size_t n = PyArray_DIM(vertices, 0); diff --git a/src/_png.cpp b/src/_png.cpp index 830dd3ef4013..12930c07b8f6 100644 --- a/src/_png.cpp +++ b/src/_png.cpp @@ -266,6 +266,10 @@ _png_module::read_png(const Py::Tuple& args) { double max_value = (1 << ((bit_depth < 8) ? 8 : bit_depth)) - 1; PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(num_dims, dimensions, PyArray_FLOAT); + if (A == NULL) { + throw Py::MemoryError("Could not allocate image array"); + } + for (png_uint_32 y = 0; y < height; y++) { png_byte* row = row_pointers[y]; for (png_uint_32 x = 0; x < width; x++) { From fac7ef9b8f2d24b3c49e7ebe99dd6c5ed346fbe8 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sat, 11 Jul 2009 12:39:29 +0000 Subject: [PATCH 186/324] applied osx setpext patch from sf #2818964 svn path=/branches/v0_98_5_maint/; revision=7253 --- setupext.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setupext.py b/setupext.py index 7e6943b02442..c4cf46ff44cb 100644 --- a/setupext.py +++ b/setupext.py @@ -140,6 +140,9 @@ try: options['build_wxagg'] = config.getboolean("gui_support", "wxagg") except: options['build_wxagg'] = 'auto' + try: options['build_macosx'] = config.getboolean("gui_support", "macosx") + except: options['build_macosx'] = 'auto' + try: options['backend'] = config.get("rc_options", "backend") except: pass From 8e977f9a217102ccf995f41ef8289fd5341115c2 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 30 Aug 2009 03:40:08 +0000 Subject: [PATCH 187/324] added minor kwarg to get_?ticklines and applied ginpu patch svn path=/branches/v0_99_maint/; revision=7589 --- doc/users/license.rst | 2 +- lib/matplotlib/blocking_input.py | 98 +++++++++++++++++++++++--------- lib/matplotlib/figure.py | 9 ++- 3 files changed, 79 insertions(+), 30 deletions(-) diff --git a/doc/users/license.rst b/doc/users/license.rst index 29a2587d4439..c57ad98bf624 100644 --- a/doc/users/license.rst +++ b/doc/users/license.rst @@ -28,7 +28,7 @@ to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib |version| alone or in any derivative version, provided, however, that JDH's License Agreement and JDH's notice of copyright, i.e., "Copyright (c) -2002-2008 John D. Hunter; All Rights Reserved" are retained in +2002-2009 John D. Hunter; All Rights Reserved" are retained in matplotlib |version| alone or in any derivative version prepared by Licensee. diff --git a/lib/matplotlib/blocking_input.py b/lib/matplotlib/blocking_input.py index 81009674b73e..1d49772fce8d 100644 --- a/lib/matplotlib/blocking_input.py +++ b/lib/matplotlib/blocking_input.py @@ -114,14 +114,24 @@ class BlockingMouseInput(BlockingInput): Class that creates a callable object to retrieve mouse clicks in a blocking way. - This class will also retrieve keyboard clicks and treat them like + This class will also retrieve keyboard clicks and treat them like appropriate mouse clicks (delete and backspace are like mouse button 3, enter is like mouse button 2 and all others are like mouse button 1). """ - def __init__(self, fig): + + button_add = 1 + button_pop = 3 + button_stop = 2 + + def __init__(self, fig, mouse_add=1, mouse_pop=3, mouse_stop=2): BlockingInput.__init__(self, fig=fig, eventslist=('button_press_event', 'key_press_event') ) + self.button_add = mouse_add + self.button_pop = mouse_pop + self.button_stop= mouse_stop + + def post_event(self): """ @@ -133,19 +143,19 @@ def post_event(self): self.key_event() else: self.mouse_event() - + def mouse_event(self): '''Process a mouse click event''' event = self.events[-1] button = event.button - if button == 3: - self.button3(event) - elif button == 2: - self.button2(event) + if button == self.button_pop: + self.mouse_event_pop(event,-1) + elif button == self.button_stop: + self.mouse_event_stop(event) else: - self.button1(event) + self.mouse_event_add(event) def key_event(self): ''' @@ -154,16 +164,16 @@ def key_event(self): ''' event = self.events[-1] - key = event.key + key = event.key.lower() - if key == 'backspace' or key == 'delete': - self.button3(event) - elif key == 'enter': - self.button2(event) + if key in ['backspace', 'delete']: + self.mouse_event_pop(event) + elif key in ['escape', 'enter']: # on windows XP and wxAgg, the enter key doesn't seem to register + self.mouse_event_stop(event) else: - self.button1(event) + self.mouse_event_add(event) - def button1( self, event ): + def mouse_event_add( self, event ): """ Will be called for any event involving a button other than button 2 or 3. This will add a click if it is inside axes. @@ -171,34 +181,34 @@ def button1( self, event ): if event.inaxes: self.add_click(event) else: # If not a valid click, remove from event list - BlockingInput.pop(self) + BlockingInput.pop(self,-1) - def button2( self, event ): + def mouse_event_stop( self, event ): """ Will be called for any event involving button 2. Button 2 ends blocking input. """ # Remove last event just for cleanliness - BlockingInput.pop(self) + BlockingInput.pop(self,-1) # This will exit even if not in infinite mode. This is # consistent with matlab and sometimes quite useful, but will # require the user to test how many points were actually # returned before using data. - self.fig.canvas.stop_event_loop() + self.fig.canvas.stop_event_loop(event) - def button3( self, event ): + def mouse_event_pop( self, event ): """ Will be called for any event involving button 3. Button 3 removes the last click. """ # Remove this last event - BlockingInput.pop(self) + BlockingInput.pop(self,-1) # Now remove any existing clicks if possible if len(self.events)>0: - self.pop() + self.pop(event,-1) def add_click(self,event): """ @@ -211,11 +221,23 @@ def add_click(self,event): # If desired plot up click if self.show_clicks: + + # make sure we don't mess with the axes zoom + xlim = event.inaxes.get_xlim() + ylim = event.inaxes.get_ylim() + + # plot the clicks self.marks.extend( event.inaxes.plot([event.xdata,], [event.ydata,], 'r+') ) + + # before we draw, make sure to reset the limits + event.inaxes.set_xlim(xlim) + event.inaxes.set_ylim(ylim) self.fig.canvas.draw() - def pop_click(self,index=-1): + + + def pop_click(self,event,index=-1): """ This removes a click from the list of clicks. Defaults to removing the last click. @@ -223,25 +245,49 @@ def pop_click(self,index=-1): self.clicks.pop(index) if self.show_clicks: + + # make sure we don't mess with the axes zoom + xlim = event.inaxes.get_xlim() + ylim = event.inaxes.get_ylim() + mark = self.marks.pop(index) mark.remove() + + # before we draw, make sure to reset the limits + event.inaxes.set_xlim(xlim) + event.inaxes.set_ylim(ylim) self.fig.canvas.draw() + # NOTE: I do NOT understand why the above 3 lines does not work + # for the keyboard backspace event on windows XP wxAgg. + # maybe event.inaxes here is a COPY of the actual axes? - def pop(self,index=-1): + + def pop(self,event,index=-1): """ This removes a click and the associated event from the object. Defaults to removing the last click, but any index can be supplied. """ - self.pop_click(index) + self.pop_click(event,index) BlockingInput.pop(self,index) - def cleanup(self): + def cleanup(self,event=None): # clean the figure if self.show_clicks: + if event: + # make sure we don't mess with the axes zoom + xlim = event.inaxes.get_xlim() + ylim = event.inaxes.get_ylim() + for mark in self.marks: mark.remove() self.marks = [] + + if event: + # before we draw, make sure to reset the limits + event.inaxes.set_xlim(xlim) + event.inaxes.set_ylim(ylim) + self.fig.canvas.draw() # Call base class to remove callbacks diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 46f21bc3e6e2..1f72804bb2bc 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1086,11 +1086,12 @@ def subplots_adjust(self, *args, **kwargs): ax.update_params() ax.set_position(ax.figbox) - def ginput(self, n=1, timeout=30, show_clicks=True): + def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1, mouse_pop=3, mouse_stop=2): """ call signature:: - ginput(self, n=1, timeout=30, show_clicks=True) + ginput(self, n=1, timeout=30, show_clicks=True, + mouse_add=1, mouse_pop=3, mouse_stop=2) Blocking call to interact with the figure. @@ -1111,7 +1112,9 @@ def ginput(self, n=1, timeout=30, show_clicks=True): manager) selects a point. """ - blocking_mouse_input = BlockingMouseInput(self) + blocking_mouse_input = BlockingMouseInput(self, mouse_add =mouse_add, + mouse_pop =mouse_pop, + mouse_stop=mouse_stop) return blocking_mouse_input(n=n, timeout=timeout, show_clicks=show_clicks) From 0f125a7773e48ca655daecbc1009a92e76ffb461 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 30 Aug 2009 13:35:12 +0000 Subject: [PATCH 188/324] applied Gael's ginput patch svn path=/branches/v0_99_maint/; revision=7598 --- lib/matplotlib/blocking_input.py | 7 ++----- lib/matplotlib/figure.py | 7 ++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/blocking_input.py b/lib/matplotlib/blocking_input.py index 1d49772fce8d..09ed6d9afbfc 100644 --- a/lib/matplotlib/blocking_input.py +++ b/lib/matplotlib/blocking_input.py @@ -17,9 +17,6 @@ Note: Subclass of BlockingMouseInput. Used by clabel """ -import time -import numpy as np - from matplotlib import path, verbose from matplotlib.cbook import is_sequence_of_strings @@ -151,7 +148,7 @@ def mouse_event(self): button = event.button if button == self.button_pop: - self.mouse_event_pop(event,-1) + self.mouse_event_pop(event) elif button == self.button_stop: self.mouse_event_stop(event) else: @@ -162,7 +159,7 @@ def key_event(self): Process a key click event. This maps certain keys to appropriate mouse click events. ''' - + event = self.events[-1] key = event.key.lower() diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 1f72804bb2bc..11f77733d154 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -12,7 +12,6 @@ """ import numpy as np -import time import artist from artist import Artist, allow_rasterization @@ -1105,6 +1104,12 @@ def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1, mouse_pop=3, mo Right clicking cancels last input. + The buttons used for the various actions (adding points, removing + points, terminating the inputs) can be overriden via the + arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give + the associated mouse button: 1 for left, 2 for middle, 3 for + right. + The keyboard can also be used to select points in case your mouse does not have one or more of the buttons. The delete and backspace keys act like right clicking (i.e., remove last point), the enter key From 7d4f37a1a9841174d68354c74d39be7448f9bc9f Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 30 Aug 2009 16:22:38 +0000 Subject: [PATCH 189/324] some unit cleanup; fix sf bug 2846058 svn path=/branches/v0_99_maint/; revision=7600 --- examples/units/annotate_with_units.py | 7 +++---- examples/units/bar_demo2.py | 4 ++-- examples/units/radian_demo.py | 6 +++--- lib/matplotlib/axes.py | 26 ++++++++++++++++++++++---- lib/matplotlib/collections.py | 2 ++ 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/examples/units/annotate_with_units.py b/examples/units/annotate_with_units.py index d73a1ae51e01..deb06f378295 100644 --- a/examples/units/annotate_with_units.py +++ b/examples/units/annotate_with_units.py @@ -1,8 +1,7 @@ - -import pylab +import matplotlib.pyplot as plt from basic_units import cm -fig = pylab.figure() +fig = plt.figure() ax = fig.add_subplot(111) @@ -23,5 +22,5 @@ ax.set_xlim(0*cm, 4*cm) ax.set_ylim(0*cm, 4*cm) -pylab.show() +plt.show() diff --git a/examples/units/bar_demo2.py b/examples/units/bar_demo2.py index 7f1bcaa59107..7c00757d8df1 100644 --- a/examples/units/bar_demo2.py +++ b/examples/units/bar_demo2.py @@ -25,11 +25,11 @@ ax3 = fig.add_subplot(2,2,3) ax3.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=cm) -ax3.set_xlim(3, 6) # scalars are interpreted in current units +ax3.set_xlim(2, 6) # scalars are interpreted in current units ax4 = fig.add_subplot(2,2,4) ax4.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=inch) #fig.savefig('simple_conversion_plot.png') -ax4.set_xlim(3*cm, 6*cm) # cm are converted to inches +ax4.set_xlim(2*cm, 6*cm) # cm are converted to inches show() diff --git a/examples/units/radian_demo.py b/examples/units/radian_demo.py index 64a64e44c4de..3eeca931e75d 100644 --- a/examples/units/radian_demo.py +++ b/examples/units/radian_demo.py @@ -7,15 +7,15 @@ from basic_units import radians, degrees, cos from matplotlib.pyplot import figure, show -x = np.arange(0, 15, 0.01) * radians +x = [val*radians for val in np.arange(0, 15, 0.01)] fig = figure() fig.subplots_adjust(hspace=0.3) ax = fig.add_subplot(211) -ax.plot(x, cos(x), xunits=radians) +line1, = ax.plot(x, cos(x), xunits=radians) ax = fig.add_subplot(212) -ax.plot(x, cos(x), xunits=degrees) +line2, = ax.plot(x, cos(x), xunits=degrees) show() diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index e948c90957af..95926c65fe45 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -203,10 +203,24 @@ def _xy_from_xy(self, x, y): if self.axes.xaxis is not None and self.axes.yaxis is not None: bx = self.axes.xaxis.update_units(x) by = self.axes.yaxis.update_units(y) - if bx: - x = self.axes.convert_xunits(x) - if by: - y = self.axes.convert_yunits(y) + + if self.command!='plot': + # the Line2D class can handle unitized data, with + # support for post hoc unit changes etc. Other mpl + # artists, eg Polygon which _process_plot_var_args + # also serves on calls to fill, cannot. So this is a + # hack to say: if you are not "plot", which is + # creating Line2D, then convert the data now to + # floats. If you are plot, pass the raw data through + # to Line2D which will handle the conversion. So + # polygons will not support post hoc conversions of + # the unit type since they are not storing the orig + # data. Hopefully we can rationalize this at a later + # date - JDH + if bx: + x = self.axes.convert_xunits(x) + if by: + y = self.axes.convert_yunits(y) x = np.atleast_1d(x) #like asanyarray, but converts scalar to array y = np.atleast_1d(y) @@ -4255,10 +4269,14 @@ def make_iterable(x): if self.xaxis is not None: left = self.convert_xunits( left ) width = self.convert_xunits( width ) + if xerr is not None: + xerr = self.convert_xunits( xerr ) if self.yaxis is not None: bottom = self.convert_yunits( bottom ) height = self.convert_yunits( height ) + if yerr is not None: + yerr = self.convert_yunits( yerr ) if align == 'edge': pass diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index c813541d27e0..bece2f5a24b3 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -931,7 +931,9 @@ def get_paths(self): def set_segments(self, segments): if segments is None: return _segments = [] + for seg in segments: + if not np.ma.isMaskedArray(seg): seg = np.asarray(seg, np.float_) _segments.append(seg) From 3df6dfaef2d2941429fbf1809968a34082bebdc2 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Mon, 31 Aug 2009 00:32:12 +0000 Subject: [PATCH 190/324] fix sf bug #2839919 svn path=/branches/v0_99_maint/; revision=7607 --- lib/matplotlib/legend.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index a50f7da7cfab..ac95d1f4b85e 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -587,8 +587,9 @@ def _init_legend_box(self, handles, labels): # We calculate number of lows in each column. The first # (num_largecol) columns will have (nrows+1) rows, and remaing # (num_smallcol) columns will have (nrows) rows. - nrows, num_largecol = divmod(len(handleboxes), self._ncol) - num_smallcol = self._ncol-num_largecol + ncol = min(self._ncol, len(handleboxes)) + nrows, num_largecol = divmod(len(handleboxes), ncol) + num_smallcol = ncol-num_largecol # starting index of each column and number of rows in it. largecol = safezip(range(0, num_largecol*(nrows+1), (nrows+1)), @@ -849,3 +850,4 @@ def _find_best_position(self, width, height, renderer, consider=None): return ox, oy + From 5051ae7268d3071e099657abd70355081cb35b91 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 31 Aug 2009 17:27:12 +0000 Subject: [PATCH 191/324] Update barb_demo.py with an example using masked arrays. svn path=/branches/v0_99_maint/; revision=7616 --- examples/pylab_examples/barb_demo.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/pylab_examples/barb_demo.py b/examples/pylab_examples/barb_demo.py index ecbdd95f7e2f..71e948fbdf9e 100644 --- a/examples/pylab_examples/barb_demo.py +++ b/examples/pylab_examples/barb_demo.py @@ -28,7 +28,7 @@ ax.barbs(data['x'], data['y'], data['u'], data['v'], length=8, pivot='middle') #Showing colormapping with uniform grid. Fill the circle for an empty barb, -#don't round the values, and change some of the size parameters +#don't round the values, and change some of the size parameters ax = plt.subplot(2,2,3) ax.barbs(X, Y, U, V, np.sqrt(U*U + V*V), fill_empty=True, rounding=False, sizes=dict(emptybarb=0.25, spacing=0.2, height=0.3)) @@ -39,4 +39,15 @@ barbcolor=['b','g'], barb_increments=dict(half=10, full=20, flag=100), flip_barb=True) +#Masked arrays are also supported +masked_u = np.ma.masked_array(data['u']) +masked_u[4] = 1000 #Bad value that should not be plotted when masked +masked_u[4] = np.ma.masked + +#Identical plot to panel 2 in the first figure, but with the point at +#(0.5, 0.25) missing (masked) +fig2 = plt.figure() +ax = fig2.add_subplot(1, 1, 1) +ax.barbs(data['x'], data['y'], masked_u, data['v'], length=8, pivot='middle') + plt.show() From f3dc262ca3bbbb0b324ecb4dc12ad646d9bc6c9e Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 31 Aug 2009 17:29:41 +0000 Subject: [PATCH 192/324] Pull _parse_args out of Quiver and Barbs classes, as we have multiple, diverging copies of the same code. Now the shared code will actually be shared. svn path=/branches/v0_99_maint/; revision=7617 --- lib/matplotlib/quiver.py | 69 +++++++++++++++------------------------- 1 file changed, 25 insertions(+), 44 deletions(-) diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index c68dd1475c5e..d7eaf9226e92 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -323,6 +323,29 @@ def contains(self, mouseevent): quiverkey_doc = _quiverkey_doc +# This is a helper function that parses out the various combination of +# arguments for doing colored vector plots. Pulling it out here +# allows both Quiver and Barbs to use it +def _parse_args(*args): + X, Y, U, V, C = [None]*5 + args = list(args) + if len(args) == 3 or len(args) == 5: + C = np.asanyarray(args.pop(-1)) + V = np.asanyarray(args.pop(-1)) + U = np.asanyarray(args.pop(-1)) + if U.ndim == 1: + nr, nc = 1, U.shape[0] + else: + nr, nc = U.shape + if len(args) == 2: # remaining after removing U,V,C + X, Y = [np.array(a).ravel() for a in args] + if len(X) == nc and len(Y) == nr: + X, Y = [a.ravel() for a in np.meshgrid(X, Y)] + else: + indexgrid = np.meshgrid(np.arange(nc), np.arange(nr)) + X, Y = [np.ravel(a) for a in indexgrid] + return X, Y, U, V, C + class Quiver(collections.PolyCollection): """ @@ -343,7 +366,7 @@ class Quiver(collections.PolyCollection): """ def __init__(self, ax, *args, **kw): self.ax = ax - X, Y, U, V, C = self._parse_args(*args) + X, Y, U, V, C = _parse_args(*args) self.X = X self.Y = Y self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis])) @@ -388,26 +411,6 @@ def on_dpi_change(fig): by the following pylab interface documentation: %s""" % _quiver_doc - def _parse_args(self, *args): - X, Y, U, V, C = [None]*5 - args = list(args) - if len(args) == 3 or len(args) == 5: - C = np.asanyarray(args.pop(-1)) - V = np.asanyarray(args.pop(-1)) - U = np.asanyarray(args.pop(-1)) - if U.ndim == 1: - nr, nc = 1, U.shape[0] - else: - nr, nc = U.shape - if len(args) == 2: # remaining after removing U,V,C - X, Y = [np.array(a).ravel() for a in args] - if len(X) == nc and len(Y) == nr: - X, Y = [a.ravel() for a in np.meshgrid(X, Y)] - else: - indexgrid = np.meshgrid(np.arange(nc), np.arange(nr)) - X, Y = [np.ravel(a) for a in indexgrid] - return X, Y, U, V, C - def _init(self): """initialization delayed until first draw; allow time for axes setup. @@ -752,7 +755,7 @@ def __init__(self, ax, *args, **kw): kw['facecolors'] = flagcolor #Parse out the data arrays from the various configurations supported - x, y, u, v, c = self._parse_args(*args) + x, y, u, v, c = _parse_args(*args) self.x = x self.y = y xy = np.hstack((x[:,np.newaxis], y[:,np.newaxis])) @@ -938,28 +941,6 @@ def _make_barbs(self, u, v, nflags, nbarbs, half_barb, empty_flag, length, return barb_list - #Taken shamelessly from Quiver - def _parse_args(self, *args): - X, Y, U, V, C = [None]*5 - args = list(args) - if len(args) == 3 or len(args) == 5: - C = ma.masked_invalid(args.pop(-1), copy=False).ravel() - V = ma.masked_invalid(args.pop(-1), copy=False) - U = ma.masked_invalid(args.pop(-1), copy=False) - nn = np.shape(U) - nc = nn[0] - nr = 1 - if len(nn) > 1: - nr = nn[1] - if len(args) == 2: # remaining after removing U,V,C - X, Y = [np.array(a).ravel() for a in args] - if len(X) == nc and len(Y) == nr: - X, Y = [a.ravel() for a in np.meshgrid(X, Y)] - else: - indexgrid = np.meshgrid(np.arange(nc), np.arange(nr)) - X, Y = [np.ravel(a) for a in indexgrid] - return X, Y, U, V, C - def set_UVC(self, U, V, C=None): self.u = ma.masked_invalid(U, copy=False).ravel() self.v = ma.masked_invalid(V, copy=False).ravel() From c5c1d655256b7a8405611833b4a53b216e365506 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 31 Aug 2009 17:34:50 +0000 Subject: [PATCH 193/324] Use atleast_1d instead of asanyarray. This allows passing in scalars to quiver/barbs. svn path=/branches/v0_99_maint/; revision=7618 --- lib/matplotlib/quiver.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index d7eaf9226e92..ba93d71e2886 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -323,16 +323,20 @@ def contains(self, mouseevent): quiverkey_doc = _quiverkey_doc + # This is a helper function that parses out the various combination of # arguments for doing colored vector plots. Pulling it out here # allows both Quiver and Barbs to use it def _parse_args(*args): X, Y, U, V, C = [None]*5 args = list(args) + + # The use of atleast_1d allows for handling scalar arguments while also + # keeping masked arrays if len(args) == 3 or len(args) == 5: - C = np.asanyarray(args.pop(-1)) - V = np.asanyarray(args.pop(-1)) - U = np.asanyarray(args.pop(-1)) + C = np.atleast_1d(args.pop(-1)) + V = np.atleast_1d(args.pop(-1)) + U = np.atleast_1d(args.pop(-1)) if U.ndim == 1: nr, nc = 1, U.shape[0] else: From 3e91b78a120a9109632c116c8346a3faa78f650f Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Fri, 4 Sep 2009 03:35:25 +0000 Subject: [PATCH 194/324] fix a bug in axes_grid.inset_locator.inset_axes svn path=/branches/v0_99_maint/; revision=7633 --- lib/mpl_toolkits/axes_grid/inset_locator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mpl_toolkits/axes_grid/inset_locator.py b/lib/mpl_toolkits/axes_grid/inset_locator.py index 386cb45be4bd..7fb4e41c78b0 100644 --- a/lib/mpl_toolkits/axes_grid/inset_locator.py +++ b/lib/mpl_toolkits/axes_grid/inset_locator.py @@ -271,10 +271,10 @@ def inset_axes(parent_axes, width, height, loc=1, axes_class = Axes if axes_kwargs is None: - inset_axes = Axes(parent_axes.figure, parent_axes.get_position()) + inset_axes = axes_class(parent_axes.figure, parent_axes.get_position()) else: - inset_axes = Axes(parent_axes.figure, parent_axes.get_position(), - **axes_kwargs) + inset_axes = axes_class(parent_axes.figure, parent_axes.get_position(), + **axes_kwargs) axes_locator = AnchoredSizeLocator(parent_axes.bbox, width, height, From 42aa8a89292ab64cbb49bcbcaf0c6c2ebeacb2a8 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sat, 5 Sep 2009 23:20:45 +0000 Subject: [PATCH 195/324] spines: fix 'axes' position bug (closes SF#2852168) Thanks to Jason Grout for reporting this. svn path=/branches/v0_99_maint/; revision=7638 --- lib/matplotlib/spines.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/spines.py b/lib/matplotlib/spines.py index 0591efe3ee0c..6a0546990885 100644 --- a/lib/matplotlib/spines.py +++ b/lib/matplotlib/spines.py @@ -171,10 +171,14 @@ def _calc_offset_transform(self): elif position_type=='axes': if self.spine_type in ('left','right'): self._spine_transform = ('pre', - mtransforms.Affine2D().translate(amount, 0.0)) + mtransforms.Affine2D.from_values( + # keep y unchanged, fix x at amount + 0,0,0,1,amount,0)) elif self.spine_type in ('bottom','top'): self._spine_transform = ('pre', - mtransforms.Affine2D().translate(0.0, amount)) + mtransforms.Affine2D.from_values( + # keep x unchanged, fix y at amount + 1,0,0,0,0,amount)) else: warnings.warn('unknown spine type "%s": no spine ' 'offset performed'%self.spine_type) From 13375bf6170e2e3381a7c8d9b1251755295eb091 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Mon, 7 Sep 2009 22:29:04 +0000 Subject: [PATCH 196/324] fix a bug in lib/matplotlib/bezier.py svn path=/branches/v0_99_maint/; revision=7703 --- lib/matplotlib/bezier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/bezier.py b/lib/matplotlib/bezier.py index 6c261f40c311..aca1bc3ecbd9 100644 --- a/lib/matplotlib/bezier.py +++ b/lib/matplotlib/bezier.py @@ -474,7 +474,7 @@ def make_path_regular(p): """ c = p.codes if c is None: - c = np.empty(p.vertices.shape, "i") + c = np.empty(p.vertices.shape[:1], "i") c.fill(Path.LINETO) c[0] = Path.MOVETO From 0ffefca9e7cbf81cda1731f52ce93f2b0728a204 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 9 Sep 2009 18:41:43 +0000 Subject: [PATCH 197/324] Include 'top' keyword argument in docstring for Figure.subplots_adjust(). svn path=/branches/v0_99_maint/; revision=7727 --- lib/matplotlib/figure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 11f77733d154..404ac7fd205e 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -850,7 +850,7 @@ def legend(self, handles, labels, *args, **kwargs): *fancybox*: [ None | False | True ] if True, draw a frame with a round fancybox. If None, use rc - + *shadow*: [ None | False | True ] If *True*, draw a shadow behind legend. If *None*, use rc settings. @@ -1064,7 +1064,8 @@ def on_changed(m): def subplots_adjust(self, *args, **kwargs): """ - fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None) + fig.subplots_adjust(left=None, bottom=None, right=None, top=None, + wspace=None, hspace=None) Update the :class:`SubplotParams` with *kwargs* (defaulting to rc where None) and update the subplot locations From 60be8fddf5b1ecd9244e5fef0704fcce15b67155 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 9 Sep 2009 19:55:52 +0000 Subject: [PATCH 198/324] Fix some documentation warnings. svn path=/branches/v0_99_maint/; revision=7728 --- doc/api/spine_api.rst | 2 +- doc/mpl_toolkits/mplot3d/tutorial.rst | 2 +- doc/users/image_tutorial.rst | 171 ++++++++++++++++++-------- doc/users/index.rst | 1 - doc/users/pyplot_tutorial.rst | 18 +-- lib/matplotlib/axes.py | 14 +-- lib/matplotlib/mlab.py | 2 +- 7 files changed, 141 insertions(+), 69 deletions(-) diff --git a/doc/api/spine_api.rst b/doc/api/spine_api.rst index 0ef13e33234b..062b0aabe1ef 100644 --- a/doc/api/spine_api.rst +++ b/doc/api/spine_api.rst @@ -6,7 +6,7 @@ matplotlib spine :mod:`matplotlib.spine` ======================== -.. automodule:: matplotlib.spine +.. automodule:: matplotlib.spines :members: :undoc-members: :show-inheritance: diff --git a/doc/mpl_toolkits/mplot3d/tutorial.rst b/doc/mpl_toolkits/mplot3d/tutorial.rst index fa3deb6e8c91..002bf00a21ff 100644 --- a/doc/mpl_toolkits/mplot3d/tutorial.rst +++ b/doc/mpl_toolkits/mplot3d/tutorial.rst @@ -55,7 +55,7 @@ Filled contour plots Polygon plots ==================== -.. automethod:: add_collection3d +.. automethod:: Axes3D.add_collection3d .. plot:: mpl_examples/mplot3d/polys3d_demo.py diff --git a/doc/users/image_tutorial.rst b/doc/users/image_tutorial.rst index 4340a76a36db..094b4154d3d8 100644 --- a/doc/users/image_tutorial.rst +++ b/doc/users/image_tutorial.rst @@ -10,17 +10,20 @@ Image tutorial Startup commands =================== -At the very least, you'll need to have access to the :func:`~matplotlib.pyplot.imshow` function. There are a couple of ways to do it. The easy way for an interactive environment:: +At the very least, you'll need to have access to the +:func:`~matplotlib.pyplot.imshow` function. There are a couple of +ways to do it. The easy way for an interactive environment:: + + $ipython -pylab - $ipython -pylab - The imshow function is now directly accessible (it's in your `namespace `_). See also :ref:`pyplot-tutorial`. The more expressive, easier to understand later method (use this in your scripts to make it easier for others (including your future self) -to read) is to use the matplotlib API (see :ref:`artist-tutorial`) where you use explicit namespaces and control object creation, etc... +to read) is to use the matplotlib API (see :ref:`artist-tutorial`) +where you use explicit namespaces and control object creation, etc... .. sourcecode:: ipython @@ -28,16 +31,22 @@ to read) is to use the matplotlib API (see :ref:`artist-tutorial`) where you use In [2]: import matplotlib.image as mpimg In [3]: import numpy as np -Examples below will use the latter method, for clarity. In these examples, if you use the -pylab method, you can skip the "mpimg." and "plt." prefixes. +Examples below will use the latter method, for clarity. In these +examples, if you use the -pylab method, you can skip the "mpimg." and +"plt." prefixes. .. _importing_data: Importing image data into Numpy arrays =============================================== -Plotting image data is supported by the Python Image Library (`PIL `_), . Natively, matplotlib only supports PNG images. The commands shown below fall back on PIL if the native read fails. +Plotting image data is supported by the Python Image Library (`PIL +`_), . Natively, matplotlib +only supports PNG images. The commands shown below fall back on PIL +if the native read fails. -The image used in this example is a PNG file, but keep that PIL requirement in mind for your own data. +The image used in this example is a PNG file, but keep that PIL +requirement in mind for your own data. Here's the image we're going to play with: @@ -55,11 +64,11 @@ And here we go... .. sourcecode:: ipython In [4]: img=mpimg.imread('stinkbug.png') - Out[4]: + Out[4]: array([[[ 0.40784314, 0.40784314, 0.40784314], [ 0.40784314, 0.40784314, 0.40784314], [ 0.40784314, 0.40784314, 0.40784314], - ..., + ..., [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098]], @@ -67,7 +76,7 @@ And here we go... [[ 0.41176471, 0.41176471, 0.41176471], [ 0.41176471, 0.41176471, 0.41176471], [ 0.41176471, 0.41176471, 0.41176471], - ..., + ..., [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098]], @@ -75,16 +84,16 @@ And here we go... [[ 0.41960785, 0.41960785, 0.41960785], [ 0.41568628, 0.41568628, 0.41568628], [ 0.41568628, 0.41568628, 0.41568628], - ..., + ..., [ 0.43137255, 0.43137255, 0.43137255], [ 0.43137255, 0.43137255, 0.43137255], [ 0.43137255, 0.43137255, 0.43137255]], - ..., + ..., [[ 0.43921569, 0.43921569, 0.43921569], [ 0.43529412, 0.43529412, 0.43529412], [ 0.43137255, 0.43137255, 0.43137255], - ..., + ..., [ 0.45490196, 0.45490196, 0.45490196], [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.4509804 , 0.4509804 , 0.4509804 ]], @@ -92,7 +101,7 @@ And here we go... [[ 0.44313726, 0.44313726, 0.44313726], [ 0.44313726, 0.44313726, 0.44313726], [ 0.43921569, 0.43921569, 0.43921569], - ..., + ..., [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.44705883, 0.44705883, 0.44705883], [ 0.44705883, 0.44705883, 0.44705883]], @@ -100,26 +109,46 @@ And here we go... [[ 0.44313726, 0.44313726, 0.44313726], [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.4509804 , 0.4509804 , 0.4509804 ], - ..., + ..., [ 0.44705883, 0.44705883, 0.44705883], [ 0.44705883, 0.44705883, 0.44705883], [ 0.44313726, 0.44313726, 0.44313726]]], dtype=float32) -Note the dtype there - float32. Matplotlib has rescaled the 8 bit data from each channel to floating point data between 0.0 and 1.0. As a side note, the only datatype that PIL can work with is uint8. Matplotlib plotting can handle float32 and uint8, but image reading/writing for any format other than PNG is limited to uint8 data. Why 8 bits? Most displays can only render 8 bits per channel worth of color gradation. Why can they only render 8 bits/channel? Because that's about all the human eye can see. More here (from a photography standpoint): `Luminous Landscape bit depth tutorial `_ - -Each inner list represents a pixel. Here, with an RGB image, there are 3 values. Since it's a black and white image, R, G, and B are all similar. An RGBA (where A is alpha, or transparency), has 4 values per inner list, and a simple luminance image just has one value (and is thus only a 2-D array, not a 3-D array). For RGB and RGBA images, matplotlib supports float32 and uint8 data types. For grayscale, matplotlib supports only float32. If your array data does not meet one of these descriptions, you need to rescale it. +Note the dtype there - float32. Matplotlib has rescaled the 8 bit +data from each channel to floating point data between 0.0 and 1.0. As +a side note, the only datatype that PIL can work with is uint8. +Matplotlib plotting can handle float32 and uint8, but image +reading/writing for any format other than PNG is limited to uint8 +data. Why 8 bits? Most displays can only render 8 bits per channel +worth of color gradation. Why can they only render 8 bits/channel? +Because that's about all the human eye can see. More here (from a +photography standpoint): `Luminous Landscape bit depth tutorial +`_. + +Each inner list represents a pixel. Here, with an RGB image, there +are 3 values. Since it's a black and white image, R, G, and B are all +similar. An RGBA (where A is alpha, or transparency), has 4 values +per inner list, and a simple luminance image just has one value (and +is thus only a 2-D array, not a 3-D array). For RGB and RGBA images, +matplotlib supports float32 and uint8 data types. For grayscale, +matplotlib supports only float32. If your array data does not meet +one of these descriptions, you need to rescale it. .. _plotting_data: Plotting numpy arrays as images =================================== -So, you have your data in a numpy array (either by importing it, or by generating it). Let's render it. In Matplotlib, this is performed using the :func:`~matplotlib.pyplot.imshow` function. Here we'll grab the plot object. This object gives you an easy way to manipulate the plot from the prompt. +So, you have your data in a numpy array (either by importing it, or by +generating it). Let's render it. In Matplotlib, this is performed +using the :func:`~matplotlib.pyplot.imshow` function. Here we'll grab +the plot object. This object gives you an easy way to manipulate the +plot from the prompt. .. sourcecode:: ipython In [5]: imgplot = plt.imshow(img) - + .. plot:: import matplotlib.pyplot as plt @@ -128,23 +157,31 @@ So, you have your data in a numpy array (either by importing it, or by generatin img = mpimg.imread('_static/stinkbug.png') imgplot = plt.imshow(img) -You can also plot any numpy array - just remember that the datatype must be float32 (and range from 0.0 to 1.0) or uint8. +You can also plot any numpy array - just remember that the datatype +must be float32 (and range from 0.0 to 1.0) or uint8. .. _Pseudocolor: - + Applying pseudocolor schemes to image plots ------------------------------------------------- -Pseudocolor can be a useful tool for enhancing contrast and visualizing your data more easily. This is especially useful when making presentations of your data using projectors - their contrast is typically quite poor. +Pseudocolor can be a useful tool for enhancing contrast and +visualizing your data more easily. This is especially useful when +making presentations of your data using projectors - their contrast is +typically quite poor. -Pseudocolor is only relevant to single-channel, grayscale, luminosity images. We currently have an RGB image. Since R, G, and B are all similar (see for yourself above or in your data), we can just pick on channel of our data: +Pseudocolor is only relevant to single-channel, grayscale, luminosity +images. We currently have an RGB image. Since R, G, and B are all +similar (see for yourself above or in your data), we can just pick on +channel of our data: .. sourcecode:: ipython In [6]: lum_img = img[:,:,0] - -This is array slicing. You can read more `here `_ - + +This is array slicing. You can read more `here +`_. + .. sourcecode:: ipython In [7]: imgplot = mpimg.imshow(lum_img) @@ -158,7 +195,11 @@ This is array slicing. You can read more `here `_ - +There are many other colormap schemes available. See a list and +images of the colormaps `here +`_. + .. _Color Bars Color scale reference ------------------------ -It's helpful to have an idea of what value a color represents. We can do that by adding color bars. It's as easy as one line: +It's helpful to have an idea of what value a color represents. We can +do that by adding color bars. It's as easy as one line: .. sourcecode:: ipython + In [10]: plt.colorbar() - + .. plot:: import matplotlib.pyplot as plt @@ -210,15 +255,22 @@ It's helpful to have an idea of what value a color represents. We can do that b imgplot = plt.imshow(lum_img) imgplot.set_cmap('spectral') plt.colorbar() - -This adds a colorbar to your existing figure. This won't automatically change if you change you switch to a different colormap - you have to re-create your plot, and add in the colorbar again. + +This adds a colorbar to your existing figure. This won't +automatically change if you change you switch to a different +colormap - you have to re-create your plot, and add in the colorbar +again. .. _Data ranges Examining a specific data range --------------------------------- -Sometimes you want to enhance the contrast in your image, or expand the contrast in a particular region while sacrificing the detail in colors that don't vary much, or don't matter. A good tool to find interesting regions is the histogram. To create a histogram of our image data, we use the :func:`~matplotlib.pyplot.hist` function. +Sometimes you want to enhance the contrast in your image, or expand +the contrast in a particular region while sacrificing the detail in +colors that don't vary much, or don't matter. A good tool to find +interesting regions is the histogram. To create a histogram of our +image data, we use the :func:`~matplotlib.pyplot.hist` function. .. sourcecode:: ipython @@ -233,7 +285,14 @@ Sometimes you want to enhance the contrast in your image, or expand the contrast lum_img = img[:,:,0] plt.hist(lum_img, range=(0.0,1.0)) -Most often, the "interesting" part of the image is around the peak, and you can get extra contrast by clipping the regions above and/or below the peak. In our histogram, it looks like there's not much useful information in the high end (not many white things in the image). Let's adjust the upper limit, so that we effectively "zoom in on" part of the histogram. We do this by calling the :meth:`~matplotlib.image.Image.set_clim` method of the image plot object. +Most often, the "interesting" part of the image is around the peak, +and you can get extra contrast by clipping the regions above and/or +below the peak. In our histogram, it looks like there's not much +useful information in the high end (not many white things in the +image). Let's adjust the upper limit, so that we effectively "zoom in +on" part of the histogram. We do this by calling the +:meth:`~matplotlib.image.Image.set_clim` method of the image plot +object. .. sourcecode:: ipython @@ -249,8 +308,8 @@ Most often, the "interesting" part of the image is around the peak, and you can img = mpimg.imread('_static/stinkbug.png') lum_img = img[:,:,0] imgplot = plt.imshow(lum_img) - a.set_title('Before') - plt.colorbar(ticks=[0.1,0.3,0.5,0.7], orientation ='horizontal') + a.set_title('Before') + plt.colorbar(ticks=[0.1,0.3,0.5,0.7], orientation ='horizontal') a=fig.add_subplot(1,2,2) imgplot = plt.imshow(lum_img) imgplot.set_clim(0.0,0.7) @@ -260,8 +319,20 @@ Most often, the "interesting" part of the image is around the peak, and you can .. _Interpolation: Array Interpolation schemes ------------------------------------ -Interpolation calculates what the color or value of a pixel "should" be, according to different mathematical schemes. One common place that this happens is when you resize an image. The number of pixels change, but you want the same information. Since pixels are discrete, there's missing space. Interpolation is how you fill that space. This is why your images sometimes come out looking pixelated when you blow them up. The effect is more pronounced when the difference between the original image and the expanded image is greater. Let's take our image and shrink it. We're effectively discarding pixels, only keeping a select few. Now when we plot it, that data gets blown up to the size on your screen. The old pixels aren't there anymore, and the computer has to draw in pixels to fill that space. +--------------------------- + +Interpolation calculates what the color or value of a pixel "should" +be, according to different mathematical schemes. One common place +that this happens is when you resize an image. The number of pixels +change, but you want the same information. Since pixels are discrete, +there's missing space. Interpolation is how you fill that space. +This is why your images sometimes come out looking pixelated when you +blow them up. The effect is more pronounced when the difference +between the original image and the expanded image is greater. Let's +take our image and shrink it. We're effectively discarding pixels, +only keeping a select few. Now when we plot it, that data gets blown +up to the size on your screen. The old pixels aren't there anymore, +and the computer has to draw in pixels to fill that space. .. sourcecode:: ipython @@ -272,7 +343,7 @@ Interpolation calculates what the color or value of a pixel "should" be, accordi In [12]: imgplot = mpimg.imshow(rsizeArr) .. plot:: - + import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np @@ -283,7 +354,8 @@ Interpolation calculates what the color or value of a pixel "should" be, accordi lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) -Here we have the default interpolation, bilinear, since we did not give :func:`~matplotlib.pyplot.imshow` any interpolation argument. +Here we have the default interpolation, bilinear, since we did not +give :func:`~matplotlib.pyplot.imshow` any interpolation argument. Let's try some others: @@ -302,10 +374,10 @@ Let's try some others: rsizeArr = np.asarray(rsize) lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) - imgplot.set_interpolation('nearest') - + imgplot.set_interpolation('nearest') + .. sourcecode:: ipython - + In [10]: imgplot.set_interpolation('bicubic') .. plot:: @@ -320,5 +392,6 @@ Let's try some others: lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) imgplot.set_interpolation('bicubic') - -Bicubic interpolation is often used when blowing up photos - people tend to prefer blurry over pixelated. \ No newline at end of file + +Bicubic interpolation is often used when blowing up photos - people +tend to prefer blurry over pixelated. diff --git a/doc/users/index.rst b/doc/users/index.rst index fdb05bb226de..804930493262 100644 --- a/doc/users/index.rst +++ b/doc/users/index.rst @@ -23,7 +23,6 @@ User's Guide artists.rst legend_guide.rst event_handling.rst - legend.rst transforms_tutorial.rst path_tutorial.rst annotations_guide.rst diff --git a/doc/users/pyplot_tutorial.rst b/doc/users/pyplot_tutorial.rst index defadc8671f5..10cb6d1787e7 100644 --- a/doc/users/pyplot_tutorial.rst +++ b/doc/users/pyplot_tutorial.rst @@ -165,17 +165,17 @@ The :func:`~matplotlib.pyplot.figure` command here is optional because ``figure(1)`` will be created by default, just as a ``subplot(111)`` will be created by default if you don't manually specify an axes. The :func:`~matplotlib.pyplot.subplot` command specifies ``numrows, - numcols, fignum`` where ``fignum`` ranges from 1 to -``numrows*numcols``. The commas in the ``subplot`` command are optional -if ``numrows*numcols<10``. So ``subplot(211)`` is identical to -``subplot(2,1,1)``. You can create an arbitrary number of subplots +numcols, fignum`` where ``fignum`` ranges from 1 to +``numrows*numcols``. The commas in the ``subplot`` command are +optional if ``numrows*numcols<10``. So ``subplot(211)`` is identical +to ``subplot(2,1,1)``. You can create an arbitrary number of subplots and axes. If you want to place an axes manually, ie, not on a rectangular grid, use the :func:`~matplotlib.pyplot.axes` command, which allows you to specify the location as ``axes([left, bottom, width, height])`` where all values are in fractional (0 to 1) coordinates. See :ref:`pylab_examples-axes_demo` for an example of -placing axes manually and :ref:`pylab_examples-line_styles` for an example -with lots-o-subplots. +placing axes manually and :ref:`pylab_examples-line_styles` for an +example with lots-o-subplots. You can create multiple figures by using multiple @@ -267,6 +267,6 @@ these arguments are ``(x,y)`` tuples. In this basic example, both the ``xy`` (arrow tip) and ``xytext`` locations (text location) are in data coordinates. There are a variety of other coordinate systems one can choose -- see -:ref:`annotations-tutorial` and :ref:`plotting-guide-annotation` -for details. More examples can be found -in :ref:`pylab_examples-annotation_demo`. +:ref:`annotations-tutorial` and :ref:`plotting-guide-annotation` for +details. More examples can be found in +:ref:`pylab_examples-annotation_demo`. diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 95926c65fe45..1feab64ed0df 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -1338,7 +1338,7 @@ def has_data(self): def add_artist(self, a): ''' - Add any :class:`~matplotlib.artist.Artist` to the axes + Add any :class:`~matplotlib.artist.Artist` to the axes. Returns the artist. ''' @@ -1351,8 +1351,8 @@ def add_artist(self, a): def add_collection(self, collection, autolim=True): ''' - add a :class:`~matplotlib.collections.Collection` instance - to the axes + Add a :class:`~matplotlib.collections.Collection` instance + to the axes. Returns the collection. ''' @@ -3710,15 +3710,15 @@ def acorr(self, x, **kwargs): *maxlags* is a positive integer detailing the number of lags to show. The default value of *None* will return all - :math:`2 \mathrm{len}(x) - 1` lags. + :math:`2 \times \mathrm{len}(x) - 1` lags. The return value is a tuple (*lags*, *c*, *linecol*, *b*) where - - *linecol* is the - :class:`~matplotlib.collections.LineCollection` + - *linecol* is the + :class:`~matplotlib.collections.LineCollection` - - *b* is the *x*-axis. + - *b* is the *x*-axis. .. seealso:: diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 50746271af23..bf2b6e1c4ce3 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -569,7 +569,7 @@ def cohere_pairs( X, ij, NFFT=256, Fs=2, detrend=detrend_none, example script that shows that this :func:`cohere_pairs` and :func:`cohere` give the same results for a given pair. - .. sealso:: + .. seealso:: :func:`psd` For information about the methods used to compute From dc4908a554adf0d3e864410b57613c16a1116308 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Thu, 10 Sep 2009 23:01:28 +0000 Subject: [PATCH 199/324] fix a bug in Line2D.draw method that produces invalid svg when the line is invisible svn path=/branches/v0_99_maint/; revision=7734 --- lib/matplotlib/lines.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index a24cc0ba0442..5b82071f8717 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -505,9 +505,10 @@ def draw(self, renderer): self._transform_path(subslice) if self._transformed_path is None: self._transform_path() - renderer.open_group('line2d', self.get_gid()) - if not self._visible: return + if not self.get_visible(): return + + renderer.open_group('line2d', self.get_gid()) gc = renderer.new_gc() self._set_gc_clip(gc) From cfbcc833866c44601fea4b331f399492ffef94db Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Fri, 11 Sep 2009 01:54:27 +0000 Subject: [PATCH 200/324] bugfix: bounds checking in hexbin with extent specified (SF#2856228) svn path=/branches/v0_99_maint/; revision=7740 --- lib/matplotlib/axes.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 1feab64ed0df..539be0dc45b5 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -5624,9 +5624,13 @@ def hexbin(self, x, y, C = None, gridsize = 100, bins = None, for i in xrange(len(x)): if bdist[i]: - lattice1[ix1[i], iy1[i]]+=1 + if ((ix1[i] >= 0) and (ix1[i] < nx1) and + (iy1[i] >= 0) and (iy1[i] < ny1)): + lattice1[ix1[i], iy1[i]]+=1 else: - lattice2[ix2[i], iy2[i]]+=1 + if ((ix2[i] >= 0) and (ix2[i] < nx2) and + (iy2[i] >= 0) and (iy2[i] < ny2)): + lattice2[ix2[i], iy2[i]]+=1 # threshold if mincnt is not None: @@ -5658,9 +5662,13 @@ def hexbin(self, x, y, C = None, gridsize = 100, bins = None, for i in xrange(len(x)): if bdist[i]: - lattice1[ix1[i], iy1[i]].append( C[i] ) + if ((ix1[i] >= 0) and (ix1[i] < nx1) and + (iy1[i] >= 0) and (iy1[i] < ny1)): + lattice1[ix1[i], iy1[i]].append( C[i] ) else: - lattice2[ix2[i], iy2[i]].append( C[i] ) + if ((ix2[i] >= 0) and (ix2[i] < nx2) and + (iy2[i] >= 0) and (iy2[i] < ny2)): + lattice2[ix2[i], iy2[i]].append( C[i] ) for i in xrange(nx1): From 569c6bba1c907371452da9c56834c9c947ba29cb Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 11 Sep 2009 02:06:30 +0000 Subject: [PATCH 201/324] minor tweaks to licensing devel doc svn path=/branches/v0_99_maint/; revision=7741 --- doc/devel/coding_guide.rst | 34 +++++++++++++++++----------------- doc/users/credits.rst | 13 ++++++++++--- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index 6f2a760b5c1d..128c584a9dce 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -578,7 +578,7 @@ Why BSD compatible? The two dominant license variants in the wild are GPL-style and BSD-style. There are countless other licenses that place specific -restrictions on code reuse, but there is an important different to be +restrictions on code reuse, but there is an important difference to be considered in the GPL and BSD variants. The best known and perhaps most widely used license is the GPL, which in addition to granting you full rights to the source code including redistribution, carries with @@ -587,7 +587,7 @@ with it, your product must be released under a GPL compatible license. I.e., you are required to give the source code to other people and give them the right to redistribute it as well. Many of the most famous and widely used open source projects are released under -the GPL, including sagemath, linux, gcc and emacs. +the GPL, including linux, gcc, emacs and sage. The second major class are the BSD-style licenses (which includes MIT and the python PSF license). These basically allow you to do whatever @@ -606,20 +606,20 @@ Famous projects released under a BSD-style license in the permissive sense of the last paragraph are the BSD operating system, python and TeX. -There are two primary reasons why early matplotlib developers selected -a BSD compatible license. We wanted to attract as many users and -developers as possible, and many software companies will not use GPL code -in software they plan to distribute, even those that are highly -committed to open source development, such as `enthought +There are several reasons why early matplotlib developers selected a +BSD compatible license. matplotlib is a python extension, and we +choose a license that was based on the python license (BSD +compatible). Also, we wanted to attract as many users and developers +as possible, and many software companies will not use GPL code in +software they plan to distribute, even those that are highly committed +to open source development, such as `enthought `_, out of legitimate concern that use of the GPL will "infect" their code base by its viral nature. In effect, they -want to retain the right to release some proprietary code. Companies, -and institutions in general, who use matplotlib often make significant -contributions, since they have the resources to get a job done, even a -boring one, if they need it in their code. Two of the matplotlib -backends (FLTK and WX) were contributed by private companies. - -The other reason is licensing compatibility with the other python -extensions for scientific computing: ipython, numpy, scipy, the -enthought tool suite and python itself are all distributed under BSD -compatible licenses. +want to retain the right to release some proprietary code. Companies +and institutions who use matplotlib often make significant +contributions, because they have the resources to get a job done, even +a boring one. Two of the matplotlib backends (FLTK and WX) were +contributed by private companies. The final reason behind the +licensing choice is compatibility with the other python extensions for +scientific computing: ipython, numpy, scipy, the enthought tool suite +and python itself are all distributed under BSD compatible licenses. diff --git a/doc/users/credits.rst b/doc/users/credits.rst index 107192201ec0..f122a28699b1 100644 --- a/doc/users/credits.rst +++ b/doc/users/credits.rst @@ -18,7 +18,11 @@ Jeremy O'Donoghue Andrew Straw provided much of the log scaling architecture, the fill command, PIL support for imshow, and provided many examples. He - also wrote the support for dropped axis spines. + also wrote the support for dropped axis spines and the `buildbot + `_ unit testing infrastructure + which triggers the JPL/James Evans platform specific builds and + regression test image comparisons from svn matplotlib across + platforms on svn commits. Charles Twardy provided the impetus code for the legend class and has made @@ -116,11 +120,14 @@ Jeffrey Whitaker at `NOAA `_ wrote the :ref:`toolkit_basemap` tookit -Sigve Tjoraand, Ted Drain +Sigve Tjoraand, Ted Drain, James Evans and colleagues at the `JPL `_ collaborated on the QtAgg backend and sponsored development of a number of features including custom unit types, datetime support, scale free - ellipses, broken bar plots and more. + ellipses, broken bar plots and more. The JPL team wrote the unit + testing image comparison `infrastructure + `_ + for regression test image comparisons. James Amundson did the initial work porting the qt backend to qt4 From b1522122e0dde4a677dead601616dcaa9c034708 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Fri, 11 Sep 2009 20:48:10 +0000 Subject: [PATCH 202/324] Fix bug in quiver angle kwarg, found when input angle array is not 1-D svn path=/branches/v0_99_maint/; revision=7745 --- lib/matplotlib/quiver.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index ba93d71e2886..9e869d0a0911 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -506,6 +506,7 @@ def _make_verts(self, U, V): theta = np.angle(uv) else: theta = ma.masked_invalid(self.angles, copy=False).filled(0) + theta = theta.ravel() theta *= (np.pi/180.0) theta.shape = (theta.shape[0], 1) # for broadcasting xy = (X+Y*1j) * np.exp(1j*theta)*self.width From 4ceb3fa4b2b36102afa919d74ab65665b18ece0b Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Fri, 11 Sep 2009 21:14:15 +0000 Subject: [PATCH 203/324] Backported quiver bug fix from trunk svn path=/branches/v0_99_maint/; revision=7749 --- lib/matplotlib/quiver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index 9e869d0a0911..2af5784236b0 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -496,7 +496,11 @@ def _make_verts(self, U, V): a = np.absolute(uv) if self.scale is None: sn = max(10, math.sqrt(self.N)) - scale = 1.8 * a[~self.Umask].mean() * sn / self.span # crude auto-scaling + if self.Umask is not ma.nomask: + amean = a[~self.Umask].mean() + else: + amean = a.mean() + scale = 1.8 * amean * sn / self.span # crude auto-scaling self.scale = scale length = a/(self.scale*self.width) X, Y = self._h_arrows(length) From da75707570edcce53dfd13259ab8e918291c4aba Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sat, 12 Sep 2009 21:11:42 +0000 Subject: [PATCH 204/324] tagging for 99.1 release candiate svn path=/branches/v0_99_maint/; revision=7751 --- README.txt | 78 +++++++++++++++----------------------- lib/matplotlib/__init__.py | 2 +- make.osx | 44 ++++++++++++--------- 3 files changed, 58 insertions(+), 66 deletions(-) diff --git a/README.txt b/README.txt index 1132832f5ce4..318ee55f43c0 100644 --- a/README.txt +++ b/README.txt @@ -1,61 +1,45 @@ -Overview of the matplotlib src tree -=================================== +matplotlib for MacOS X 10.3.9 or later and Python 2.5 and Python 2.6 -This is the source directory for matplotlib, which contains the -following files and directories. +matplotlib is a python 2D plotting library which produces publication +quality figures in a variety of hardcopy formats and interactive +environments across platforms. matplotlib can be used in python +scripts, the python and ipython shell (ala matlab or mathematica), web +application servers, and various graphical user interface toolkits. -* doc - the matplotlib documentation. See doc/users for the user's - documentation and doc/devel for the developers documentation +Home page: -* examples - a bunch of examples using matplotib. See - examples/README.txt for information +Before running matplotlib, you must install numpy. Binary installers +for all these packages are available here: -* setup.cfg.template - used to configure the matplotlib build process. - Copy this file to setup.cfg if you want to override the default - build behavior + . -* matplotlibrc.template - a template file used to generate the - matplotlibrc config file at build time. The matplotlibrc file will - be installed in matplotlib/mpl-data/matplotlibrc +*** Back Ends *** -* lib - the python src code. matplotlib ships several third party - packages here. The subdirectory lib/matplotlib contains the python - src code for matplotlib +You may use TkAgg or WXAgg back ends; Qt and GTK support is not +provided in this package. By default this matplotlib uses TkAgg +because Tcl/Tk is included with MacOS X. -* src - the matplotlib extension code, mostly C++ +If you wish to use WXAgg then: +* Install wxPython from: + . +* Configure a matplotlibrc file, as described below. -* ttconv - some truetype font utilities +For TkAgg you may use Apple's built-in Tcl/Tk or install your own 8.4.x -* license - all the licenses for code included with matplotlib. - matplotlib uses only BSD compatible code +*** Configuring a matplotlibrc file *** -* unit - some unit tests +If you wish to change any matplotlib settings, create a file: + ~/.matplotlib/matplotlibrc -* CHANGELOG - all the significant changes to matplotlib, organized by - release. The top of this file will show you the most recent changes -* API_CHANGES - any change that alters the API is listed here. The - entries are organized by release, with most recent entries first +that contains at least the following information. The values shown are +the defaults in the internal matplotlibrc file; change them as you see +fit: -* MIGRATION.txt - instructions on moving from the 0.91 code to the - 0.98 trunk. - -* SEGFAULTS - some tips for how to diagnose and debug segfaults - -* setup.py - the matplotlib build script - -* setupext.py - some helper code for setup.py to build the matplotlib - extensions - -* boilerplate.py - some code to automatically generate the pyplot - wrappers - -* DEVNOTES - deprecated developer notes. TODO: update and move to the - doc/devel framework - -* FILETYPES - This is a table of the output formats supported by each - backend. TODO: move to doc/users - -* INTERACTIVE - instructions on using matplotlib interactively, eg - from the python shell. TODO: update and move to doc/users. +# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg WXAgg +# Agg Cairo GD GDK Paint PS PDF SVG Template +backend : TkAgg +interactive : False # see http://matplotlib.sourceforge.net/interactive.html +See also + diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index cd4840ec7722..e3d0cb068bc8 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.0' +__version__ = '0.99.1rc1' __revision__ = '$Revision$' __date__ = '$Date$' diff --git a/make.osx b/make.osx index 8c8097f1bb59..95875c748546 100644 --- a/make.osx +++ b/make.osx @@ -1,6 +1,7 @@ # build mpl into a local install dir with # PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install +MPLVERSION=0.99.1rc1 PYVERSION=2.6 PYTHON=python${PYVERSION} ZLIBVERSION=1.2.3 @@ -10,12 +11,9 @@ MACOSX_DEPLOYMENT_TARGET=10.4 ## You shouldn't need to configure past this point -CFLAGS="-Os -arch ppc -arch i386 -I{$PREFIX}/include" -LDFLAGS="-arch ppc -arch i386 -L${PREFIX}/lib" - -CFLAGS_DEPS="-arch i386 -arch ppc -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" -LDFLAGS_DEPS="-arch i386 -arch ppc -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" +CFLAGS="-arch i386 -arch ppc -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" +LDFLAGS="-arch i386 -arch ppc -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" clean: rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \ @@ -37,10 +35,10 @@ zlib: tar xvfz zlib-${ZLIBVERSION}.tar.gz &&\ cd zlib-${ZLIBVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ ./configure --prefix=${PREFIX}&&\ - MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS_DEPS} LDFLAGS=${LDFLAGS_DEPS} make -j3 install&& \ + MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} make -j3 install&& \ unset MACOSX_DEPLOYMENT_TARGET png: zlib @@ -49,8 +47,8 @@ png: zlib tar xvfj libpng-${PNGVERSION}.tar.bz2 cd libpng-${PNGVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ ./configure --disable-dependency-tracking --prefix=${PREFIX} &&\ make -j3 install&&\ cp .libs/libpng.a . &&\ @@ -63,8 +61,8 @@ freetype: zlib tar xvfj freetype-${FREETYPEVERSION}.tar.bz2 &&\ cd freetype-${FREETYPEVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ ./configure --prefix=${PREFIX} &&\ make -j3 install &&\ cp objs/.libs/libfreetype.a . &&\ @@ -76,12 +74,22 @@ deps: zlib png freetype mpl_build: export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ - python setup.py build + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ + ${PYTHON} setup.py build mpl_install: export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ - python setup.py install --prefix=${PREFIX} + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ + ${PYTHON} setup.py install --prefix=${PREFIX} + + +binaries: + unset PKG_CONFIG_PATH &&\ + cp release/osx/data/setup.cfg release/osx/data/ReadMe.txt . &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ + /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg --readme=ReadMe.txt &&\ + hdiutil create -srcdir dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.dmg &&\ + ${PYTHON} setupegg.py bdist_egg From dea1147a91a3cf3efdf0589c2a8ae9a7443c3b7e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 14 Sep 2009 17:11:06 +0000 Subject: [PATCH 205/324] Minor doc fixes svn path=/branches/v0_99_maint/; revision=7756 --- doc/users/image_tutorial.rst | 6 +++--- lib/matplotlib/axes.py | 4 ++-- lib/matplotlib/font_manager.py | 14 +++++++------- lib/matplotlib/mlab.py | 14 ++++++++++++-- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/doc/users/image_tutorial.rst b/doc/users/image_tutorial.rst index 094b4154d3d8..07a3a6a02597 100644 --- a/doc/users/image_tutorial.rst +++ b/doc/users/image_tutorial.rst @@ -179,7 +179,7 @@ channel of our data: In [6]: lum_img = img[:,:,0] -This is array slicing. You can read more `here +This is array slicing. You can read more in the `Numpy tutorial `_. .. sourcecode:: ipython @@ -229,8 +229,8 @@ object: imgplot = plt.imshow(lum_img) imgplot.set_cmap('spectral') -There are many other colormap schemes available. See a list and -images of the colormaps `here +There are many other colormap schemes available. See the `list and +images of the colormaps `_. .. _Color Bars diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 539be0dc45b5..2f939ed5a789 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -7438,8 +7438,8 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window = mlab.window_hanning, noverlap=0, pad_to=None, sides='default', scale_by_freq=None, **kwargs) - cohere the coherence between *x* and *y*. Coherence is the normalized - cross spectral density: + :meth:`cohere` the coherence between *x* and *y*. Coherence + is the normalized cross spectral density: .. math:: diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index b65190dd3371..69784cc8afdd 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -12,12 +12,12 @@ font specification `_. Future versions may implement the Level 2 or 2.1 specifications. -Experimental support is included for using `fontconfig -`_ on Unix variant plaforms (Linux, OS X, -Solaris). To enable it, set the constant ``USE_FONTCONFIG`` in this -file to ``True``. Fontconfig has the advantage that it is the -standard way to look up fonts on X11 platforms, so if a font is -installed, it is much more likely to be found. +Experimental support is included for using `fontconfig` on Unix +variant platforms (Linux, OS X, Solaris). To enable it, set the +constant ``USE_FONTCONFIG`` in this file to ``True``. Fontconfig has +the advantage that it is the standard way to look up fonts on X11 +platforms, so if a font is installed, it is much more likely to be +found. """ """ @@ -707,7 +707,7 @@ def _parse_fontconfig_pattern(self, pattern): def __hash__(self): l = [(k, getattr(self, "get" + k)()) for k in sorted(self.__dict__)] return hash(repr(l)) - + def __str__(self): return self.get_fontconfig_pattern() diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index bf2b6e1c4ce3..a773514a52ba 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -362,12 +362,16 @@ def psd(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning, *x* Array or sequence containing the data + %(PSD)s + Returns the tuple (*Pxx*, *freqs*). Refs: + Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986) + """ Pxx,freqs = csd(x, x, NFFT, Fs, detrend, window, noverlap, pad_to, sides, scale_by_freq) @@ -391,7 +395,9 @@ def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning, *x*, *y* Array or sequence containing the data + %(PSD)s + Returns the tuple (*Pxy*, *freqs*). Refs: @@ -418,7 +424,9 @@ def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning, If *x* is real (i.e. non-complex) only the spectrum of the positive frequencie is returned. If *x* is complex then the complete spectrum is returned. + %(PSD)s + Returns a tuple (*Pxx*, *freqs*, *t*): - *Pxx*: 2-D array, columns are the periodograms of @@ -462,11 +470,13 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning, *x*, *y* Array or sequence containing the data + %(PSD)s + The return value is the tuple (*Cxy*, *f*), where *f* are the frequencies of the coherence vector. For cohere, scaling the - individual densities by the sampling frequency has no effect, since - the factors cancel out. + individual densities by the sampling frequency has no effect, + since the factors cancel out. .. seealso:: From dc5175fa6b999707becd2590f6d78b19e8477e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Tue, 15 Sep 2009 12:12:19 +0000 Subject: [PATCH 206/324] Don't fail on AFM files containing floating-point bounding boxes svn path=/branches/v0_99_maint/; revision=7762 --- CHANGELOG | 2 ++ lib/matplotlib/afm.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 6684b9cd5266..6c18c2789ee2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2009-09-15 Don't fail on AFM files containing floating-point bounding boxes - JKS + 2009-08-06 Tagging the 0.99.0 release at svn r7397 - JDH * fixed an alpha colormapping bug posted on sf 2832575 diff --git a/lib/matplotlib/afm.py b/lib/matplotlib/afm.py index d1a065345b36..05d2f78d54c9 100644 --- a/lib/matplotlib/afm.py +++ b/lib/matplotlib/afm.py @@ -165,7 +165,8 @@ def _parse_char_metrics(fh): num = _to_int(vals[0].split()[1]) wx = _to_float(vals[1].split()[1]) name = vals[2].split()[1] - bbox = _to_list_of_ints(vals[3][2:]) + bbox = _to_list_of_floats(vals[3][2:]) + bbox = map(int, bbox) # Workaround: If the character name is 'Euro', give it the corresponding # character code, according to WinAnsiEncoding (see PDF Reference). if name == 'Euro': From f7a2a2139bef7d8154f7c4cf1f9e7b6ecf9f70d6 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Wed, 16 Sep 2009 23:38:54 +0000 Subject: [PATCH 207/324] Don't use wxversion with py2exe; fix by Werner Bruhin svn path=/branches/v0_99_maint/; revision=7770 --- lib/matplotlib/backends/backend_wx.py | 41 ++++++++++++++------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 8e2e7eeb5cdf..219af94a9dc2 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -110,24 +110,25 @@ missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython >=2.8" -try: - import wxversion -except ImportError: - raise ImportError(missingwx) - -# Some early versions of wxversion lack AlreadyImportedError. -# It was added around 2.8.4? -try: - _wx_ensure_failed = wxversion.AlreadyImportedError -except AttributeError: - _wx_ensure_failed = wxversion.VersionError - -try: - wxversion.ensureMinimal('2.8') -except _wx_ensure_failed: - pass -# We don't really want to pass in case of VersionError, but when -# AlreadyImportedError is not available, we have to. +if not hasattr(sys, 'frozen'): # i.e., not py2exe + try: + import wxversion + except ImportError: + raise ImportError(missingwx) + + # Some early versions of wxversion lack AlreadyImportedError. + # It was added around 2.8.4? + try: + _wx_ensure_failed = wxversion.AlreadyImportedError + except AttributeError: + _wx_ensure_failed = wxversion.VersionError + + try: + wxversion.ensureMinimal('2.8') + except _wx_ensure_failed: + pass + # We don't really want to pass in case of VersionError, but when + # AlreadyImportedError is not available, we have to. try: import wx @@ -776,7 +777,7 @@ def do_nothing(*args, **kwargs): bind(self, wx.EVT_MIDDLE_DOWN, self._onMiddleButtonDown) bind(self, wx.EVT_MIDDLE_DCLICK, self._onMiddleButtonDown) bind(self, wx.EVT_MIDDLE_UP, self._onMiddleButtonUp) - + self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) self.macros = {} # dict from wx id to seq of macros @@ -1257,7 +1258,7 @@ def _onLeftButtonUp(self, evt): if self.HasCapture(): self.ReleaseMouse() FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt) - #Add middle button events + #Add middle button events def _onMiddleButtonDown(self, evt): """Start measuring on an axis.""" x = evt.GetX() From c8edcddf91954761cc31794134affb4bb5ae85b0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 17 Sep 2009 14:17:48 +0000 Subject: [PATCH 208/324] Fix clip path in SVG backend. svn path=/branches/v0_99_maint/; revision=7772 --- lib/matplotlib/backends/backend_svg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index d9e1c4d3355f..061d6746805d 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -158,6 +158,7 @@ def _get_gc_clip_svg(self, gc): cliprect = gc.get_clip_rectangle() clippath, clippath_trans = gc.get_clip_path() if clippath is not None: + clippath_trans = self._make_flip_transform(clippath_trans) path_data = self._convert_path(clippath, clippath_trans) path = '' % path_data elif cliprect is not None: @@ -643,7 +644,7 @@ def _print_svg(self, filename, svgwriter, fh_to_close=None, **kwargs): # the problem. I hope someone who knows the svg backends # take a look at this problem. Meanwhile, the dpi # parameter is ignored and image_dpi is fixed at 72. - JJL - + #image_dpi = kwargs.pop("dpi", 72) image_dpi = 72 _bbox_inches_restore = kwargs.pop("bbox_inches_restore", None) From 30ba93fd8782026cb8fd27eb3dcfd7f1c5b530ba Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 17 Sep 2009 14:56:00 +0000 Subject: [PATCH 209/324] Fix bug whereby non-finite values in the path were not being ignored by the view limits finding algorithm. svn path=/branches/v0_99_maint/; revision=7774 --- src/_path.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/_path.cpp b/src/_path.cpp index 1baf9f0f883e..1ef9d6f94a41 100644 --- a/src/_path.cpp +++ b/src/_path.cpp @@ -270,12 +270,14 @@ void get_path_extents(PathIterator& path, const agg::trans_affine& trans, double* xm, double* ym) { typedef agg::conv_transform transformed_path_t; - typedef agg::conv_curve curve_t; + typedef PathNanRemover nan_removed_t; + typedef agg::conv_curve curve_t; double x, y; unsigned code; transformed_path_t tpath(path, trans); - curve_t curved_path(tpath); + nan_removed_t nan_removed(tpath, true, path.has_curves()); + curve_t curved_path(nan_removed); curved_path.rewind(0); @@ -283,11 +285,6 @@ void get_path_extents(PathIterator& path, const agg::trans_affine& trans, { if ((code & agg::path_cmd_end_poly) == agg::path_cmd_end_poly) continue; - /* if (MPL_notisfinite64(x) || MPL_notisfinite64(y)) - continue; - We should not need the above, because the path iterator - should already be filtering out invalid values. - */ if (x < *x0) *x0 = x; if (y < *y0) *y0 = y; if (x > *x1) *x1 = x; From 2543b01490ca2d4d674bfe02afbb153478506a8e Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 17 Sep 2009 17:06:02 +0000 Subject: [PATCH 210/324] add make.osx to manifest svn path=/branches/v0_99_maint/; revision=7776 --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index ffe50a0bbbdd..899aff6e51e9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ include CHANGELOG KNOWN_BUGS INSTALL include INTERACTIVE TODO -include Makefile MANIFEST.in MANIFEST +include Makefile make.osx MANIFEST.in MANIFEST include matplotlibrc.template setup.cfg.template include __init__.py setupext.py setup.py setupegg.py include examples/data/* From 6354764190f2ca451841b897ec94af9e61576a6b Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Thu, 17 Sep 2009 21:42:03 +0000 Subject: [PATCH 211/324] fix the legend bug that dash-style for LineCollections handle is set incorrectly svn path=/branches/v0_99_maint/; revision=7778 --- lib/matplotlib/legend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index ac95d1f4b85e..dd56198775e6 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -513,7 +513,8 @@ def _init_legend_box(self, handles, labels): color = handle.get_colors()[0] legline.set_color(color) legline.set_linewidth(lw) - legline.set_dashes(dashes) + if dashes[0] is not None: # dashed line + legline.set_dashes(dashes[1]) handle_list.append(legline) elif isinstance(handle, RegularPolyCollection): From 55a5cfa384cd5ea9a9494006fbce2ac2ef627914 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Fri, 18 Sep 2009 02:48:03 +0000 Subject: [PATCH 212/324] Fix garbled getp output svn path=/branches/v0_99_maint/; revision=7780 --- lib/matplotlib/artist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 97e2dc363c44..65f1cdf151bf 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -1001,7 +1001,7 @@ def pprint_getters(self): s = s.replace('\n', ' ') if len(s)>50: s = s[:50] + '...' - name = self.aliased_name(name[4:]) + name = self.aliased_name(name) lines.append(' %s = %s' %(name, s)) return lines From 1a987aa0e4d02aa67b0c022e13e62bb297a2f4c3 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 18 Sep 2009 15:16:20 +0000 Subject: [PATCH 213/324] Fix bug where subslicing was cutting polar lines off (because it was treating them as if they were rectilinearly plotted). svn path=/branches/v0_99_maint/; revision=7784 --- lib/matplotlib/lines.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 5b82071f8717..544ce0a0347a 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -459,7 +459,10 @@ def recache(self): self._y = self._xy[:, 1] # just a view self._subslice = False - if self.axes and len(x) > 100 and self._is_sorted(x): + if (self.axes and len(x) > 100 and self._is_sorted(x) and + self.axes.name == 'rectilinear' and + self.axes.get_xscale() == 'linear' and + self.axes.get_yscale() == 'linear'): self._subslice = True if hasattr(self, '_path'): interpolation_steps = self._path._interpolation_steps From 9c7ee1e5410b67678bce307099f97f2c685c75bf Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sat, 19 Sep 2009 02:53:06 +0000 Subject: [PATCH 214/324] Fix bug in maxdict when replacing an existing item svn path=/branches/v0_99_maint/; revision=7788 --- lib/matplotlib/cbook.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 85fb1a0ac8c8..77ba25095529 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -780,11 +780,12 @@ def __init__(self, maxsize): self.maxsize = maxsize self._killkeys = [] def __setitem__(self, k, v): - if len(self)>=self.maxsize: - del self[self._killkeys[0]] - del self._killkeys[0] + if k not in self: + if len(self)>=self.maxsize: + del self[self._killkeys[0]] + del self._killkeys[0] + self._killkeys.append(k) dict.__setitem__(self, k, v) - self._killkeys.append(k) From 04198bfd51f292269b58b0a2ce58930347c2c614 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sat, 19 Sep 2009 06:28:43 +0000 Subject: [PATCH 215/324] Fix bug in mlab.demean, with axis = -1 svn path=/branches/v0_99_maint/; revision=7790 --- lib/matplotlib/mlab.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index a773514a52ba..cc72c7fe9859 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -173,11 +173,11 @@ def detrend(x, key=None): def demean(x, axis=0): "Return x minus its mean along the specified axis" x = np.asarray(x) - if axis: - ind = [slice(None)] * axis - ind.append(np.newaxis) - return x - x.mean(axis)[ind] - return x - x.mean(axis) + if axis == 0 or axis is None or x.ndim <= 1: + return x - x.mean(axis) + ind = [slice(None)] * x.ndim + ind[axis] = np.newaxis + return x - x.mean(axis)[ind] def detrend_mean(x): "Return x minus the mean(x)" From 6688edb4173a19c61a353cc3c32b1012de4f8ecb Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sat, 19 Sep 2009 23:46:06 +0000 Subject: [PATCH 216/324] Fix bug in bar affecting autoscaling with log axis svn path=/branches/v0_99_maint/; revision=7792 --- lib/matplotlib/axes.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 2f939ed5a789..cd9ebfd530a3 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -204,7 +204,7 @@ def _xy_from_xy(self, x, y): bx = self.axes.xaxis.update_units(x) by = self.axes.yaxis.update_units(y) - if self.command!='plot': + if self.command!='plot': # the Line2D class can handle unitized data, with # support for post hoc unit changes etc. Other mpl # artists, eg Polygon which _process_plot_var_args @@ -4213,13 +4213,6 @@ def make_iterable(x): else: raise ValueError, 'invalid orientation: %s' % orientation - - # do not convert to array here as unit info is lost - #left = np.asarray(left) - #height = np.asarray(height) - #width = np.asarray(width) - #bottom = np.asarray(bottom) - if len(linewidth) < nbars: linewidth *= nbars @@ -4334,7 +4327,7 @@ def make_iterable(x): if adjust_xlim: xmin, xmax = self.dataLim.intervalx - xmin = np.amin(width[width!=0]) # filter out the 0 width rects + xmin = np.amin([w for w in width if w > 0]) if xerr is not None: xmin = xmin - np.amax(xerr) xmin = max(xmin*0.9, 1e-100) @@ -4342,7 +4335,7 @@ def make_iterable(x): if adjust_ylim: ymin, ymax = self.dataLim.intervaly - ymin = np.amin(height[height!=0]) # filter out the 0 height rects + ymin = np.amin([h for h in height if h > 0]) if yerr is not None: ymin = ymin - np.amax(yerr) ymin = max(ymin*0.9, 1e-100) From 737acdf3efee2960e106dcab778287a29a282495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 20 Sep 2009 12:30:22 +0000 Subject: [PATCH 217/324] Prevent exception in case of missing height and depth information in a TeX font svn path=/branches/v0_99_maint/; revision=7794 --- CHANGELOG | 4 ++++ lib/matplotlib/dviread.py | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6c18c2789ee2..91076e87d332 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2009-09-20 Prevent exception in case of missing height and depth information + in a TeX font - this doesn't make the typesetting right, but prevents + the crash - JKS + 2009-09-15 Don't fail on AFM files containing floating-point bounding boxes - JKS 2009-08-06 Tagging the 0.99.0 release at svn r7397 - JDH diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py index dea194a737cf..8dc59f92c1a7 100644 --- a/lib/matplotlib/dviread.py +++ b/lib/matplotlib/dviread.py @@ -88,8 +88,7 @@ def _output(self): e = 0 # zero depth else: # glyph x,y,font,g,w = elt - h = _mul2012(font._scale, font._tfm.height[g]) - e = _mul2012(font._scale, font._tfm.depth[g]) + h,e = font._height_depth_of(g) minx = min(minx, x) miny = min(miny, y - h) maxx = max(maxx, x + w) @@ -443,6 +442,24 @@ def _width_of(self, char): 'debug') return 0 + def _height_depth_of(self, char): + """ + Height and depth of char in dvi units. For internal use by dviread.py. + """ + + result = [] + for metric,name in ((self._tfm.height, "height"), + (self._tfm.depth, "depth")): + value = metric.get(char, None) + if value is None: + matplotlib.verbose.report( + 'No %s for char %d in font %s' % (name, char, self.texname), + 'debug') + result.append(0) + else: + result.append(_mul2012(value, self._scale)) + return result + class Vf(Dvi): """ A virtual font (\*.vf file) containing subroutines for dvi files. From ab6cba9bb4e0ecf755ea4cf28031e77c62ae2976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 20 Sep 2009 13:19:25 +0000 Subject: [PATCH 218/324] Fix off-by-one error in dviread.Tfm svn path=/branches/v0_99_maint/; revision=7796 --- CHANGELOG | 5 ++--- lib/matplotlib/dviread.py | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 91076e87d332..7353733016de 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,5 @@ -2009-09-20 Prevent exception in case of missing height and depth information - in a TeX font - this doesn't make the typesetting right, but prevents - the crash - JKS +2009-09-20 Fix off-by-one error in dviread.Tfm, and additionally protect + against exceptions in case a dvi font is missing some metrics - JKS 2009-09-15 Don't fail on AFM files containing floating-point bounding boxes - JKS diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py index 8dc59f92c1a7..5843a3c5894d 100644 --- a/lib/matplotlib/dviread.py +++ b/lib/matplotlib/dviread.py @@ -415,7 +415,7 @@ def __init__(self, scale, tfm, texname, vf): scale, tfm, texname, vf self.size = scale * (72.0 / (72.27 * 2**16)) try: - nchars = max(tfm.width.iterkeys()) + nchars = max(tfm.width.iterkeys()) + 1 except ValueError: nchars = 0 self.widths = [ (1000*tfm.width.get(char, 0)) >> 20 @@ -619,11 +619,10 @@ def __init__(self, filename): widths, heights, depths = \ [ struct.unpack('!%dI' % (len(x)/4), x) for x in (widths, heights, depths) ] - for i in range(ec-bc): - self.width[bc+i] = _fix2comp(widths[ord(char_info[4*i])]) - self.height[bc+i] = _fix2comp(heights[ord(char_info[4*i+1]) >> 4]) - self.depth[bc+i] = _fix2comp(depths[ord(char_info[4*i+1]) & 0xf]) - + for idx, char in enumerate(range(bc, ec+1)): + self.width[char] = _fix2comp(widths[ord(char_info[4*idx])]) + self.height[char] = _fix2comp(heights[ord(char_info[4*idx+1]) >> 4]) + self.depth[char] = _fix2comp(depths[ord(char_info[4*idx+1]) & 0xf]) class PsfontsMap(object): """ From 8fd76a58ceeeb82cdb5fd0a426196382fd036530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 20 Sep 2009 19:47:46 +0000 Subject: [PATCH 219/324] Fix usetex spacing errors in pdf backend. svn path=/branches/v0_99_maint/; revision=7800 --- CHANGELOG | 4 +++- lib/matplotlib/backends/backend_pdf.py | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7353733016de..0d959da64a88 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ +2009-09-20 Fix usetex spacing errors in pdf backend. - JKS + 2009-09-20 Fix off-by-one error in dviread.Tfm, and additionally protect - against exceptions in case a dvi font is missing some metrics - JKS + against exceptions in case a dvi font is missing some metrics. - JKS 2009-09-15 Don't fail on AFM files containing floating-point bounding boxes - JKS diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 763cc1678019..2d95876c3ca2 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -1416,7 +1416,14 @@ def draw_tex(self, gc, x, y, s, prop, angle): dvi.close() # Gather font information and do some setup for combining - # characters into strings. + # characters into strings. The variable seq will contain a + # sequence of font and text entries. A font entry is a list + # ['font', name, size] where name is a Name object for the + # font. A text entry is ['text', x, y, glyphs, x+w] where x + # and y are the starting coordinates, w is the width, and + # glyphs is a list; in this phase it will always contain just + # one one-character string, but later it may have longer + # strings interspersed with kern amounts. oldfont, seq = None, [] for x1, y1, dvifont, glyph, width in page.text: if dvifont != oldfont: @@ -1436,16 +1443,18 @@ def draw_tex(self, gc, x, y, s, prop, angle): # Find consecutive text strings with constant y coordinate and # combine into a sequence of strings and kerns, or just one # string (if any kerns would be less than 0.1 points). - i, curx = 0, 0 + i, curx, fontsize = 0, 0, None while i < len(seq)-1: elt, next = seq[i:i+2] - if elt[0] == next[0] == 'text' and elt[2] == next[2]: + if elt[0] == 'font': + fontsize = elt[2] + elif elt[0] == next[0] == 'text' and elt[2] == next[2]: offset = elt[4] - next[1] if abs(offset) < 0.1: elt[3][-1] += next[3][0] elt[4] += next[4]-next[1] else: - elt[3] += [offset*1000.0/dvifont.size, next[3][0]] + elt[3] += [offset*1000.0/fontsize, next[3][0]] elt[4] = next[4] del seq[i+1] continue From 364d3e4bce7d4bde51a71ea5c004ba52821a8860 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 21 Sep 2009 11:57:17 +0000 Subject: [PATCH 220/324] Fix 'variable used before defined' errors in backend_pdf.py building the docs svn path=/branches/v0_99_maint/; revision=7803 --- lib/matplotlib/backends/backend_pdf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 2d95876c3ca2..53c1fde8a79c 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -524,19 +524,18 @@ def writeFonts(self): if filename.endswith('.afm'): # from pdf.use14corefonts matplotlib.verbose.report('Writing AFM font', 'debug') - fontdictObject = self._write_afm_font(filename) + fonts[Fx] = self._write_afm_font(filename) elif self.dviFontInfo.has_key(filename): # a Type 1 font from a dvi file; the filename is really the TeX name matplotlib.verbose.report('Writing Type-1 font', 'debug') - fontdictObject = self.embedTeXFont(filename, self.dviFontInfo[filename]) + fonts[Fx] = self.embedTeXFont(filename, self.dviFontInfo[filename]) else: # a normal TrueType font matplotlib.verbose.report('Writing TrueType font', 'debug') realpath, stat_key = get_realpath_and_stat(filename) chars = self.used_characters.get(stat_key) if chars is not None and len(chars[1]): - fontdictObject = self.embedTTF(realpath, chars[1]) - fonts[Fx] = fontdictObject + fonts[Fx] = self.embedTTF(realpath, chars[1]) self.writeObject(self.fontObject, fonts) def _write_afm_font(self, filename): From 2fdec7b916ed0b1cb88ce72d90ea4aa7d0fbb665 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 21 Sep 2009 16:30:11 +0000 Subject: [PATCH 221/324] Correct typo of subtitle() -> suptitle(). svn path=/branches/v0_99_maint/; revision=7808 --- CHANGELOG | 2 +- lib/matplotlib/figure.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0d959da64a88..86bdd1d7206f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -890,7 +890,7 @@ 2008-06-05 Fix image drawing so there is no extra space to the right or bottom - MGD -2006-06-04 Added a figure title command subtitle as a Figure method +2006-06-04 Added a figure title command suptitle as a Figure method and pyplot command -- see examples/figure_title.py - JDH 2008-06-02 Added support for log to hist with histtype='step' and fixed diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 404ac7fd205e..1c18b66a93db 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -298,7 +298,7 @@ def suptitle(self, t, **kwargs): Example:: - fig.subtitle('this is the figure title', fontsize=12) + fig.suptitle('this is the figure title', fontsize=12) """ x = kwargs.pop('x', 0.5) y = kwargs.pop('y', 0.98) From b867cc3057dc1dc760feb9f8690cf9e6bf6d5ff2 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 21 Sep 2009 17:12:47 +0000 Subject: [PATCH 222/324] tag for 0.99.1 release svn path=/branches/v0_99_maint/; revision=7813 --- CHANGELOG | 3 +++ doc/_templates/indexsidebar.html | 7 +++++-- lib/matplotlib/__init__.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 86bdd1d7206f..50e6f2cbc943 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +=============================================== +2009-09-21 Tagged for release 0.99.1 + 2009-09-20 Fix usetex spacing errors in pdf backend. - JKS 2009-09-20 Fix off-by-one error in dviread.Tfm, and additionally protect diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html index e1fcb7340bb6..13481ce858bc 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -2,8 +2,11 @@

News

Please donate to support matplotlib development.

- -

matplotlib 0.99 is available for download. See what's new and tips on available for testing. Please report any problems on the tracker and mailing list. +

+ +

matplotlib 0.99.0 is available for download. See what's new and tips on installing

diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index e3d0cb068bc8..90a8b248b01c 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.1rc1' +__version__ = '0.99.1' __revision__ = '$Revision$' __date__ = '$Date$' From 027891b8c87e14faa76768ccea8f31d040ccd671 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 24 Sep 2009 03:00:28 +0000 Subject: [PATCH 223/324] try statically linking in the deps for OSX svn path=/branches/v0_99_maint/; revision=7818 --- lib/matplotlib/__init__.py | 2 +- make.osx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 90a8b248b01c..6ed461c7cc0f 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.1' +__version__ = '0.99.1.1' __revision__ = '$Revision$' __date__ = '$Date$' diff --git a/make.osx b/make.osx index 95875c748546..9fa58dcebc96 100644 --- a/make.osx +++ b/make.osx @@ -1,8 +1,8 @@ # build mpl into a local install dir with # PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install -MPLVERSION=0.99.1rc1 -PYVERSION=2.6 +MPLVERSION=0.99.1.1 +PYVERSION=2.5 PYTHON=python${PYVERSION} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 @@ -90,6 +90,7 @@ binaries: cp release/osx/data/setup.cfg release/osx/data/ReadMe.txt . &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ + rm -f ${PREFIX}/lib/*.dylib &&\ /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg --readme=ReadMe.txt &&\ hdiutil create -srcdir dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.dmg &&\ ${PYTHON} setupegg.py bdist_egg From 77ddd83fd6293336dc1fd2dc3cbcf2d3a9b61f32 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 24 Sep 2009 03:57:31 +0000 Subject: [PATCH 224/324] applied a fix for sf bug 2865490; is there something more elegant? svn path=/branches/v0_99_maint/; revision=7819 --- make.osx | 2 +- src/_backend_agg.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/make.osx b/make.osx index 9fa58dcebc96..eae1e0c17dfe 100644 --- a/make.osx +++ b/make.osx @@ -2,7 +2,7 @@ # PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install MPLVERSION=0.99.1.1 -PYVERSION=2.5 +PYVERSION=2.6 PYTHON=python${PYVERSION} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 24a018d59b1a..70c6e6dde9be 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -607,6 +607,14 @@ RendererAgg::draw_markers(const Py::Tuple& args) { x = (double)(int)x; y = (double)(int)y; + // if x or y is close to the width or height, the filled + // region could be inside the boundary even if the center is + // out. But at some point we need to cull these points + // because they can create segfaults of they overflow; eg + // https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 + if (fabs(x)>(2*width)) continue; + if (fabs(y)>(2*height)) continue; + pixfmt_amask_type pfa(pixFmt, alphaMask); amask_ren_type r(pfa); amask_aa_renderer_type ren(r); @@ -628,6 +636,14 @@ RendererAgg::draw_markers(const Py::Tuple& args) { x = (double)(int)x; y = (double)(int)y; + // if x or y is close to the width or height, the filled + // region could be inside the boundary even if the center is + // out. But at some point we need to cull these points + // because they can create segfaults of they overflow; eg + // https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 + if (fabs(x)>(2*width)) continue; + if (fabs(y)>(2*height)) continue; + if (face.first) { rendererAA.color(face.second); sa.init(fillCache, fillSize, x, y); From b27a3bc81e67d7a2cad681dd01e2a6f05140b07d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 24 Sep 2009 17:03:13 +0000 Subject: [PATCH 225/324] Clip markers in draw_marker outside of the image rectangle with an extra border to accomodate the size of the marker. svn path=/branches/v0_99_maint/; revision=7822 --- src/_backend_agg.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 70c6e6dde9be..99ee0aebdd8a 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -599,6 +599,12 @@ RendererAgg::draw_markers(const Py::Tuple& args) { agg::serialized_scanlines_adaptor_aa8 sa; agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl; + agg::rect_d clipping_rect( + -(scanlines.min_x() + 1.0), + -(scanlines.min_y() + 1.0), + width + scanlines.max_x() + 1.0, + height + scanlines.max_y() + 1.0); + if (has_clippath) { while (path_curve.vertex(&x, &y) != agg::path_cmd_stop) { if (MPL_notisfinite64(x) || MPL_notisfinite64(y)) { @@ -607,13 +613,13 @@ RendererAgg::draw_markers(const Py::Tuple& args) { x = (double)(int)x; y = (double)(int)y; - // if x or y is close to the width or height, the filled - // region could be inside the boundary even if the center is - // out. But at some point we need to cull these points + // Cull points outside the boundary of the image. Values + // that are too large may overflow and create segfaults. // because they can create segfaults of they overflow; eg - // https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 - if (fabs(x)>(2*width)) continue; - if (fabs(y)>(2*height)) continue; + // http://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 + if (!clipping_rect.hit_test(x, y)) { + continue; + } pixfmt_amask_type pfa(pixFmt, alphaMask); amask_ren_type r(pfa); @@ -636,13 +642,13 @@ RendererAgg::draw_markers(const Py::Tuple& args) { x = (double)(int)x; y = (double)(int)y; - // if x or y is close to the width or height, the filled - // region could be inside the boundary even if the center is - // out. But at some point we need to cull these points + // Cull points outside the boundary of the image. Values + // that are too large may overflow and create segfaults. // because they can create segfaults of they overflow; eg - // https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 - if (fabs(x)>(2*width)) continue; - if (fabs(y)>(2*height)) continue; + // http://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 + if (!clipping_rect.hit_test(x, y)) { + continue; + } if (face.first) { rendererAA.color(face.second); From 5f53c0a2e385b59ffdd0f55654f355262dac288d Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Fri, 25 Sep 2009 23:56:14 +0000 Subject: [PATCH 226/324] Fix bug in quiver handling of masked U, V svn path=/branches/v0_99_maint/; revision=7827 --- lib/matplotlib/quiver.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index 2af5784236b0..961a1f985aee 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -516,6 +516,11 @@ def _make_verts(self, U, V): xy = (X+Y*1j) * np.exp(1j*theta)*self.width xy = xy[:,:,np.newaxis] XY = np.concatenate((xy.real, xy.imag), axis=2) + if self.Umask is not ma.nomask: + XY = ma.array(XY) + XY[self.Umask] = ma.masked + # This might be handled more efficiently with nans, given + # that nans will end up in the paths anyway. return XY @@ -573,10 +578,7 @@ def _h_arrows(self, length): tooshort = np.repeat(tooshort, 8, 1) np.putmask(X, tooshort, X1) np.putmask(Y, tooshort, Y1) - if self.Umask is not ma.nomask: - mask = np.repeat(self.Umask[:,np.newaxis], 8, 1) - X = ma.array(X, mask=mask, copy=False) - Y = ma.array(Y, mask=mask, copy=False) + # Mask handling is deferred to the caller, _make_verts. return X, Y quiver_doc = _quiver_doc From 3c11f76552c7e221205f1b990cf530d6542efa30 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 30 Sep 2009 13:26:36 +0000 Subject: [PATCH 227/324] Fix Grouper docstring -- it only supports weak-referenceable objects. svn path=/branches/v0_99_maint/; revision=7834 --- lib/matplotlib/cbook.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 77ba25095529..ea5dc004c8ac 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -1062,21 +1062,28 @@ class Grouper(object): using :meth:`joined`, and all disjoint sets can be retreived by using the object as an iterator. - The objects being joined must be hashable. + The objects being joined must be hashable and weak-referenceable. For example: - >>> g = grouper.Grouper() - >>> g.join('a', 'b') - >>> g.join('b', 'c') - >>> g.join('d', 'e') + >>> class Foo: + ... def __init__(self, s): + ... self.s = s + ... def __repr__(self): + ... return self.s + ... + >>> a, b, c, d, e, f = [Foo(x) for x in 'abcdef'] + >>> g = Grouper() + >>> g.join(a, b) + >>> g.join(b, c) + >>> g.join(d, e) >>> list(g) - [['a', 'b', 'c'], ['d', 'e']] - >>> g.joined('a', 'b') + [[d, e], [a, b, c]] + >>> g.joined(a, b) True - >>> g.joined('a', 'c') + >>> g.joined(a, c) True - >>> g.joined('a', 'd') + >>> g.joined(a, d) False """ def __init__(self, init=[]): From 44b00fe0c99b19000d1a725676d3824cee788add Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 1 Oct 2009 12:37:49 +0000 Subject: [PATCH 228/324] Fix alpha of Shadow patch. svn path=/branches/v0_99_maint/; revision=7837 --- lib/matplotlib/patches.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 6b75d478f577..f094970b37d4 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -415,6 +415,7 @@ def _update(self): self.set_facecolor((r,g,b,0.5)) self.set_edgecolor((r,g,b,0.5)) + self.set_alpha(0.5) def _update_transform(self, renderer): ox = renderer.points_to_pixels(self._ox) From 02ea0e642e0cdea79d080eceae379616b01b8336 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Mon, 5 Oct 2009 02:05:16 +0000 Subject: [PATCH 229/324] image created by imshow support remove method svn path=/branches/v0_99_maint/; revision=7844 --- lib/matplotlib/axes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index cd9ebfd530a3..c903f2dca7e0 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -6293,6 +6293,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None, if self._autoscaleYon: self.set_ylim((ymin, ymax)) self.images.append(im) + im._remove_method = lambda h: self.images.remove(h) return im imshow.__doc__ = cbook.dedent(imshow.__doc__) % martist.kwdocd From c337d9e82ecf07db1dbecd1708faac91d233748d Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Mon, 5 Oct 2009 22:44:38 +0000 Subject: [PATCH 230/324] Tk directory-finding patch by Benjamin Drung. Fixes the following: Guess the correct directory in Debian/Ubuntu fails. Replacing all tcl by tk does not lead to a correct directory: /usr/share/tcltk/tcl8.5 -> /usr/share/tktk/tk8.5 The correct directory is /usr/share/tcltk/tk8.5 svn path=/branches/v0_99_maint/; revision=7846 --- setupext.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setupext.py b/setupext.py index 0c6e888dc5fe..8e181e5e7c05 100644 --- a/setupext.py +++ b/setupext.py @@ -850,7 +850,11 @@ def query_tcltk(): else: tcl_lib_dir = str(tcl.getvar('tcl_library')) # Guess Tk location based on Tcl location - tk_lib_dir = tcl_lib_dir.replace('Tcl', 'Tk').replace('tcl', 'tk') + (head, tail) = os.path.split(tcl_lib_dir) + tail = tail.replace('Tcl', 'Tk').replace('tcl', 'tk') + tk_lib_dir = os.path.join(head, tail) + if not os.path.exists(tk_lib_dir): + tk_lib_dir = tcl_lib_dir.replace('Tcl', 'Tk').replace('tcl', 'tk') else: # Obtain Tcl and Tk locations from Tk widget tk.withdraw() From c233d0f469c5c7ee259b27adf62b0adf3653794c Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Mon, 5 Oct 2009 23:11:10 +0000 Subject: [PATCH 231/324] Add more platforms to setupext.py; patch by Benjamin Drung svn path=/branches/v0_99_maint/; revision=7847 --- setupext.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setupext.py b/setupext.py index 8e181e5e7c05..d0b316561dfe 100644 --- a/setupext.py +++ b/setupext.py @@ -47,6 +47,10 @@ basedir = { 'win32' : ['win32_static',], + 'linux2-alpha' : ['/usr/local', '/usr'], + 'linux2-hppa' : ['/usr/local', '/usr'], + 'linux2-mips' : ['/usr/local', '/usr'], + 'linux2-sparc' : ['/usr/local', '/usr'], 'linux2' : ['/usr/local', '/usr'], 'linux' : ['/usr/local', '/usr',], 'cygwin' : ['/usr/local', '/usr',], @@ -65,6 +69,8 @@ 'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',], 'gnukfreebsd5' : ['/usr/local', '/usr'], 'gnukfreebsd6' : ['/usr/local', '/usr'], + 'gnukfreebsd7' : ['/usr/local', '/usr'], + 'gnukfreebsd8' : ['/usr/local', '/usr'], 'aix5' : ['/usr/local'], } From 5b129b78ae5c6cfe1df51526fdd710d3efb09984 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 6 Oct 2009 14:07:08 +0000 Subject: [PATCH 232/324] Don't do "make.py clean" in terms of svn-clean, since that doesn't work with a tarball. svn path=/branches/v0_99_maint/; revision=7849 --- doc/make.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/make.py b/doc/make.py index caf5d0a62dc1..7d02e778ffb9 100755 --- a/doc/make.py +++ b/doc/make.py @@ -65,7 +65,18 @@ def latex(): print 'latex build has not been tested on windows' def clean(): - os.system('svn-clean') + shutil.rmtree("build") + shutil.rmtree("examples") + for pattern in ['doc/mpl_examples/api/*.png', + 'doc/mpl_examples/pylab_examples/*.png', + 'doc/mpl_examples/pylab_examples/*.pdf', + 'doc/mpl_examples/units/*.png', + 'doc/pyplots/tex_demo.png', + 'doc/_static/matplotlibrc', + 'doc/_templates/gallery.html']: + for filename in glob.glob(pattern): + if os.path.exists(filename): + os.remove(filename) def all(): #figs() @@ -86,6 +97,10 @@ def all(): small_docs = False +# Change directory to the one containing this file +current_dir = os.getcwd() +os.chdir(os.path.dirname(os.path.join(current_dir, __file__))) + if len(sys.argv)>1: if '--small' in sys.argv[1:]: small_docs = True @@ -99,3 +114,4 @@ def all(): else: small_docs = False all() +os.chdir(current_dir) From c42d83921b910015bb5e2ac4b79dcd518121e108 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 9 Oct 2009 15:24:25 +0000 Subject: [PATCH 233/324] Don't perform path simplification when hatch is drawn. svn path=/branches/v0_99_maint/; revision=7858 --- src/_backend_agg.cpp | 390 ++++++++++++++++++++++--------------------- 1 file changed, 196 insertions(+), 194 deletions(-) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 99ee0aebdd8a..9ed6ebf40677 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -56,7 +56,7 @@ (GCAgg::dash_t) */ void convert_dashes(const Py::Tuple& dashes, double dpi, GCAgg::dash_t& dashes_out, - double& dashOffset_out) { + double& dashOffset_out) { if (dashes.length()!=2) throw Py::ValueError(Printf("Dash descriptor must be a length 2 tuple; found %d", dashes.length()).str()); @@ -298,7 +298,7 @@ const size_t RendererAgg::PIXELS_PER_INCH(96); RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi, - int debug) : + int debug) : width(width), height(height), dpi(dpi), @@ -324,7 +324,7 @@ RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi, _VERBOSE("RendererAgg::RendererAgg"); unsigned stride(width*4); - pixBuffer = new agg::int8u[NUMBYTES]; + pixBuffer = new agg::int8u[NUMBYTES]; renderingBuffer.attach(pixBuffer, width, height, stride); pixFmt.attach(renderingBuffer); rendererBase.attach(pixFmt); @@ -337,7 +337,7 @@ RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi, void RendererAgg::create_alpha_buffers() { if (!alphaBuffer) { unsigned stride(width*4); - alphaBuffer = new agg::int8u[NUMBYTES]; + alphaBuffer = new agg::int8u[NUMBYTES]; alphaMaskRenderingBuffer.attach(alphaBuffer, width, height, stride); rendererBaseAlphaMask.attach(pixfmtAlphaMask); rendererAlphaMask.attach(rendererBaseAlphaMask); @@ -428,9 +428,9 @@ RendererAgg::restore_region(const Py::Tuple& args) { agg::rendering_buffer rbuf; rbuf.attach(region->data, - region->width, - region->height, - region->stride); + region->width, + region->height, + region->stride); rendererBase.copy_from(rbuf, 0, region->rect.x1, region->rect.y1); @@ -465,14 +465,14 @@ RendererAgg::restore_region2(const Py::Tuple& args) { throw Py::ValueError("Cannot restore_region from NULL data"); agg::rect_i rect(xx1-region->rect.x1, (yy1-region->rect.y1), - xx2-region->rect.x1, (yy2-region->rect.y1)); + xx2-region->rect.x1, (yy2-region->rect.y1)); agg::rendering_buffer rbuf; rbuf.attach(region->data, - region->width, - region->height, - region->stride); + region->width, + region->height, + region->stride); rendererBase.copy_from(rbuf, &rect, x, y); @@ -512,21 +512,21 @@ bool RendererAgg::render_clippath(const Py::Object& clippath, const agg::trans_a Py::Object RendererAgg::draw_markers(const Py::Tuple& args) { - typedef agg::conv_transform transformed_path_t; - typedef PathQuantizer quantize_t; - typedef agg::conv_curve curve_t; - typedef agg::conv_stroke stroke_t; + typedef agg::conv_transform transformed_path_t; + typedef PathQuantizer quantize_t; + typedef agg::conv_curve curve_t; + typedef agg::conv_stroke stroke_t; typedef agg::pixfmt_amask_adaptor pixfmt_amask_type; - typedef agg::renderer_base amask_ren_type; + typedef agg::renderer_base amask_ren_type; typedef agg::renderer_scanline_aa_solid amask_aa_renderer_type; typedef agg::renderer_scanline_bin_solid amask_bin_renderer_type; args.verify_length(5, 6); - Py::Object gc_obj = args[0]; - Py::Object marker_path_obj = args[1]; + Py::Object gc_obj = args[0]; + Py::Object marker_path_obj = args[1]; agg::trans_affine marker_trans = py_to_agg_transformation_matrix(args[2].ptr()); - Py::Object path_obj = args[3]; - agg::trans_affine trans = py_to_agg_transformation_matrix(args[4].ptr()); + Py::Object path_obj = args[3]; + agg::trans_affine trans = py_to_agg_transformation_matrix(args[4].ptr()); Py::Object face_obj; if (args.size() == 6) face_obj = args[5]; @@ -541,15 +541,15 @@ RendererAgg::draw_markers(const Py::Tuple& args) { PathIterator marker_path(marker_path_obj); transformed_path_t marker_path_transformed(marker_path, marker_trans); quantize_t marker_path_quantized(marker_path_transformed, - gc.quantize_mode, + gc.quantize_mode, marker_path.total_vertices()); curve_t marker_path_curve(marker_path_quantized); PathIterator path(path_obj); transformed_path_t path_transformed(path, trans); quantize_t path_quantized(path_transformed, - gc.quantize_mode, - path.total_vertices()); + gc.quantize_mode, + path.total_vertices()); curve_t path_curve(path_quantized); path_curve.rewind(0); @@ -573,7 +573,7 @@ RendererAgg::draw_markers(const Py::Tuple& args) { agg::render_scanlines(theRasterizer, slineP8, scanlines); fillSize = scanlines.byte_size(); if (fillSize >= MARKER_CACHE_SIZE) - fillCache = new agg::int8u[fillSize]; + fillCache = new agg::int8u[fillSize]; scanlines.serialize(fillCache); } @@ -615,24 +615,24 @@ RendererAgg::draw_markers(const Py::Tuple& args) { // Cull points outside the boundary of the image. Values // that are too large may overflow and create segfaults. - // because they can create segfaults of they overflow; eg - // http://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 + // because they can create segfaults of they overflow; eg + // http://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 if (!clipping_rect.hit_test(x, y)) { continue; } - pixfmt_amask_type pfa(pixFmt, alphaMask); - amask_ren_type r(pfa); - amask_aa_renderer_type ren(r); - - if (face.first) { - ren.color(face.second); - sa.init(fillCache, fillSize, x, y); - agg::render_scanlines(sa, sl, ren); - } - ren.color(gc.color); - sa.init(strokeCache, strokeSize, x, y); - agg::render_scanlines(sa, sl, ren); + pixfmt_amask_type pfa(pixFmt, alphaMask); + amask_ren_type r(pfa); + amask_aa_renderer_type ren(r); + + if (face.first) { + ren.color(face.second); + sa.init(fillCache, fillSize, x, y); + agg::render_scanlines(sa, sl, ren); + } + ren.color(gc.color); + sa.init(strokeCache, strokeSize, x, y); + agg::render_scanlines(sa, sl, ren); } } else { while (path_curve.vertex(&x, &y) != agg::path_cmd_stop) { @@ -644,21 +644,21 @@ RendererAgg::draw_markers(const Py::Tuple& args) { // Cull points outside the boundary of the image. Values // that are too large may overflow and create segfaults. - // because they can create segfaults of they overflow; eg - // http://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 + // because they can create segfaults of they overflow; eg + // http://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720 if (!clipping_rect.hit_test(x, y)) { continue; } - if (face.first) { - rendererAA.color(face.second); - sa.init(fillCache, fillSize, x, y); - agg::render_scanlines(sa, sl, rendererAA); - } + if (face.first) { + rendererAA.color(face.second); + sa.init(fillCache, fillSize, x, y); + agg::render_scanlines(sa, sl, rendererAA); + } - rendererAA.color(gc.color); - sa.init(strokeCache, strokeSize, x, y); - agg::render_scanlines(sa, sl, rendererAA); + rendererAA.color(gc.color); + sa.init(strokeCache, strokeSize, x, y); + agg::render_scanlines(sa, sl, rendererAA); } } } catch(...) { @@ -888,12 +888,12 @@ RendererAgg::draw_image(const Py::Tuple& args) { template void RendererAgg::_draw_path(path_t& path, bool has_clippath, - const facepair_t& face, const GCAgg& gc) { - typedef agg::conv_stroke stroke_t; - typedef agg::conv_dash dash_t; - typedef agg::conv_stroke stroke_dash_t; + const facepair_t& face, const GCAgg& gc) { + typedef agg::conv_stroke stroke_t; + typedef agg::conv_dash dash_t; + typedef agg::conv_stroke stroke_dash_t; typedef agg::pixfmt_amask_adaptor pixfmt_amask_type; - typedef agg::renderer_base amask_ren_type; + typedef agg::renderer_base amask_ren_type; typedef agg::renderer_scanline_aa_solid amask_aa_renderer_type; typedef agg::renderer_scanline_bin_solid amask_bin_renderer_type; @@ -903,25 +903,25 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath, if (gc.isaa) { if (has_clippath) { - pixfmt_amask_type pfa(pixFmt, alphaMask); - amask_ren_type r(pfa); - amask_aa_renderer_type ren(r); - ren.color(face.second); - agg::render_scanlines(theRasterizer, slineP8, ren); + pixfmt_amask_type pfa(pixFmt, alphaMask); + amask_ren_type r(pfa); + amask_aa_renderer_type ren(r); + ren.color(face.second); + agg::render_scanlines(theRasterizer, slineP8, ren); } else { - rendererAA.color(face.second); - agg::render_scanlines(theRasterizer, slineP8, rendererAA); + rendererAA.color(face.second); + agg::render_scanlines(theRasterizer, slineP8, rendererAA); } } else { if (has_clippath) { - pixfmt_amask_type pfa(pixFmt, alphaMask); - amask_ren_type r(pfa); - amask_bin_renderer_type ren(r); - ren.color(face.second); - agg::render_scanlines(theRasterizer, slineP8, ren); + pixfmt_amask_type pfa(pixFmt, alphaMask); + amask_ren_type r(pfa); + amask_bin_renderer_type ren(r); + ren.color(face.second); + agg::render_scanlines(theRasterizer, slineP8, ren); } else { - rendererBin.color(face.second); - agg::render_scanlines(theRasterizer, slineP8, rendererBin); + rendererBin.color(face.second); + agg::render_scanlines(theRasterizer, slineP8, rendererBin); } } } @@ -994,14 +994,14 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath, } else { dash_t dash(path); for (GCAgg::dash_t::const_iterator i = gc.dashes.begin(); - i != gc.dashes.end(); ++i) { - double val0 = i->first; - double val1 = i->second; - if (!gc.isaa) { - val0 = (int)val0 + 0.5; - val1 = (int)val1 + 0.5; - } - dash.add_dash(val0, val1); + i != gc.dashes.end(); ++i) { + double val0 = i->first; + double val1 = i->second; + if (!gc.isaa) { + val0 = (int)val0 + 0.5; + val1 = (int)val1 + 0.5; + } + dash.add_dash(val0, val1); } stroke_dash_t stroke(dash); stroke.line_cap(gc.cap); @@ -1012,25 +1012,25 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath, if (gc.isaa) { if (has_clippath) { - pixfmt_amask_type pfa(pixFmt, alphaMask); - amask_ren_type r(pfa); - amask_aa_renderer_type ren(r); - ren.color(gc.color); - agg::render_scanlines(theRasterizer, slineP8, ren); + pixfmt_amask_type pfa(pixFmt, alphaMask); + amask_ren_type r(pfa); + amask_aa_renderer_type ren(r); + ren.color(gc.color); + agg::render_scanlines(theRasterizer, slineP8, ren); } else { - rendererAA.color(gc.color); - agg::render_scanlines(theRasterizer, slineP8, rendererAA); + rendererAA.color(gc.color); + agg::render_scanlines(theRasterizer, slineP8, rendererAA); } } else { if (has_clippath) { - pixfmt_amask_type pfa(pixFmt, alphaMask); - amask_ren_type r(pfa); - amask_bin_renderer_type ren(r); - ren.color(gc.color); - agg::render_scanlines(theRasterizer, slineP8, ren); + pixfmt_amask_type pfa(pixFmt, alphaMask); + amask_ren_type r(pfa); + amask_bin_renderer_type ren(r); + ren.color(gc.color); + agg::render_scanlines(theRasterizer, slineP8, ren); } else { - rendererBin.color(gc.color); - agg::render_scanlines(theRasterizer, slineBin, rendererBin); + rendererBin.color(gc.color); + agg::render_scanlines(theRasterizer, slineBin, rendererBin); } } } @@ -1066,8 +1066,8 @@ RendererAgg::draw_path(const Py::Tuple& args) { trans *= agg::trans_affine_scaling(1.0, -1.0); trans *= agg::trans_affine_translation(0.0, (double)height); - bool clip = !face.first; - bool simplify = path.should_simplify() && !face.first; + bool clip = !face.first && gc.hatchpath.isNone(); + bool simplify = path.should_simplify() && clip; transformed_path_t tpath(path, trans); nan_removed_t nan_removed(tpath, true, path.has_curves()); @@ -1088,11 +1088,11 @@ RendererAgg::draw_path(const Py::Tuple& args) { template Py::Object RendererAgg::_draw_path_collection_generic - (agg::trans_affine master_transform, - const Py::Object& cliprect, - const Py::Object& clippath, + (agg::trans_affine master_transform, + const Py::Object& cliprect, + const Py::Object& clippath, const agg::trans_affine& clippath_trans, - const PathGenerator& path_generator, + const PathGenerator& path_generator, const Py::SeqBase& transforms_obj, const Py::Object& offsets_obj, const agg::trans_affine& offset_trans, @@ -1105,8 +1105,8 @@ RendererAgg::_draw_path_collection_generic typedef PathNanRemover nan_removed_t; typedef PathClipper clipped_t; typedef PathQuantizer quantized_t; - typedef agg::conv_curve quantized_curve_t; - typedef agg::conv_curve curve_t; + typedef agg::conv_curve quantized_curve_t; + typedef agg::conv_curve curve_t; GCAgg gc(dpi); @@ -1118,34 +1118,34 @@ RendererAgg::_draw_path_collection_generic offsets = (PyArrayObject*)PyArray_FromObject (offsets_obj.ptr(), PyArray_DOUBLE, 0, 2); if (!offsets || - (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || - (PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) { + (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || + (PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) { throw Py::ValueError("Offsets array must be Nx2"); } PyArrayObject* facecolors = (PyArrayObject*)PyArray_FromObject (facecolors_obj.ptr(), PyArray_DOUBLE, 1, 2); if (!facecolors || - (PyArray_NDIM(facecolors) == 1 && PyArray_DIM(facecolors, 0) != 0) || - (PyArray_NDIM(facecolors) == 2 && PyArray_DIM(facecolors, 1) != 4)) + (PyArray_NDIM(facecolors) == 1 && PyArray_DIM(facecolors, 0) != 0) || + (PyArray_NDIM(facecolors) == 2 && PyArray_DIM(facecolors, 1) != 4)) throw Py::ValueError("Facecolors must be a Nx4 numpy array or empty"); PyArrayObject* edgecolors = (PyArrayObject*)PyArray_FromObject (edgecolors_obj.ptr(), PyArray_DOUBLE, 1, 2); if (!edgecolors || - (PyArray_NDIM(edgecolors) == 1 && PyArray_DIM(edgecolors, 0) != 0) || - (PyArray_NDIM(edgecolors) == 2 && PyArray_DIM(edgecolors, 1) != 4)) + (PyArray_NDIM(edgecolors) == 1 && PyArray_DIM(edgecolors, 0) != 0) || + (PyArray_NDIM(edgecolors) == 2 && PyArray_DIM(edgecolors, 1) != 4)) throw Py::ValueError("Edgecolors must be a Nx4 numpy array"); size_t Npaths = path_generator.num_paths(); size_t Noffsets = offsets->dimensions[0]; - size_t N = std::max(Npaths, Noffsets); + size_t N = std::max(Npaths, Noffsets); size_t Ntransforms = std::min(transforms_obj.length(), N); size_t Nfacecolors = facecolors->dimensions[0]; size_t Nedgecolors = edgecolors->dimensions[0]; size_t Nlinewidths = linewidths.length(); size_t Nlinestyles = std::min(linestyles_obj.length(), N); - size_t Naa = antialiaseds.length(); + size_t Naa = antialiaseds.length(); if ((Nfacecolors == 0 && Nedgecolors == 0) || Npaths == 0) return Py::Object(); @@ -1158,7 +1158,7 @@ RendererAgg::_draw_path_collection_generic transforms.reserve(Ntransforms); for (i = 0; i < Ntransforms; ++i) { agg::trans_affine trans = py_to_agg_transformation_matrix - (transforms_obj[i].ptr(), false); + (transforms_obj[i].ptr(), false); trans *= master_transform; transforms.push_back(trans); @@ -1170,7 +1170,7 @@ RendererAgg::_draw_path_collection_generic dashes.resize(Nlinestyles); i = 0; for (dashes_t::iterator d = dashes.begin(); - d != dashes.end(); ++d, ++i) { + d != dashes.end(); ++d, ++i) { convert_dashes(Py::Tuple(linestyles_obj[i]), dpi, d->second, d->first); } @@ -1190,16 +1190,16 @@ RendererAgg::_draw_path_collection_generic typename PathGenerator::path_iterator path = path_generator(i); if (Ntransforms) { - trans = transforms[i % Ntransforms]; + trans = transforms[i % Ntransforms]; } else { - trans = master_transform; + trans = master_transform; } if (Noffsets) { - double xo = *(double*)PyArray_GETPTR2(offsets, i % Noffsets, 0); - double yo = *(double*)PyArray_GETPTR2(offsets, i % Noffsets, 1); - offset_trans.transform(&xo, &yo); - trans *= agg::trans_affine_translation(xo, yo); + double xo = *(double*)PyArray_GETPTR2(offsets, i % Noffsets, 0); + double yo = *(double*)PyArray_GETPTR2(offsets, i % Noffsets, 1); + offset_trans.transform(&xo, &yo); + trans *= agg::trans_affine_translation(xo, yo); } // These transformations must be done post-offsets @@ -1207,56 +1207,58 @@ RendererAgg::_draw_path_collection_generic trans *= agg::trans_affine_translation(0.0, (double)height); if (Nfacecolors) { - size_t fi = i % Nfacecolors; - face.second = agg::rgba(*(double*)PyArray_GETPTR2(facecolors, fi, 0), - *(double*)PyArray_GETPTR2(facecolors, fi, 1), - *(double*)PyArray_GETPTR2(facecolors, fi, 2), - *(double*)PyArray_GETPTR2(facecolors, fi, 3)); + size_t fi = i % Nfacecolors; + face.second = agg::rgba(*(double*)PyArray_GETPTR2(facecolors, fi, 0), + *(double*)PyArray_GETPTR2(facecolors, fi, 1), + *(double*)PyArray_GETPTR2(facecolors, fi, 2), + *(double*)PyArray_GETPTR2(facecolors, fi, 3)); } if (Nedgecolors) { - size_t ei = i % Nedgecolors; - gc.color = agg::rgba(*(double*)PyArray_GETPTR2(edgecolors, ei, 0), - *(double*)PyArray_GETPTR2(edgecolors, ei, 1), - *(double*)PyArray_GETPTR2(edgecolors, ei, 2), - *(double*)PyArray_GETPTR2(edgecolors, ei, 3)); - - if (Nlinewidths) { - gc.linewidth = double(Py::Float(linewidths[i % Nlinewidths])) * dpi/72.0; - } else { - gc.linewidth = 1.0; - } - if (Nlinestyles) { - gc.dashes = dashes[i % Nlinestyles].second; - gc.dashOffset = dashes[i % Nlinestyles].first; - } + size_t ei = i % Nedgecolors; + gc.color = agg::rgba(*(double*)PyArray_GETPTR2(edgecolors, ei, 0), + *(double*)PyArray_GETPTR2(edgecolors, ei, 1), + *(double*)PyArray_GETPTR2(edgecolors, ei, 2), + *(double*)PyArray_GETPTR2(edgecolors, ei, 3)); + + if (Nlinewidths) { + gc.linewidth = double(Py::Float(linewidths[i % Nlinewidths])) * dpi/72.0; + } else { + gc.linewidth = 1.0; + } + if (Nlinestyles) { + gc.dashes = dashes[i % Nlinestyles].second; + gc.dashOffset = dashes[i % Nlinestyles].first; + } } + bool do_clip = !face.first && gc.hatchpath.isNone(); + if (check_snap) { gc.isaa = bool(Py::Int(antialiaseds[i % Naa])); - transformed_path_t tpath(path, trans); + transformed_path_t tpath(path, trans); nan_removed_t nan_removed(tpath, true, has_curves); - clipped_t clipped(nan_removed, !face.first, width, height); + clipped_t clipped(nan_removed, do_clip, width, height); quantized_t quantized(clipped, gc.quantize_mode, path.total_vertices()); - if (has_curves) { - quantized_curve_t curve(quantized); - _draw_path(curve, has_clippath, face, gc); - } else { - _draw_path(quantized, has_clippath, face, gc); - } + if (has_curves) { + quantized_curve_t curve(quantized); + _draw_path(curve, has_clippath, face, gc); + } else { + _draw_path(quantized, has_clippath, face, gc); + } } else { - gc.isaa = bool(Py::Int(antialiaseds[i % Naa])); + gc.isaa = bool(Py::Int(antialiaseds[i % Naa])); - transformed_path_t tpath(path, trans); + transformed_path_t tpath(path, trans); nan_removed_t nan_removed(tpath, true, has_curves); - clipped_t clipped(nan_removed, !face.first, width, height); - if (has_curves) { - curve_t curve(clipped); - _draw_path(curve, has_clippath, face, gc); - } else { - _draw_path(clipped, has_clippath, face, gc); - } + clipped_t clipped(nan_removed, do_clip, width, height); + if (has_curves) { + curve_t curve(clipped); + _draw_path(curve, has_clippath, face, gc); + } else { + _draw_path(clipped, has_clippath, face, gc); + } } } @@ -1300,19 +1302,19 @@ RendererAgg::draw_path_collection(const Py::Tuple& args) { args.verify_length(14); //segments, trans, clipbox, colors, linewidths, antialiaseds - agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[0].ptr()); - Py::Object cliprect = args[1]; - Py::Object clippath = args[2]; + agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[0].ptr()); + Py::Object cliprect = args[1]; + Py::Object clippath = args[2]; agg::trans_affine clippath_trans = py_to_agg_transformation_matrix(args[3].ptr(), false); - Py::SeqBase paths = args[4]; + Py::SeqBase paths = args[4]; Py::SeqBase transforms_obj = args[5]; Py::Object offsets_obj = args[6]; agg::trans_affine offset_trans = py_to_agg_transformation_matrix(args[7].ptr()); Py::Object facecolors_obj = args[8]; Py::Object edgecolors_obj = args[9]; - Py::SeqBase linewidths = args[10]; + Py::SeqBase linewidths = args[10]; Py::SeqBase linestyles_obj = args[11]; - Py::SeqBase antialiaseds = args[12]; + Py::SeqBase antialiaseds = args[12]; // We don't actually care about urls for Agg, so just ignore it. // Py::SeqBase urls = args[13]; PathListGenerator path_generator(paths); @@ -1366,7 +1368,7 @@ class QuadMeshGenerator { public: inline unsigned vertex(double* x, double* y) { if (m_iterator >= total_vertices()) - return agg::path_cmd_stop; + return agg::path_cmd_stop; return vertex(m_iterator++, x, y); } @@ -1416,17 +1418,17 @@ RendererAgg::draw_quad_mesh(const Py::Tuple& args) { //segments, trans, clipbox, colors, linewidths, antialiaseds - agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[0].ptr()); - Py::Object cliprect = args[1]; - Py::Object clippath = args[2]; + agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[0].ptr()); + Py::Object cliprect = args[1]; + Py::Object clippath = args[2]; agg::trans_affine clippath_trans = py_to_agg_transformation_matrix(args[3].ptr(), false); size_t mesh_width = Py::Int(args[4]); size_t mesh_height = Py::Int(args[5]); - PyObject* coordinates = args[6].ptr(); + PyObject* coordinates = args[6].ptr(); Py::Object offsets_obj = args[7]; agg::trans_affine offset_trans = py_to_agg_transformation_matrix(args[8].ptr()); Py::Object facecolors_obj = args[9]; - bool antialiased = (bool)Py::Int(args[10]); + bool antialiased = (bool)Py::Int(args[10]); bool showedges = (bool)Py::Int(args[11]); bool free_edgecolors = false; @@ -1621,8 +1623,8 @@ RendererAgg::tostring_bgra(const Py::Tuple& args) { //todo: how to do this with native CXX PyObject* o = Py_BuildValue("s#", - buf_tmp, - row_len * height); + buf_tmp, + row_len * height); delete [] buf_tmp; return Py::asObject(o); } @@ -1655,10 +1657,10 @@ RendererAgg::tostring_rgba_minimized(const Py::Tuple& args) { for (int y = 0; y < (int)height; ++y) { for (int x = 0; x < (int)width; ++x) { if (*pixel) { - if (x < xmin) xmin = x; - if (y < ymin) ymin = y; - if (x > xmax) xmax = x; - if (y > ymax) ymax = y; + if (x < xmin) xmin = x; + if (y < ymin) ymin = y; + if (x > xmax) xmax = x; + if (y > ymax) ymax = y; } pixel += 4; } @@ -1674,9 +1676,9 @@ RendererAgg::tostring_rgba_minimized(const Py::Tuple& args) { xmax = std::min(xmax, (int)width); ymax = std::min(ymax, (int)height); - newwidth = xmax - xmin; - newheight = ymax - ymin; - int newsize = newwidth * newheight * 4; + newwidth = xmax - xmin; + newheight = ymax - ymin; + int newsize = newwidth * newheight * 4; unsigned char* buf = new unsigned char[newsize]; if (buf == NULL) { @@ -1687,7 +1689,7 @@ RendererAgg::tostring_rgba_minimized(const Py::Tuple& args) { unsigned int* src = (unsigned int*)pixBuffer; for (int y = ymin; y < ymax; ++y) for (int x = xmin; x < xmax; ++x, ++dst) - *dst = src[y * width + x]; + *dst = src[y * width + x]; // The Py::String will take over the buffer data = Py::String((const char *)buf, (int)newsize); @@ -1760,7 +1762,7 @@ RendererAgg::~RendererAgg() { /* ------------ module methods ------------- */ Py::Object _backend_agg_module::new_renderer (const Py::Tuple &args, - const Py::Dict &kws) + const Py::Dict &kws) { if (args.length() != 3 ) @@ -1801,18 +1803,18 @@ void BufferRegion::init_type() { add_varargs_method("set_x", &BufferRegion::set_x, - "set_x(x)"); + "set_x(x)"); add_varargs_method("set_y", &BufferRegion::set_y, - "set_y(y)"); + "set_y(y)"); add_varargs_method("get_extents", &BufferRegion::get_extents, - "get_extents()"); + "get_extents()"); add_varargs_method("to_string", &BufferRegion::to_string, - "to_string()"); + "to_string()"); add_varargs_method("to_string_argb", &BufferRegion::to_string_argb, - "to_string_argb()"); + "to_string_argb()"); } @@ -1822,37 +1824,37 @@ void RendererAgg::init_type() behaviors().doc("The agg backend extension module"); add_varargs_method("draw_path", &RendererAgg::draw_path, - "draw_path(gc, path, transform, rgbFace)\n"); + "draw_path(gc, path, transform, rgbFace)\n"); add_varargs_method("draw_path_collection", &RendererAgg::draw_path_collection, - "draw_path_collection(master_transform, cliprect, clippath, clippath_trans, paths, transforms, offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds)\n"); + "draw_path_collection(master_transform, cliprect, clippath, clippath_trans, paths, transforms, offsets, offsetTrans, facecolors, edgecolors, linewidths, linestyles, antialiaseds)\n"); add_varargs_method("draw_quad_mesh", &RendererAgg::draw_quad_mesh, - "draw_quad_mesh(master_transform, cliprect, clippath, clippath_trans, meshWidth, meshHeight, coordinates, offsets, offsetTrans, facecolors, antialiaseds, showedges)\n"); + "draw_quad_mesh(master_transform, cliprect, clippath, clippath_trans, meshWidth, meshHeight, coordinates, offsets, offsetTrans, facecolors, antialiaseds, showedges)\n"); add_varargs_method("draw_markers", &RendererAgg::draw_markers, - "draw_markers(gc, marker_path, marker_trans, path, rgbFace)\n"); + "draw_markers(gc, marker_path, marker_trans, path, rgbFace)\n"); add_varargs_method("draw_text_image", &RendererAgg::draw_text_image, - "draw_text_image(font_image, x, y, r, g, b, a)\n"); + "draw_text_image(font_image, x, y, r, g, b, a)\n"); add_varargs_method("draw_image", &RendererAgg::draw_image, - "draw_image(x, y, im)"); + "draw_image(x, y, im)"); add_varargs_method("write_rgba", &RendererAgg::write_rgba, - "write_rgba(fname)"); + "write_rgba(fname)"); add_varargs_method("tostring_rgb", &RendererAgg::tostring_rgb, - "s = tostring_rgb()"); + "s = tostring_rgb()"); add_varargs_method("tostring_argb", &RendererAgg::tostring_argb, - "s = tostring_argb()"); + "s = tostring_argb()"); add_varargs_method("tostring_bgra", &RendererAgg::tostring_bgra, - "s = tostring_bgra()"); + "s = tostring_bgra()"); add_varargs_method("tostring_rgba_minimized", &RendererAgg::tostring_rgba_minimized, - "s = tostring_rgba_minimized()"); + "s = tostring_rgba_minimized()"); add_varargs_method("buffer_rgba", &RendererAgg::buffer_rgba, - "buffer = buffer_rgba()"); + "buffer = buffer_rgba()"); add_varargs_method("clear", &RendererAgg::clear, - "clear()"); + "clear()"); add_varargs_method("copy_from_bbox", &RendererAgg::copy_from_bbox, - "copy_from_bbox(bbox)"); + "copy_from_bbox(bbox)"); add_varargs_method("restore_region", &RendererAgg::restore_region, - "restore_region(region)"); + "restore_region(region)"); add_varargs_method("restore_region2", &RendererAgg::restore_region2, - "restore_region(region, x1, y1, x2, y2, x3, y3)"); + "restore_region(region, x1, y1, x2, y2, x3, y3)"); } extern "C" From d94b421e1ad58112ed2b888b51ab42f137366e40 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sun, 11 Oct 2009 02:51:06 +0000 Subject: [PATCH 234/324] docstring fixup: LinearSegmentedColormap.from_list svn path=/branches/v0_99_maint/; revision=7864 --- lib/matplotlib/colors.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 6d68edf4e867..a61f59fddbeb 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -621,6 +621,10 @@ def __init__(self, name, segmentdata, N=256): .. seealso:: + :meth:`LinearSegmentedColormap.from_list` + Static method; factory function for generating a + smoothly-varying LinearSegmentedColormap. + :func:`makeMappingArray` For information about making a mapping array. """ @@ -641,8 +645,8 @@ def _init(self): def from_list(name, colors, N=256): """ Make a linear segmented colormap with *name* from a sequence - of *colors* which evenly transitions from colors[0] at val=1 - to colors[-1] at val=1. N is the number of rgb quantization + of *colors* which evenly transitions from colors[0] at val=0 + to colors[-1] at val=1. *N* is the number of rgb quantization levels. """ From 8c6bd9a2610c8ada8d12c7950f4e5eb55a4602ea Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sun, 11 Oct 2009 18:54:22 +0000 Subject: [PATCH 235/324] allow already transformed clip path in artist set_clip_path() svn path=/branches/v0_99_maint/; revision=7866 --- lib/matplotlib/artist.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 65f1cdf151bf..aa5a88746751 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -484,6 +484,9 @@ def set_clip_path(self, path, transform=None): elif isinstance(path, Path): self._clippath = TransformedPath(path, transform) success = True + elif isinstance(path, TransformedPath): + self._clippath = path + success = True if not success: print type(path), type(transform) From eac5520fbb1b23c14bbf278d7e2ece83e3af7a0a Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Sun, 11 Oct 2009 18:55:18 +0000 Subject: [PATCH 236/324] imshow: only apply axes patch clipping if image doesn't clip itself svn path=/branches/v0_99_maint/; revision=7867 --- lib/matplotlib/axes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index c903f2dca7e0..db61863aa990 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -6275,7 +6275,9 @@ def imshow(self, X, cmap=None, norm=None, aspect=None, im.set_data(X) im.set_alpha(alpha) self._set_artist_props(im) - im.set_clip_path(self.patch) + if not im.get_clip_on(): + # image does not already have clipping set, clip to axes patch + im.set_clip_path(self.patch) #if norm is None and shape is None: # im.set_clim(vmin, vmax) if vmin is not None or vmax is not None: From a67ea63354cc520b4a866ac26b4393da019bcd2d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 12 Oct 2009 13:21:07 +0000 Subject: [PATCH 237/324] Don't simplify hatched paths in PDF, PS and SVG backends. svn path=/branches/v0_99_maint/; revision=7874 --- lib/matplotlib/backends/backend_pdf.py | 4 +++- lib/matplotlib/backends/backend_ps.py | 8 +++++--- lib/matplotlib/backends/backend_svg.py | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 53c1fde8a79c..aeed7668d502 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -1302,7 +1302,9 @@ def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): def draw_path(self, gc, path, transform, rgbFace=None): self.check_gc(gc, rgbFace) - self.file.writePath(path, transform, rgbFace is None) + self.file.writePath( + path, transform, + rgbFace is None and gc.get_hatch_path() is None) self.file.output(self.gc.paint()) def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 06207d304691..1c3fc3911f74 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -468,7 +468,9 @@ def draw_path(self, gc, path, transform, rgbFace=None): """ Draws a Path instance using the given affine transform. """ - ps = self._convert_path(path, transform, clip=(rgbFace is None)) + ps = self._convert_path( + path, transform, + clip=(rgbFace is None and gc.get_hatch_path() is None)) self._draw_ps(ps, gc, rgbFace) def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): @@ -964,7 +966,7 @@ def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w', class NullWriter(object): def write(self, *kl, **kwargs): pass - + self._pswriter = NullWriter() else: self._pswriter = StringIO() @@ -1096,7 +1098,7 @@ def _print_figure_tex(self, outfile, format, dpi, facecolor, edgecolor, class NullWriter(object): def write(self, *kl, **kwargs): pass - + self._pswriter = NullWriter() else: self._pswriter = StringIO() diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index 061d6746805d..3a47caff1eb5 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -234,7 +234,9 @@ def _convert_path(self, path, transform, clip=False): def draw_path(self, gc, path, transform, rgbFace=None): trans_and_flip = self._make_flip_transform(transform) - path_data = self._convert_path(path, trans_and_flip, clip=(rgbFace is None)) + path_data = self._convert_path( + path, trans_and_flip, + clip=(rgbFace is None and gc.get_hatch_path() is None)) self._draw_svg_element('path', 'd="%s"' % path_data, gc, rgbFace) def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): From b488354551e368ced0970e90e080c0d7824fc150 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Mon, 12 Oct 2009 23:02:27 +0000 Subject: [PATCH 238/324] fix plot_directive.py that generated incorrect links for some cases svn path=/branches/v0_99_maint/; revision=7880 --- lib/matplotlib/sphinxext/plot_directive.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index c82b47d002f6..e65c856fcaa4 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -260,12 +260,10 @@ def plot_directive(name, arguments, options, content, lineno, # the temporary directory, and then sphinx moves the file to # build/html/_images for us later. rstdir, rstfile = os.path.split(state_machine.document.attributes['source']) - reldir = rstdir[len(setup.confdir)+1:] - relparts = [p for p in os.path.split(reldir) if p.strip()] - nparts = len(relparts) outdir = os.path.join('plot_directive', basedir) - linkdir = ('../' * nparts) + outdir - + reldir = relpath(setup.confdir, rstdir) + linkdir = os.path.join(reldir, outdir) + # tmpdir is where we build all the output files. This way the # plots won't have to be redone when generating latex after html. From daeeebbb193df7f1c571bb72f09c9d7715993d43 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 14 Oct 2009 20:27:07 +0000 Subject: [PATCH 239/324] Add AutoDateFormatter and AutoDateLocator to __all__ and to the module-level documentation. svn path=/branches/v0_99_maint/; revision=7884 --- lib/matplotlib/dates.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index 73675a31c0ec..75f2c30dbe84 100644 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -72,11 +72,18 @@ arbitrary date tick specifications. See `rrule example <../examples/pylab_examples/date_demo_rrule.html>`_. + * :class:`AutoDateLocator`: On autoscale, this class picks the best + :class:`MultipleDateLocator` to set the view limits and the tick + locations. + Date formatters --------------- Here all all the date formatters: + * :class:`AutoDateFormatter`: attempts to figure out the best format + to use. This is most useful when used with the :class:`AutoDateLocator`. + * :class:`DateFormatter`: use :func:`strftime` format strings * :class:`IndexDateFormatter`: date plots with implicit *x* @@ -109,8 +116,9 @@ __all__ = ( 'date2num', 'num2date', 'drange', 'epoch2num', 'num2epoch', 'mx2num', 'DateFormatter', - 'IndexDateFormatter', 'DateLocator', 'RRuleLocator', - 'YearLocator', 'MonthLocator', 'WeekdayLocator', + 'IndexDateFormatter', 'AutoDateFormatter', 'DateLocator', + 'RRuleLocator', 'AutoDateLocator', 'YearLocator', + 'MonthLocator', 'WeekdayLocator', 'DayLocator', 'HourLocator', 'MinuteLocator', 'SecondLocator', 'rrule', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU', 'YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', From 268fd73ac0cf5c2059f329849b09c8de3176cc0f Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Fri, 16 Oct 2009 04:35:20 +0000 Subject: [PATCH 240/324] fix Text.get_prop_tup omitting _rotation_mode. patch by Stan West svn path=/branches/v0_99_maint/; revision=7887 --- lib/matplotlib/text.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 3d20b963be66..acfee1a46b8d 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -664,7 +664,8 @@ def get_prop_tup(self): x, y = self.get_position() return (x, y, self.get_text(), self._color, self._verticalalignment, self._horizontalalignment, - hash(self._fontproperties), self._rotation, + hash(self._fontproperties), + self._rotation, self._rotation_mode, self.figure.dpi, id(self._renderer), ) From f8fcc7f91f91705a4de54eb325df4badcc8532b2 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Mon, 19 Oct 2009 09:02:08 +0000 Subject: [PATCH 241/324] fix a bug in plot_directive svn path=/branches/v0_99_maint/; revision=7893 --- lib/matplotlib/sphinxext/plot_directive.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index e65c856fcaa4..9b615a1ed950 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -81,7 +81,10 @@ def relpath(target, base=os.curdir): i+=1 rel_list = [os.pardir] * (len(base_list)-i) + target_list[i:] - return os.path.join(*rel_list) + if rel_list: + return os.path.join(*rel_list) + else: + return "" def write_char(s): sys.stdout.write(s) @@ -263,7 +266,7 @@ def plot_directive(name, arguments, options, content, lineno, outdir = os.path.join('plot_directive', basedir) reldir = relpath(setup.confdir, rstdir) linkdir = os.path.join(reldir, outdir) - + # tmpdir is where we build all the output files. This way the # plots won't have to be redone when generating latex after html. From 0b239452d40c1eb13e85b35e29f5f6c808fdffd9 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 21 Oct 2009 13:24:33 +0000 Subject: [PATCH 242/324] Fix bug in simplification code that was clipping peaks. svn path=/branches/v0_99_maint/; revision=7896 --- src/path_converters.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/path_converters.h b/src/path_converters.h index adf6df40937f..de677743041d 100644 --- a/src/path_converters.h +++ b/src/path_converters.h @@ -568,11 +568,15 @@ class PathSimplifier : protected EmbeddedQueue<9> } m_after_moveto = false; + /* NOTE: We used to skip this very short segments, but if + you have a lot of them cumulatively, you can miss + maxima or minima in the data. */ + /* Don't render line segments less than one pixel long */ - if (fabs(*x - m_lastx) < 1.0 && fabs(*y - m_lasty) < 1.0) - { - continue; - } + /* if (fabs(*x - m_lastx) < 1.0 && fabs(*y - m_lasty) < 1.0) */ + /* { */ + /* continue; */ + /* } */ /* if we have no orig vector, set it to this vector and continue. this orig vector is the reference vector we @@ -649,7 +653,7 @@ class PathSimplifier : protected EmbeddedQueue<9> } else { - if (paradNorm2 > m_dnorm2Min) + if (paradNorm2 < m_dnorm2Min) { m_dnorm2Min = paradNorm2; m_nextX = *x; From 166f8707c33b6d260964f5319fb35ca21ce2c7df Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 22 Oct 2009 13:46:08 +0000 Subject: [PATCH 243/324] Fix path simplification so the path always starts with a MOVETO. svn path=/branches/v0_99_maint/; revision=7901 --- src/path_converters.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/path_converters.h b/src/path_converters.h index de677743041d..c9111187acc4 100644 --- a/src/path_converters.h +++ b/src/path_converters.h @@ -684,9 +684,15 @@ class PathSimplifier : protected EmbeddedQueue<9> { if (m_origdNorm2 != 0.0) { - queue_push(agg::path_cmd_line_to, m_nextX, m_nextY); + queue_push((m_moveto || m_after_moveto) ? + agg::path_cmd_move_to : agg::path_cmd_line_to, + m_nextX, m_nextY); + m_moveto = false; } - queue_push(agg::path_cmd_line_to, m_lastx, m_lasty); + queue_push((m_moveto || m_after_moveto) ? + agg::path_cmd_move_to : agg::path_cmd_line_to, + m_lastx, m_lasty); + m_moveto = false; queue_push(agg::path_cmd_stop, 0.0, 0.0); } From 9e09883b55253061620d750f20bd2d621bace0f0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 23 Oct 2009 15:02:21 +0000 Subject: [PATCH 244/324] Support \# in mathtext. svn path=/branches/v0_99_maint/; revision=7903 --- lib/matplotlib/_mathtext_data.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/_mathtext_data.py b/lib/matplotlib/_mathtext_data.py index 8dcbfafb0d8c..56f437c0bcdf 100644 --- a/lib/matplotlib/_mathtext_data.py +++ b/lib/matplotlib/_mathtext_data.py @@ -118,6 +118,7 @@ r'%' : ('cmr10', 48), r'\$' : ('cmr10', 99), r'@' : ('cmr10', 111), + r'\#' : ('cmr10', 39), r'\_' : ('cmtt10', 79), r'\Gamma' : ('cmr10', 19), r'\Delta' : ('cmr10', 6), @@ -401,6 +402,7 @@ r'\}' : ('pncr8a', 125), r'\backslash' : ('pncr8a', 92), r'\ast' : ('pncr8a', 42), + r'\#' : ('pncr8a', 35), r'\circumflexaccent' : ('pncri8a', 124), # for \hat r'\combiningbreve' : ('pncri8a', 81), # for \breve @@ -2288,6 +2290,7 @@ '{': 123, '}': 125, '_': 95, +'#': 35, 'imath': 0x131, 'circumflexaccent' : 770, 'combiningbreve' : 774, From 3b149f1a52d266b3eb3acba47542170b4df6d89c Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Sun, 25 Oct 2009 19:30:43 +0000 Subject: [PATCH 245/324] axes_divider.py : fix a bug that axes has a wrong size when pack_start is True. svn path=/branches/v0_99_maint/; revision=7906 --- lib/mpl_toolkits/axes_grid/axes_divider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mpl_toolkits/axes_grid/axes_divider.py b/lib/mpl_toolkits/axes_grid/axes_divider.py index 5847e97458d5..56a8c185b856 100644 --- a/lib/mpl_toolkits/axes_grid/axes_divider.py +++ b/lib/mpl_toolkits/axes_grid/axes_divider.py @@ -441,7 +441,7 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs): fraction_ref=self._xref) if pack_start: - self._horizontal.insert(0, pad) + self._horizontal.insert(0, size) self._xrefindex += 1 locator = self.new_locator(nx=0, ny=0) else: @@ -489,7 +489,7 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs): fraction_ref=self._yref) if pack_start: - self._vertical.insert(0, pad) + self._vertical.insert(0, size) self._yrefindex += 1 locator = self.new_locator(nx=0, ny=0) else: From f39e082d3d99db6631fa5148cf40237f5e4a9a24 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 2 Nov 2009 18:54:29 +0000 Subject: [PATCH 246/324] [2890345] pylab.thetagrids() does not accept fmt svn path=/branches/v0_99_maint/; revision=7916 --- lib/matplotlib/projections/polar.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/projections/polar.py b/lib/matplotlib/projections/polar.py index 15d4127df3d4..da7a01f7790e 100644 --- a/lib/matplotlib/projections/polar.py +++ b/lib/matplotlib/projections/polar.py @@ -11,7 +11,7 @@ from matplotlib import cbook from matplotlib.patches import Circle from matplotlib.path import Path -from matplotlib.ticker import Formatter, Locator +from matplotlib.ticker import Formatter, Locator, FormatStrFormatter from matplotlib.transforms import Affine2D, Affine2DBase, Bbox, \ BboxTransformTo, IdentityTransform, Transform, TransformWrapper import matplotlib.spines as mspines @@ -317,7 +317,7 @@ def set_yscale(self, *args, **kwargs): set_rscale = Axes.set_yscale set_rticks = Axes.set_yticks - def set_thetagrids(self, angles, labels=None, frac=None, + def set_thetagrids(self, angles, labels=None, frac=None, fmt=None, **kwargs): """ Set the angles at which to place the theta grids (these @@ -347,6 +347,8 @@ def set_thetagrids(self, angles, labels=None, frac=None, self.set_xticks(angles * (npy.pi / 180.0)) if labels is not None: self.set_xticklabels(labels) + elif fmt is not None: + self.xaxis.set_major_formatter(FormatStrFormatter(fmt)) if frac is not None: self._theta_label1_position.clear().translate(0.0, frac) self._theta_label2_position.clear().translate(0.0, 1.0 / frac) @@ -355,7 +357,8 @@ def set_thetagrids(self, angles, labels=None, frac=None, return self.xaxis.get_ticklines(), self.xaxis.get_ticklabels() set_thetagrids.__doc__ = cbook.dedent(set_thetagrids.__doc__) % kwdocd - def set_rgrids(self, radii, labels=None, angle=None, rpad=None, **kwargs): + def set_rgrids(self, radii, labels=None, angle=None, rpad=None, fmt=None, + **kwargs): """ Set the radial locations and labels of the *r* grids. @@ -388,6 +391,8 @@ def set_rgrids(self, radii, labels=None, angle=None, rpad=None, **kwargs): self.set_yticks(radii) if labels is not None: self.set_yticklabels(labels) + elif fmt is not None: + self.yaxis.set_major_formatter(FormatStrFormatter(fmt)) if angle is None: angle = self._r_label1_position.to_values()[4] if rpad is not None: From 08d18a5a77110e81160d4e1354ae289433c16dec Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 3 Nov 2009 15:46:14 +0000 Subject: [PATCH 247/324] [2890979] Close paths correctly in PolyCollection svn path=/branches/v0_99_maint/; revision=7919 --- lib/matplotlib/collections.py | 19 ++++++++++++------- src/_backend_agg.cpp | 3 ++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index bece2f5a24b3..8b35cf3383b1 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -676,14 +676,19 @@ def set_verts(self, verts, closed=True): if closed: self._paths = [] for xy in verts: - if np.ma.isMaskedArray(xy): - if len(xy) and (xy[0] != xy[-1]).any(): - xy = np.ma.concatenate([xy, [xy[0]]]) + if len(xy): + if np.ma.isMaskedArray(xy): + xy = np.ma.concatenate([xy, np.zeros((1,2))]) + else: + xy = np.asarray(xy) + xy = np.concatenate([xy, np.zeros((1,2))]) + codes = np.empty(xy.shape[0], dtype='uint8') + codes[:] = mpath.Path.LINETO + codes[0] = mpath.Path.MOVETO + codes[-1] = mpath.Path.CLOSEPOLY + self._paths.append(mpath.Path(xy, codes)) else: - xy = np.asarray(xy) - if len(xy) and (xy[0] != xy[-1]).any(): - xy = np.concatenate([xy, [xy[0]]]) - self._paths.append(mpath.Path(xy)) + self._paths.append(mpath.Path(xy)) else: self._paths = [mpath.Path(xy) for xy in verts] diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 9ed6ebf40677..578c3ff4ed7d 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -164,7 +164,8 @@ GCAgg::GCAgg(const Py::Object &gc, double dpi) : } GCAgg::GCAgg(double dpi) : - dpi(dpi), isaa(true), linewidth(1.0), alpha(1.0), + dpi(dpi), isaa(true), + cap(agg::butt_cap), join(agg::round_join), linewidth(1.0), alpha(1.0), dashOffset(0.0) { From 6b7152f84b7d6b658471d8c4b79df47ba69d86ee Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 3 Nov 2009 16:27:13 +0000 Subject: [PATCH 248/324] [2880836] Save from toolbar changes directory with WX backend svn path=/branches/v0_99_maint/; revision=7924 --- lib/matplotlib/backends/backend_wx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 219af94a9dc2..5b5c793c91e7 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -1794,7 +1794,7 @@ def save(self, evt): default_file = "image." + self.canvas.get_default_filetype() dlg = wx.FileDialog(self._parent, "Save to file", "", default_file, filetypes, - wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR) + wx.SAVE|wx.OVERWRITE_PROMPT) dlg.SetFilterIndex(filter_index) if dlg.ShowModal() == wx.ID_OK: dirname = dlg.GetDirectory() From d3bb176ad84d08ee5b7c458868ba8569e89de5bd Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 3 Nov 2009 20:55:47 +0000 Subject: [PATCH 249/324] [2889193] Rasterized output offset in pdf and ps svn path=/branches/v0_99_maint/; revision=7928 --- lib/matplotlib/backends/backend_mixed.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/backends/backend_mixed.py b/lib/matplotlib/backends/backend_mixed.py index 94b00170883d..f5dd7e5890a7 100644 --- a/lib/matplotlib/backends/backend_mixed.py +++ b/lib/matplotlib/backends/backend_mixed.py @@ -14,7 +14,7 @@ def __init__(self, figure, width, height, dpi, vector_renderer, raster_renderer_class=None, bbox_inches_restore=None): """ - figure: The figure instance. + figure: The figure instance. width: The width of the canvas in logical units @@ -49,7 +49,7 @@ def __init__(self, figure, width, height, dpi, vector_renderer, self.figure=figure self._bbox_inches_restore = bbox_inches_restore - + self._set_current_renderer(vector_renderer) _methods = """ @@ -88,8 +88,8 @@ def start_rasterizing(self): mode="png") self._bbox_inches_restore = r - - + + if self._rasterizing == 0: self._raster_renderer = self._raster_renderer_class( self._width*self.dpi, self._height*self.dpi, self.dpi) @@ -117,9 +117,10 @@ def stop_rasterizing(self): image = frombuffer(buffer, w, h, True) image.is_grayscale = False image.flipud_out() - self._renderer.draw_image(int(float(l)/self.dpi*72.), - int((float(height) - b - h)/self.dpi*72.), - image, None) + self._renderer.draw_image( + float(l)/self.dpi*72., + (float(height) - b - h)/self.dpi*72., + image, None) self._raster_renderer = None self._rasterizing = False From 6e1071cc57b7d8395693323b2bab0e8b6d15d86e Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 6 Nov 2009 15:04:33 +0000 Subject: [PATCH 250/324] backport afm fix to branch svn path=/branches/v0_99_maint/; revision=7942 --- lib/matplotlib/afm.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/afm.py b/lib/matplotlib/afm.py index 05d2f78d54c9..5cbab3ae2bed 100644 --- a/lib/matplotlib/afm.py +++ b/lib/matplotlib/afm.py @@ -37,8 +37,16 @@ import sys, os, re from _mathtext_data import uni2type1 -#Convert string the a python type -_to_int = int +# Convert string the a python type +# some afm files have floats where we are expecting ints -- there is +# probably a better way to handle this (support floats, round rather +# than truncate). But I don't know what the best approach is now and +# this change to _to_int should at least prevent mpl from crashing on +# these JDH (2009-11-06) +def _to_int(x): + return int(float(x)) + + _to_float = float _to_str = str From 3b91de3d11111e4c89b1d6d50094f084813d8508 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 6 Nov 2009 19:24:55 +0000 Subject: [PATCH 251/324] Add support for \widebar{} in mathtext (Thanks Sean Arms) svn path=/branches/v0_99_maint/; revision=7944 --- lib/matplotlib/_mathtext_data.py | 2 ++ lib/matplotlib/mathtext.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/_mathtext_data.py b/lib/matplotlib/_mathtext_data.py index 56f437c0bcdf..3473a3112e18 100644 --- a/lib/matplotlib/_mathtext_data.py +++ b/lib/matplotlib/_mathtext_data.py @@ -41,6 +41,7 @@ r'\rangle' : ('cmex10', 64), r'\widehat' : ('cmex10', 15), r'\widetilde' : ('cmex10', 52), + r'\widebar' : ('cmr10', 131), r'\omega' : ('cmmi10', 29), r'\varepsilon' : ('cmmi10', 20), @@ -1762,6 +1763,7 @@ tex2uni = { 'widehat': 0x0302, 'widetilde': 0x0303, +'widebar': 0x0305, 'langle': 0x27e8, 'rangle': 0x27e9, 'perp': 0x27c2, diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 60910c9f947a..9ca769594024 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -2450,7 +2450,7 @@ def char_over_chars(self, s, loc, toks): r'overleftarrow' : r'\leftarrow' } - _wide_accents = set(r"widehat widetilde".split()) + _wide_accents = set(r"widehat widetilde widebar".split()) def accent(self, s, loc, toks): assert(len(toks)==1) From 8c256b5cbe6e1c3ccce62e2eb0d2dc592633b11f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 12 Nov 2009 17:27:34 +0000 Subject: [PATCH 252/324] [2853659] Patch to fix EMF backend svn path=/branches/v0_99_maint/; revision=7952 --- lib/matplotlib/backends/backend_emf.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/backends/backend_emf.py b/lib/matplotlib/backends/backend_emf.py index 217424e53a47..1da7d74790bc 100644 --- a/lib/matplotlib/backends/backend_emf.py +++ b/lib/matplotlib/backends/backend_emf.py @@ -42,16 +42,19 @@ def __init__(self,other,angle): other.get_weight(), other.get_stretch(), other.get_size()) - self.__angle=angle + self._angle=angle def __hash__(self): - return hash( (FontProperties.__hash__(self), self.__angle)) + return hash( (FontProperties.__hash__(self), self._angle)) def __str__(self): - return str( (FontProperties.__str__(self), self.__angle)) + return str( (FontProperties.__str__(self), self._angle)) def set_angle(self,angle): - self.__angle=angle + self._angle=angle + + def get_angle(self): + return self._angle # Hashable pen (line style) properties. class EMFPen: From 4d4df548c2f17c972c1d72652435c41ca5caf15d Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Mon, 16 Nov 2009 23:49:11 +0000 Subject: [PATCH 253/324] Fix Normalize bug: ensure scalar output for scalar input. This bug was causing a bug in clabel with a single contour level, as reported by Brendan Arnold. svn path=/branches/v0_99_maint/; revision=7970 --- lib/matplotlib/colors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index a61f59fddbeb..ff4db7948e6c 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -765,7 +765,7 @@ def __call__(self, value, clip=None): if vmin > vmax: raise ValueError("minvalue must be less than or equal to maxvalue") elif vmin==vmax: - return 0.0 * val + result = 0.0 * val else: if clip: mask = ma.getmask(val) @@ -826,7 +826,7 @@ def __call__(self, value, clip=None): elif vmin<=0: raise ValueError("values must all be positive") elif vmin==vmax: - return 0.0 * val + result = 0.0 * val else: if clip: mask = ma.getmask(val) From 1751afd025533f02aa243d43fa8ac7518b71199f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 18 Nov 2009 16:19:21 +0000 Subject: [PATCH 254/324] Fix plot directive so it handles source files in various encodings. svn path=/branches/v0_99_maint/; revision=7972 --- lib/matplotlib/sphinxext/plot_directive.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 9b615a1ed950..2e445c515a20 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -36,7 +36,7 @@ sphinx_version = sphinx.__version__.split(".") # The split is necessary for sphinx beta versions where the string is # '6b1' -sphinx_version = tuple([int(re.split('[a-z]', x)[0]) +sphinx_version = tuple([int(re.split('[a-z]', x)[0]) for x in sphinx_version[:2]]) import matplotlib @@ -96,7 +96,8 @@ def write_char(s): 'scale': directives.nonnegative_int, 'align': align, 'class': directives.class_option, - 'include-source': directives.flag } + 'include-source': directives.flag, + 'encoding': directives.encoding} template = """ .. htmlonly:: @@ -294,8 +295,15 @@ def plot_directive(name, arguments, options, content, lineno, if options.has_key('include-source'): if content is None: - content = open(reference, 'r').read() - lines = ['::', ''] + [' %s'%row.rstrip() for row in content.split('\n')] + lines = [ + '.. include:: %s' % os.path.join(setup.app.builder.srcdir, reference), + ' :literal:'] + if options.has_key('encoding'): + lines.append(' :encoding: %s' % options['encoding']) + del options['encoding'] + else: + lines = ['::', ''] + [' %s'%row.rstrip() for row in content.split('\n')] + lines.append('') del options['include-source'] else: lines = [] From f6c466e774067875055a3e007b4776a67adf681f Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 23 Nov 2009 21:16:15 +0000 Subject: [PATCH 255/324] make IndexFormatter derive from Formatter svn path=/branches/v0_99_maint/; revision=7981 --- doc/_templates/indexsidebar.html | 4 +--- doc/users/image_tutorial.rst | 4 ++-- lib/matplotlib/ticker.py | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html index 13481ce858bc..77f69e3ac712 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -3,10 +3,8 @@

News

Please donate to support matplotlib development.

-

We have a release candidate of matplotlib 0.99.1 available for testing. Please report any problems on the tracker and mailing list. -

-

matplotlib 0.99.0 is available for download. See what's new and tips on download. See what's new and tips on installing

diff --git a/doc/users/image_tutorial.rst b/doc/users/image_tutorial.rst index 07a3a6a02597..bef7e68a64f3 100644 --- a/doc/users/image_tutorial.rst +++ b/doc/users/image_tutorial.rst @@ -274,7 +274,7 @@ image data, we use the :func:`~matplotlib.pyplot.hist` function. .. sourcecode:: ipython - In[10]: plt.hist(lum_img) + In[10]: plt.hist(lum_img.flatten(), 256, range=(0.0,1.0), fc='k', ec='k') .. plot:: @@ -283,7 +283,7 @@ image data, we use the :func:`~matplotlib.pyplot.hist` function. import numpy as np img = mpimg.imread('_static/stinkbug.png') lum_img = img[:,:,0] - plt.hist(lum_img, range=(0.0,1.0)) + plt.hist(lum_img.flatten(), 256, range=(0.0,1.0), fc='black', ec='black') Most often, the "interesting" part of the image is around the peak, and you can get extra contrast by clipping the regions above and/or diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 52be4410b251..c89eda596b6d 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -206,7 +206,7 @@ def fix_minus(self, s): """ return s -class IndexFormatter: +class IndexFormatter(Formatter): """ format the position x to the nearest i-th label where i=int(x+0.5) """ From 63a39a08a3eba72df09b91fa6b48947c6dbc8345 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 24 Nov 2009 18:08:51 +0000 Subject: [PATCH 256/324] [2902715] artist.set_clip_path does not handle tuple svn path=/branches/v0_99_maint/; revision=7983 --- lib/matplotlib/artist.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index aa5a88746751..90ce765b0191 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -477,6 +477,8 @@ def set_clip_path(self, path, transform=None): path.get_path(), path.get_transform()) success = True + elif isinstance(path, tuple): + path, transform = path if path is None: self._clippath = None From 1baad1b0b7dcbccb9c636c57ff6e09c6c9632194 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 30 Nov 2009 17:24:49 +0000 Subject: [PATCH 257/324] Fix SF-2903596 on the 0.99.x branch svn path=/branches/v0_99_maint/; revision=7989 --- setupext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setupext.py b/setupext.py index d0b316561dfe..849ee32add31 100644 --- a/setupext.py +++ b/setupext.py @@ -1105,7 +1105,7 @@ def build_ft2font(ext_modules, packages): deps.extend(glob.glob('CXX/*.c')) module = Extension('matplotlib.ft2font', deps, - define_macros=[('PY_ARRAYAUNIQUE_SYMBOL', 'MPL_ARRAY_API')]) + define_macros=[('PY_ARRAY_UNIQUE_SYMBOL', 'MPL_ARRAY_API')]) add_ft2font_flags(module) ext_modules.append(module) BUILT_FT2FONT = True From 015b5309bd8a264ff4b99b024095154800319038 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 30 Nov 2009 18:30:09 +0000 Subject: [PATCH 258/324] Fix bug in usage of "contains" svn path=/branches/v0_99_maint/; revision=7991 --- examples/event_handling/looking_glass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/event_handling/looking_glass.py b/examples/event_handling/looking_glass.py index 2d308767580f..3ceeb68f8231 100644 --- a/examples/event_handling/looking_glass.py +++ b/examples/event_handling/looking_glass.py @@ -24,7 +24,7 @@ def onpress(self, event): if event.inaxes!=ax: return - if not circ.contains(event): + if not circ.contains(event)[0]: return self.pressevent = event From d12f935c418fdbe05ae203a0060630a5969ccd07 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 1 Dec 2009 19:01:45 +0000 Subject: [PATCH 259/324] [2906157] Let sphinx reference matplotlib-created plots (backport) svn path=/branches/v0_99_maint/; revision=7998 --- lib/matplotlib/sphinxext/plot_directive.py | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 2e445c515a20..917f6e7578cd 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -276,8 +276,8 @@ def plot_directive(name, arguments, options, content, lineno, # treated as relative to the root of the documentation tree. We need # to support both methods here. tmpdir = os.path.join('build', outdir) + tmpdir = os.path.abspath(tmpdir) if sphinx_version < (0, 6): - tmpdir = os.path.abspath(tmpdir) prefix = '' else: prefix = '/' @@ -343,6 +343,36 @@ def plot_directive(name, arguments, options, content, lineno, return [] +def mark_plot_labels(app, document): + """ + To make plots referenceable, we need to move the reference from + the "htmlonly" (or "latexonly") node to the actual figure node + itself. + """ + for name, explicit in document.nametypes.iteritems(): + if not explicit: + continue + labelid = document.nameids[name] + if labelid is None: + continue + node = document.ids[labelid] + if node.tagname in ('html_only', 'latex_only'): + for n in node: + if n.tagname == 'figure': + sectname = name + for c in n: + if c.tagname == 'caption': + sectname = c.astext() + break + + node['ids'].remove(labelid) + node['names'].remove(name) + n['ids'].append(labelid) + n['names'].append(name) + document.settings.env.labels[name] = \ + document.settings.env.docname, labelid, sectname + break + def setup(app): setup.app = app setup.config = app.config @@ -354,3 +384,4 @@ def setup(app): ['png', 'hires.png', 'pdf'], True) + app.connect('doctree-read', mark_plot_labels) From 7bacaa65fb7b569506e88c4676d27f598ec21cd5 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 3 Dec 2009 18:54:54 +0000 Subject: [PATCH 260/324] [2903460] _path.pyd crashes in 0.99.1.win32-py2.6 on PIII CPU svn path=/branches/v0_99_maint/; revision=8001 --- src/_path.cpp | 72 +++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/_path.cpp b/src/_path.cpp index 1ef9d6f94a41..9802e3841a0d 100644 --- a/src/_path.cpp +++ b/src/_path.cpp @@ -147,7 +147,7 @@ bool point_in_path_impl(const double tx, const double ty, T& path) // The following cases denote the beginning on a new subpath if (code == agg::path_cmd_stop || - (code & agg::path_cmd_end_poly) == agg::path_cmd_end_poly) + (code & agg::path_cmd_end_poly) == agg::path_cmd_end_poly) { x = sx; y = sy; @@ -190,13 +190,13 @@ bool point_in_path_impl(const double tx, const double ty, T& path) vty1 = y; } while (code != agg::path_cmd_stop && - (code & agg::path_cmd_end_poly) != agg::path_cmd_end_poly); + (code & agg::path_cmd_end_poly) != agg::path_cmd_end_poly); yflag1 = (vty1 >= ty); if (yflag0 != yflag1) { if ( ((vty1-ty) * (vtx0-vtx1) >= - (vtx1-tx) * (vty0-vty1)) == yflag1 ) + (vtx1-tx) * (vty0-vty1)) == yflag1 ) { inside_flag ^= 1; } @@ -462,7 +462,7 @@ Py::Object _path_module::get_path_collection_extents(const Py::Tuple& args) //segments, trans, clipbox, colors, linewidths, antialiaseds agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[0].ptr()); - Py::SeqBase paths = args[1]; + Py::SeqBase paths = args[1]; Py::SeqBase transforms_obj = args[2]; Py::Object offsets_obj = args[3]; agg::trans_affine offset_trans = py_to_agg_transformation_matrix(args[4].ptr(), false); @@ -474,15 +474,15 @@ Py::Object _path_module::get_path_collection_extents(const Py::Tuple& args) { offsets = (PyArrayObject*)PyArray_FromObject(offsets_obj.ptr(), PyArray_DOUBLE, 0, 2); if (!offsets || - (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || - (PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) + (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || + (PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) { throw Py::ValueError("Offsets array must be Nx2"); } size_t Npaths = paths.length(); size_t Noffsets = offsets->dimensions[0]; - size_t N = std::max(Npaths, Noffsets); + size_t N = std::max(Npaths, Noffsets); size_t Ntransforms = std::min(transforms_obj.length(), N); size_t i; @@ -555,7 +555,7 @@ Py::Object _path_module::point_in_path_collection(const Py::Tuple& args) double y = Py::Float(args[1]); double radius = Py::Float(args[2]); agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[3].ptr()); - Py::SeqBase paths = args[4]; + Py::SeqBase paths = args[4]; Py::SeqBase transforms_obj = args[5]; Py::SeqBase offsets_obj = args[6]; agg::trans_affine offset_trans = py_to_agg_transformation_matrix(args[7].ptr()); @@ -563,8 +563,8 @@ Py::Object _path_module::point_in_path_collection(const Py::Tuple& args) PyArrayObject* offsets = (PyArrayObject*)PyArray_FromObject(offsets_obj.ptr(), PyArray_DOUBLE, 0, 2); if (!offsets || - (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || - (PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) + (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || + (PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) { Py_XDECREF(offsets); throw Py::ValueError("Offsets array must be Nx2"); @@ -888,7 +888,7 @@ Py::Object _path_module::clip_path_to_rect(const Py::Tuple &args) } for (size_t i = 0; i < size; ++i) { - ((double *)pyarray->data)[2*i] = (*p)[i].x; + ((double *)pyarray->data)[2*i] = (*p)[i].x; ((double *)pyarray->data)[2*i+1] = (*p)[i].y; } if (PyList_SetItem(py_results, p - results.begin(), (PyObject *)pyarray) != -1) @@ -922,14 +922,14 @@ Py::Object _path_module::affine_transform(const Py::Tuple& args) vertices = (PyArrayObject*)PyArray_FromObject (vertices_obj.ptr(), PyArray_DOUBLE, 1, 2); if (!vertices || - (PyArray_NDIM(vertices) == 2 && PyArray_DIM(vertices, 1) != 2) || - (PyArray_NDIM(vertices) == 1 && PyArray_DIM(vertices, 0) != 2)) + (PyArray_NDIM(vertices) == 2 && PyArray_DIM(vertices, 1) != 2) || + (PyArray_NDIM(vertices) == 1 && PyArray_DIM(vertices, 0) != 2)) throw Py::ValueError("Invalid vertices array."); transform = (PyArrayObject*) PyArray_FromObject (transform_obj.ptr(), PyArray_DOUBLE, 2, 2); if (!transform || - PyArray_DIM(transform, 0) != 3 || + PyArray_DIM(transform, 0) != 3 || PyArray_DIM(transform, 1) != 3) throw Py::ValueError("Invalid transform."); @@ -1010,7 +1010,7 @@ Py::Object _path_module::count_bboxes_overlapping_bbox(const Py::Tuple& args) { args.verify_length(2); - Py::Object bbox = args[0]; + Py::Object bbox = args[0]; Py::SeqBase bboxes = args[1]; double ax0, ay0, ax1, ay1; @@ -1131,13 +1131,13 @@ Py::Object _path_module::path_intersects_path(const Py::Tuple& args) void _add_polygon(Py::List& polygons, const std::vector& polygon) { if (polygon.size() == 0) - return; + return; npy_intp polygon_dims[] = { polygon.size() / 2, 2, 0 }; PyArrayObject* polygon_array = NULL; polygon_array = (PyArrayObject*)PyArray_SimpleNew - (2, polygon_dims, PyArray_DOUBLE); + (2, polygon_dims, PyArray_DOUBLE); if (!polygon_array) - throw Py::MemoryError("Error creating polygon array"); + throw Py::MemoryError("Error creating polygon array"); double* polygon_data = (double*)PyArray_DATA(polygon_array); memcpy(polygon_data, &polygon[0], polygon.size() * sizeof(double)); polygons.append(Py::Object((PyObject*)polygon_array, true)); @@ -1179,26 +1179,26 @@ Py::Object _path_module::convert_path_to_polygons(const Py::Tuple& args) while ((code = curve.vertex(&x, &y)) != agg::path_cmd_stop) { - if ((code & agg::path_cmd_end_poly) == agg::path_cmd_end_poly) + if ((code & agg::path_cmd_end_poly) == agg::path_cmd_end_poly) { - if (polygon.size() >= 2) - { - polygon.push_back(polygon[0]); - polygon.push_back(polygon[1]); - _add_polygon(polygons, polygon); - } - polygon.clear(); - } + if (polygon.size() >= 2) + { + polygon.push_back(polygon[0]); + polygon.push_back(polygon[1]); + _add_polygon(polygons, polygon); + } + polygon.clear(); + } else { - if (code == agg::path_cmd_move_to) + if (code == agg::path_cmd_move_to) { - _add_polygon(polygons, polygon); - polygon.clear(); - } - polygon.push_back(x); - polygon.push_back(y); - } + _add_polygon(polygons, polygon); + polygon.clear(); + } + polygon.push_back(x); + polygon.push_back(y); + } } _add_polygon(polygons, polygon); @@ -1356,8 +1356,8 @@ extern "C" DL_EXPORT(void) init_path(void) { - import_array(); - static _path_module* _path = NULL; _path = new _path_module; + + import_array(); } From 80451bcd5919b8cd966f45cd8e7b3d0b6ab404fa Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 3 Dec 2009 19:21:28 +0000 Subject: [PATCH 261/324] [2896454] subscripts and \mathrm don't get along, aka the long-standing wiggle baseline problem svn path=/branches/v0_99_maint/; revision=8003 --- src/ft2font.cpp | 732 ++++++++++++++++++++++++------------------------ 1 file changed, 366 insertions(+), 366 deletions(-) diff --git a/src/ft2font.cpp b/src/ft2font.cpp index 8dfdd4de6818..230335c1128e 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -94,8 +94,8 @@ void FT2Image::resize(long width, long height) { void FT2Image::draw_bitmap( FT_Bitmap* bitmap, - FT_Int x, - FT_Int y) { + FT_Int x, + FT_Int y) { _VERBOSE("FT2Image::draw_bitmap"); FT_Int image_width = (FT_Int)_width; FT_Int image_height = (FT_Int)_height; @@ -126,9 +126,9 @@ void FT2Image::write_bitmap(const char* filename) const { for ( size_t i = 0; i< _height; i++) { for ( size_t j = 0; j < _width; ++j) { if (_buffer[j + i*_width]) - fputc('#', fh); + fputc('#', fh); else - fputc(' ', fh); + fputc(' ', fh); } fputc('\n', fh); } @@ -156,7 +156,7 @@ FT2Image::py_write_bitmap(const Py::Tuple & args) { void FT2Image::draw_rect(unsigned long x0, unsigned long y0, - unsigned long x1, unsigned long y1) { + unsigned long x1, unsigned long y1) { if ( x0>_width || x1>_width || y0>_height || y1>_height ) throw Py::ValueError("Rect coords outside image bounds"); @@ -199,7 +199,7 @@ FT2Image::py_draw_rect(const Py::Tuple & args) { } void FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0, - unsigned long x1, unsigned long y1) { + unsigned long x1, unsigned long y1) { x0 = std::min(x0, _width); y0 = std::min(y0, _height); x1 = std::min(x1, _width); @@ -249,7 +249,7 @@ FT2Image::py_as_str(const Py::Tuple & args) { return Py::asObject (PyString_FromStringAndSize((const char *)_buffer, - _width*_height) + _width*_height) ); } @@ -276,9 +276,9 @@ FT2Image::py_as_array(const Py::Tuple & args) { PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(2, dimensions, PyArray_UBYTE); - unsigned char *src = _buffer; - unsigned char *src_end = src + (dimensions[0] * dimensions[1]); - unsigned char *dst = (unsigned char *)A->data; + unsigned char *src = _buffer; + unsigned char *src_end = src + (dimensions[0] * dimensions[1]); + unsigned char *dst = (unsigned char *)A->data; while (src != src_end) { *dst++ = *src++; @@ -297,9 +297,9 @@ void FT2Image::makeRgbCopy() { } else { _rgbCopy->resize(_width * 3, _height); } - unsigned char *src = _buffer; - unsigned char *src_end = src + (_width * _height); - unsigned char *dst = _rgbCopy->_buffer; + unsigned char *src = _buffer; + unsigned char *src_end = src + (_width * _height); + unsigned char *dst = _rgbCopy->_buffer; unsigned char tmp; while (src != src_end) { @@ -335,9 +335,9 @@ void FT2Image::makeRgbaCopy() { } else { _rgbaCopy->resize(_width * 4, _height); } - unsigned char *src = _buffer; - unsigned char *src_end = src + (_width * _height); - unsigned char *dst = _rgbaCopy->_buffer; + unsigned char *src = _buffer; + unsigned char *src_end = src + (_width * _height); + unsigned char *dst = _rgbaCopy->_buffer; while (src != src_end) { // We know the array has already been zero'ed out in @@ -480,27 +480,27 @@ Glyph::get_path( const FT_Face& face) { // check first point to determine origin if( tag == FT_CURVE_TAG_CONIC) - { - // first point is conic control. Yes, this happens. - if(FT_CURVE_TAG(outline.tags[last]) == FT_CURVE_TAG_ON) - { - // start at last point if it is on the curve - v_start = v_last; - limit--; - } - else - { - // if both first and last points are conic, - // start at their middle and record its position - // for closure - v_start.x = (v_start.x + v_last.x) / 2; - v_start.y = (v_start.y + v_last.y) / 2; - - v_last = v_start; - } - point--; - tags--; - } + { + // first point is conic control. Yes, this happens. + if(FT_CURVE_TAG(outline.tags[last]) == FT_CURVE_TAG_ON) + { + // start at last point if it is on the curve + v_start = v_last; + limit--; + } + else + { + // if both first and last points are conic, + // start at their middle and record its position + // for closure + v_start.x = (v_start.x + v_last.x) / 2; + v_start.y = (v_start.y + v_last.y) / 2; + + v_last = v_start; + } + point--; + tags--; + } double x = conv(v_start.x); double y = flip_y ? -conv(v_start.y) : conv(v_start.y); @@ -515,157 +515,157 @@ Glyph::get_path( const FT_Face& face) { closepoly[1] = Py::Int(0); while(point < limit) - { - point++; - tags++; - - tag = FT_CURVE_TAG(tags[0]); - switch(tag) - { - case FT_CURVE_TAG_ON: // emit a single line_to - { - double x = conv(point->x); - double y = flip_y ? -conv(point->y) : conv(point->y); - Py::Tuple tup(3); - tup[0] = Py::Int(LINETO); - tup[1] = Py::Float(x); - tup[2] = Py::Float(y); - path.append(tup); - - continue; - } - - case FT_CURVE_TAG_CONIC: // consume conic arcs - { - v_control.x = point->x; - v_control.y = point->y; - - Do_Conic: - if(point < limit) - { - FT_Vector vec; - FT_Vector v_middle; - - point++; - tags++; - tag = FT_CURVE_TAG(tags[0]); - - vec.x = point->x; - vec.y = point->y; - - if(tag == FT_CURVE_TAG_ON) - { - double xctl = conv(v_control.x); - double yctl = flip_y ? -conv(v_control.y) : conv(v_control.y); - double xto = conv(vec.x); - double yto = flip_y ? -conv(vec.y) : conv(vec.y); - Py::Tuple tup(5); - tup[0] = Py::Int(CURVE3); - tup[1] = Py::Float(xctl); - tup[2] = Py::Float(yctl); - tup[3] = Py::Float(xto); - tup[4] = Py::Float(yto); - path.append(tup); - continue; - } - - if(tag != FT_CURVE_TAG_CONIC) return Py::Object(); - - v_middle.x = (v_control.x + vec.x) / 2; - v_middle.y = (v_control.y + vec.y) / 2; - - double xctl = conv(v_control.x); - double yctl = flip_y ? -conv(v_control.y) : conv(v_control.y); - double xto = conv(v_middle.x); - double yto = flip_y ? -conv(v_middle.y) : conv(v_middle.y); - Py::Tuple tup(5); - tup[0] = Py::Int(CURVE3); - tup[1] = Py::Float(xctl); - tup[2] = Py::Float(yctl); - tup[3] = Py::Float(xto); - tup[4] = Py::Float(yto); - path.append(tup); - - v_control = vec; - goto Do_Conic; - } - double xctl = conv(v_control.x); - double yctl = flip_y ? -conv(v_control.y) : conv(v_control.y); - double xto = conv(v_start.x); - double yto = flip_y ? -conv(v_start.y) : conv(v_start.y); - Py::Tuple tup(5); - tup[0] = Py::Int(CURVE3); - tup[1] = Py::Float(xctl); - tup[2] = Py::Float(yctl); - tup[3] = Py::Float(xto); - tup[4] = Py::Float(yto); - path.append(tup); - goto Close; - } - - default: // FT_CURVE_TAG_CUBIC - { - FT_Vector vec1, vec2; - - if(point + 1 > limit || FT_CURVE_TAG(tags[1]) != FT_CURVE_TAG_CUBIC) - { - return Py::Object(); - } - - vec1.x = point[0].x; - vec1.y = point[0].y; - vec2.x = point[1].x; - vec2.y = point[1].y; - - point += 2; - tags += 2; - - if(point <= limit) - { - FT_Vector vec; - - vec.x = point->x; - vec.y = point->y; - - double xctl1 = conv(vec1.x); - double yctl1 = flip_y ? -conv(vec1.y) : conv(vec1.y); - double xctl2 = conv(vec2.x); - double yctl2 = flip_y ? -conv(vec2.y) : conv(vec2.y); - double xto = conv(vec.x); - double yto = flip_y ? -conv(vec.y) : conv(vec.y); - Py::Tuple tup(7); - tup[0] = Py::Int(CURVE4); - tup[1] = Py::Float(xctl1); - tup[2] = Py::Float(yctl1); - tup[3] = Py::Float(xctl2); - tup[4] = Py::Float(yctl2); - tup[5] = Py::Float(xto); - tup[6] = Py::Float(yto); - path.append(tup); - - continue; - } - - double xctl1 = conv(vec1.x); - double yctl1 = flip_y ? -conv(vec1.y) : conv(vec1.y); - double xctl2 = conv(vec2.x); - double yctl2 = flip_y ? -conv(vec2.y) : conv(vec2.y); - double xto = conv(v_start.x); - double yto = flip_y ? -conv(v_start.y) : conv(v_start.y); - Py::Tuple tup(7); - tup[0] = Py::Int(CURVE4); - tup[1] = Py::Float(xctl1); - tup[2] = Py::Float(yctl1); - tup[3] = Py::Float(xctl2); - tup[4] = Py::Float(yctl2); - tup[5] = Py::Float(xto); - tup[6] = Py::Float(yto); - path.append(tup); - - goto Close; - } - } - } + { + point++; + tags++; + + tag = FT_CURVE_TAG(tags[0]); + switch(tag) + { + case FT_CURVE_TAG_ON: // emit a single line_to + { + double x = conv(point->x); + double y = flip_y ? -conv(point->y) : conv(point->y); + Py::Tuple tup(3); + tup[0] = Py::Int(LINETO); + tup[1] = Py::Float(x); + tup[2] = Py::Float(y); + path.append(tup); + + continue; + } + + case FT_CURVE_TAG_CONIC: // consume conic arcs + { + v_control.x = point->x; + v_control.y = point->y; + + Do_Conic: + if(point < limit) + { + FT_Vector vec; + FT_Vector v_middle; + + point++; + tags++; + tag = FT_CURVE_TAG(tags[0]); + + vec.x = point->x; + vec.y = point->y; + + if(tag == FT_CURVE_TAG_ON) + { + double xctl = conv(v_control.x); + double yctl = flip_y ? -conv(v_control.y) : conv(v_control.y); + double xto = conv(vec.x); + double yto = flip_y ? -conv(vec.y) : conv(vec.y); + Py::Tuple tup(5); + tup[0] = Py::Int(CURVE3); + tup[1] = Py::Float(xctl); + tup[2] = Py::Float(yctl); + tup[3] = Py::Float(xto); + tup[4] = Py::Float(yto); + path.append(tup); + continue; + } + + if(tag != FT_CURVE_TAG_CONIC) return Py::Object(); + + v_middle.x = (v_control.x + vec.x) / 2; + v_middle.y = (v_control.y + vec.y) / 2; + + double xctl = conv(v_control.x); + double yctl = flip_y ? -conv(v_control.y) : conv(v_control.y); + double xto = conv(v_middle.x); + double yto = flip_y ? -conv(v_middle.y) : conv(v_middle.y); + Py::Tuple tup(5); + tup[0] = Py::Int(CURVE3); + tup[1] = Py::Float(xctl); + tup[2] = Py::Float(yctl); + tup[3] = Py::Float(xto); + tup[4] = Py::Float(yto); + path.append(tup); + + v_control = vec; + goto Do_Conic; + } + double xctl = conv(v_control.x); + double yctl = flip_y ? -conv(v_control.y) : conv(v_control.y); + double xto = conv(v_start.x); + double yto = flip_y ? -conv(v_start.y) : conv(v_start.y); + Py::Tuple tup(5); + tup[0] = Py::Int(CURVE3); + tup[1] = Py::Float(xctl); + tup[2] = Py::Float(yctl); + tup[3] = Py::Float(xto); + tup[4] = Py::Float(yto); + path.append(tup); + goto Close; + } + + default: // FT_CURVE_TAG_CUBIC + { + FT_Vector vec1, vec2; + + if(point + 1 > limit || FT_CURVE_TAG(tags[1]) != FT_CURVE_TAG_CUBIC) + { + return Py::Object(); + } + + vec1.x = point[0].x; + vec1.y = point[0].y; + vec2.x = point[1].x; + vec2.y = point[1].y; + + point += 2; + tags += 2; + + if(point <= limit) + { + FT_Vector vec; + + vec.x = point->x; + vec.y = point->y; + + double xctl1 = conv(vec1.x); + double yctl1 = flip_y ? -conv(vec1.y) : conv(vec1.y); + double xctl2 = conv(vec2.x); + double yctl2 = flip_y ? -conv(vec2.y) : conv(vec2.y); + double xto = conv(vec.x); + double yto = flip_y ? -conv(vec.y) : conv(vec.y); + Py::Tuple tup(7); + tup[0] = Py::Int(CURVE4); + tup[1] = Py::Float(xctl1); + tup[2] = Py::Float(yctl1); + tup[3] = Py::Float(xctl2); + tup[4] = Py::Float(yctl2); + tup[5] = Py::Float(xto); + tup[6] = Py::Float(yto); + path.append(tup); + + continue; + } + + double xctl1 = conv(vec1.x); + double yctl1 = flip_y ? -conv(vec1.y) : conv(vec1.y); + double xctl2 = conv(vec2.x); + double yctl2 = flip_y ? -conv(vec2.y) : conv(vec2.y); + double xto = conv(v_start.x); + double yto = flip_y ? -conv(v_start.y) : conv(v_start.y); + Py::Tuple tup(7); + tup[0] = Py::Int(CURVE4); + tup[1] = Py::Float(xctl1); + tup[2] = Py::Float(yctl1); + tup[3] = Py::Float(xctl2); + tup[4] = Py::Float(yctl2); + tup[5] = Py::Float(xto); + tup[6] = Py::Float(yto); + path.append(tup); + + goto Close; + } + } + } path.append(closepoly); @@ -850,14 +850,14 @@ FT2Font::set_size(const Py::Tuple & args) { #ifdef VERTICAL_HINTING int error = FT_Set_Char_Size( face, (long)(ptsize * 64), 0, - (unsigned int)dpi * HORIZ_HINTING, - (unsigned int)dpi ); + (unsigned int)dpi * HORIZ_HINTING, + (unsigned int)dpi ); static FT_Matrix transform = { 65536 / HORIZ_HINTING, 0, 0, 65536 }; FT_Set_Transform( face, &transform, 0 ); #else int error = FT_Set_Char_Size( face, (long)(ptsize * 64), 0, - (unsigned int)dpi, - (unsigned int)dpi ); + (unsigned int)dpi, + (unsigned int)dpi ); #endif if (error) throw Py::RuntimeError("Could not set the fontsize"); @@ -1009,7 +1009,7 @@ FT2Font::set_text(const Py::Tuple & args, const Py::Dict & kwargs) { if ( use_kerning && previous && glyph_index ) { FT_Vector delta; FT_Get_Kerning( face, previous, glyph_index, - FT_KERNING_DEFAULT, &delta ); + FT_KERNING_DEFAULT, &delta ); pen.x += delta.x / HORIZ_HINTING; } error = FT_Load_Glyph( face, glyph_index, flags ); @@ -1167,12 +1167,12 @@ FT2Font::draw_glyphs_to_bitmap(const Py::Tuple & args) { FT_Glyph_Get_CBox(glyphs[n], ft_glyph_bbox_pixels, &bbox); error = FT_Glyph_To_Bitmap(&glyphs[n], - ft_render_mode_normal, - 0, - 1 - ); + ft_render_mode_normal, + 0, + 1 + ); if (error) - throw Py::RuntimeError("Could not convert glyph to bitmap"); + throw Py::RuntimeError("Could not convert glyph to bitmap"); FT_BitmapGlyph bitmap = (FT_BitmapGlyph)glyphs[n]; // now, draw to our target surface (convert position) @@ -1209,12 +1209,12 @@ FT2Font::get_xys(const Py::Tuple & args) { FT_Glyph_Get_CBox(glyphs[n], ft_glyph_bbox_pixels, &bbox); error = FT_Glyph_To_Bitmap(&glyphs[n], - ft_render_mode_normal, - 0, - 1 - ); + ft_render_mode_normal, + 0, + 1 + ); if (error) - throw Py::RuntimeError("Could not convert glyph to bitmap"); + throw Py::RuntimeError("Could not convert glyph to bitmap"); FT_BitmapGlyph bitmap = (FT_BitmapGlyph)glyphs[n]; @@ -1260,8 +1260,8 @@ FT2Font::draw_glyph_to_bitmap(const Py::Tuple & args) { long x = (long)xd; long y = (long)yd; FT_Vector sub_offset; - sub_offset.x = int((xd - (double)x) * 64.0); - sub_offset.y = int((yd - (double)y) * 64.0); + sub_offset.x = int(-(xd - (double)x) * 64.0); + sub_offset.y = int(-(yd - (double)y) * 64.0); if (!Glyph::check(args[3].ptr())) throw Py::TypeError("Usage: draw_glyph_to_bitmap(bitmap, x,y,glyph)"); @@ -1271,10 +1271,10 @@ FT2Font::draw_glyph_to_bitmap(const Py::Tuple & args) { throw Py::ValueError("glyph num is out of range"); error = FT_Glyph_To_Bitmap(&glyphs[glyph->glyphInd], - ft_render_mode_normal, - &sub_offset, //no additional translation - 1 //destroy image; - ); + ft_render_mode_normal, + &sub_offset, //no additional translation + 1 //destroy image; + ); if (error) throw Py::RuntimeError("Could not convert glyph to bitmap"); @@ -1407,7 +1407,7 @@ FT2Font::get_sfnt(const Py::Tuple & args) { key[2] = Py::Int(sfnt.language_id); key[3] = Py::Int(sfnt.name_id); names[key] = Py::String((char *) sfnt.string, - (int) sfnt.string_len); + (int) sfnt.string_len); } return names; } @@ -1425,7 +1425,7 @@ FT2Font::get_name_index(const Py::Tuple & args) { std::string glyphname = Py::String(args[0]); return Py::Long((long) - FT_Get_Name_Index(face, (FT_String *) glyphname.c_str())); + FT_Get_Name_Index(face, (FT_String *) glyphname.c_str())); } char FT2Font::get_ps_font_info__doc__[] = @@ -1473,7 +1473,7 @@ FT2Font::get_sfnt_table(const Py::Tuple & args) { int tag; const char *tags[] = {"head", "maxp", "OS/2", "hhea", - "vhea", "post", "pclt", NULL}; + "vhea", "post", "pclt", NULL}; for (tag=0; tags[tag] != NULL; tag++) if (strcmp(tagname.c_str(), tags[tag]) == 0) @@ -1488,140 +1488,140 @@ FT2Font::get_sfnt_table(const Py::Tuple & args) { case 0: { char head_dict[] = "{s:(h,h), s:(h,h), s:l, s:l, s:i, s:i," - "s:(l,l), s:(l,l), s:h, s:h, s:h, s:h, s:i, s:i, s:h, s:h, s:h}"; + "s:(l,l), s:(l,l), s:h, s:h, s:h, s:h, s:i, s:i, s:h, s:h, s:h}"; TT_Header *t = (TT_Header *)table; return Py::asObject(Py_BuildValue(head_dict, - "version", - FIXED_MAJOR(t->Table_Version), - FIXED_MINOR(t->Table_Version), - "fontRevision", - FIXED_MAJOR(t->Font_Revision), - FIXED_MINOR(t->Font_Revision), - "checkSumAdjustment", t->CheckSum_Adjust, - "magicNumber" , t->Magic_Number, - "flags", (unsigned)t->Flags, - "unitsPerEm", (unsigned)t->Units_Per_EM, - "created", t->Created[0], t->Created[1], - "modified", t->Modified[0],t->Modified[1], - "xMin", t->xMin, - "yMin", t->yMin, - "xMax", t->xMax, - "yMax", t->yMax, - "macStyle", (unsigned)t->Mac_Style, - "lowestRecPPEM", (unsigned)t->Lowest_Rec_PPEM, - "fontDirectionHint", t->Font_Direction, - "indexToLocFormat", t->Index_To_Loc_Format, - "glyphDataFormat", t->Glyph_Data_Format)); + "version", + FIXED_MAJOR(t->Table_Version), + FIXED_MINOR(t->Table_Version), + "fontRevision", + FIXED_MAJOR(t->Font_Revision), + FIXED_MINOR(t->Font_Revision), + "checkSumAdjustment", t->CheckSum_Adjust, + "magicNumber" , t->Magic_Number, + "flags", (unsigned)t->Flags, + "unitsPerEm", (unsigned)t->Units_Per_EM, + "created", t->Created[0], t->Created[1], + "modified", t->Modified[0],t->Modified[1], + "xMin", t->xMin, + "yMin", t->yMin, + "xMax", t->xMax, + "yMax", t->yMax, + "macStyle", (unsigned)t->Mac_Style, + "lowestRecPPEM", (unsigned)t->Lowest_Rec_PPEM, + "fontDirectionHint", t->Font_Direction, + "indexToLocFormat", t->Index_To_Loc_Format, + "glyphDataFormat", t->Glyph_Data_Format)); } case 1: { char maxp_dict[] = "{s:(h,h), s:i, s:i, s:i, s:i, s:i, s:i," - "s:i, s:i, s:i, s:i, s:i, s:i, s:i, s:i}"; + "s:i, s:i, s:i, s:i, s:i, s:i, s:i, s:i}"; TT_MaxProfile *t = (TT_MaxProfile *)table; return Py::asObject(Py_BuildValue(maxp_dict, - "version", - FIXED_MAJOR(t->version), - FIXED_MINOR(t->version), - "numGlyphs", (unsigned)t->numGlyphs, - "maxPoints", (unsigned)t->maxPoints, - "maxContours", (unsigned)t->maxContours, - "maxComponentPoints", - (unsigned)t->maxCompositePoints, - "maxComponentContours", - (unsigned)t->maxCompositeContours, - "maxZones", (unsigned)t->maxZones, - "maxTwilightPoints",(unsigned)t->maxTwilightPoints, - "maxStorage", (unsigned)t->maxStorage, - "maxFunctionDefs",(unsigned)t->maxFunctionDefs, - "maxInstructionDefs", - (unsigned)t->maxInstructionDefs, - "maxStackElements",(unsigned)t->maxStackElements, - "maxSizeOfInstructions", - (unsigned)t->maxSizeOfInstructions, - "maxComponentElements", - (unsigned)t->maxComponentElements, - "maxComponentDepth", - (unsigned)t->maxComponentDepth)); + "version", + FIXED_MAJOR(t->version), + FIXED_MINOR(t->version), + "numGlyphs", (unsigned)t->numGlyphs, + "maxPoints", (unsigned)t->maxPoints, + "maxContours", (unsigned)t->maxContours, + "maxComponentPoints", + (unsigned)t->maxCompositePoints, + "maxComponentContours", + (unsigned)t->maxCompositeContours, + "maxZones", (unsigned)t->maxZones, + "maxTwilightPoints",(unsigned)t->maxTwilightPoints, + "maxStorage", (unsigned)t->maxStorage, + "maxFunctionDefs",(unsigned)t->maxFunctionDefs, + "maxInstructionDefs", + (unsigned)t->maxInstructionDefs, + "maxStackElements",(unsigned)t->maxStackElements, + "maxSizeOfInstructions", + (unsigned)t->maxSizeOfInstructions, + "maxComponentElements", + (unsigned)t->maxComponentElements, + "maxComponentDepth", + (unsigned)t->maxComponentDepth)); } case 2: { char os_2_dict[] = "{s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h," - "s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:s#, s:(llll)," - "s:s#, s:h, s:h, s:h}"; + "s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:s#, s:(llll)," + "s:s#, s:h, s:h, s:h}"; TT_OS2 *t = (TT_OS2 *)table; return Py::asObject(Py_BuildValue(os_2_dict, - "version", (unsigned)t->version, - "xAvgCharWidth", t->xAvgCharWidth, - "usWeightClass", (unsigned)t->usWeightClass, - "usWidthClass", (unsigned)t->usWidthClass, - "fsType", t->fsType, - "ySubscriptXSize", t->ySubscriptXSize, - "ySubscriptYSize", t->ySubscriptYSize, - "ySubscriptXOffset", t->ySubscriptXOffset, - "ySubscriptYOffset", t->ySubscriptYOffset, - "ySuperscriptXSize", t->ySuperscriptXSize, - "ySuperscriptYSize", t->ySuperscriptYSize, - "ySuperscriptXOffset", t->ySuperscriptXOffset, - "ySuperscriptYOffset", t->ySuperscriptYOffset, - "yStrikeoutSize", t->yStrikeoutSize, - "yStrikeoutPosition", t->yStrikeoutPosition, - "sFamilyClass", t->sFamilyClass, - "panose", t->panose, 10, - "ulCharRange", - (unsigned long) t->ulUnicodeRange1, - (unsigned long) t->ulUnicodeRange2, - (unsigned long) t->ulUnicodeRange3, - (unsigned long) t->ulUnicodeRange4, - "achVendID", t->achVendID, 4, - "fsSelection", (unsigned)t->fsSelection, - "fsFirstCharIndex",(unsigned)t->usFirstCharIndex, - "fsLastCharIndex",(unsigned)t->usLastCharIndex)); + "version", (unsigned)t->version, + "xAvgCharWidth", t->xAvgCharWidth, + "usWeightClass", (unsigned)t->usWeightClass, + "usWidthClass", (unsigned)t->usWidthClass, + "fsType", t->fsType, + "ySubscriptXSize", t->ySubscriptXSize, + "ySubscriptYSize", t->ySubscriptYSize, + "ySubscriptXOffset", t->ySubscriptXOffset, + "ySubscriptYOffset", t->ySubscriptYOffset, + "ySuperscriptXSize", t->ySuperscriptXSize, + "ySuperscriptYSize", t->ySuperscriptYSize, + "ySuperscriptXOffset", t->ySuperscriptXOffset, + "ySuperscriptYOffset", t->ySuperscriptYOffset, + "yStrikeoutSize", t->yStrikeoutSize, + "yStrikeoutPosition", t->yStrikeoutPosition, + "sFamilyClass", t->sFamilyClass, + "panose", t->panose, 10, + "ulCharRange", + (unsigned long) t->ulUnicodeRange1, + (unsigned long) t->ulUnicodeRange2, + (unsigned long) t->ulUnicodeRange3, + (unsigned long) t->ulUnicodeRange4, + "achVendID", t->achVendID, 4, + "fsSelection", (unsigned)t->fsSelection, + "fsFirstCharIndex",(unsigned)t->usFirstCharIndex, + "fsLastCharIndex",(unsigned)t->usLastCharIndex)); } case 3: { char hhea_dict[] = "{s:(h,h), s:h, s:h, s:h, s:i, s:h, s:h, s:h," - "s:h, s:h, s:h, s:h, s:i}"; + "s:h, s:h, s:h, s:h, s:i}"; TT_HoriHeader *t = (TT_HoriHeader *)table; return Py::asObject(Py_BuildValue(hhea_dict, - "version", - FIXED_MAJOR(t->Version), - FIXED_MINOR(t->Version), - "ascent", t->Ascender, - "descent", t->Descender, - "lineGap", t->Line_Gap, - "advanceWidthMax",(unsigned)t->advance_Width_Max, - "minLeftBearing", t->min_Left_Side_Bearing, - "minRightBearing", t->min_Right_Side_Bearing, - "xMaxExtent", t->xMax_Extent, - "caretSlopeRise", t->caret_Slope_Rise, - "caretSlopeRun", t->caret_Slope_Run, - "caretOffset", t->caret_Offset, - "metricDataFormat", t->metric_Data_Format, - "numOfLongHorMetrics", - (unsigned)t->number_Of_HMetrics)); + "version", + FIXED_MAJOR(t->Version), + FIXED_MINOR(t->Version), + "ascent", t->Ascender, + "descent", t->Descender, + "lineGap", t->Line_Gap, + "advanceWidthMax",(unsigned)t->advance_Width_Max, + "minLeftBearing", t->min_Left_Side_Bearing, + "minRightBearing", t->min_Right_Side_Bearing, + "xMaxExtent", t->xMax_Extent, + "caretSlopeRise", t->caret_Slope_Rise, + "caretSlopeRun", t->caret_Slope_Run, + "caretOffset", t->caret_Offset, + "metricDataFormat", t->metric_Data_Format, + "numOfLongHorMetrics", + (unsigned)t->number_Of_HMetrics)); } case 4: { char vhea_dict[] = "{s:(h,h), s:h, s:h, s:h, s:i, s:h, s:h, s:h," - "s:h, s:h, s:h, s:h, s:i}"; + "s:h, s:h, s:h, s:h, s:i}"; TT_VertHeader *t = (TT_VertHeader *)table; return Py::asObject(Py_BuildValue(vhea_dict, - "version", - FIXED_MAJOR(t->Version), - FIXED_MINOR(t->Version), - "vertTypoAscender", t->Ascender, - "vertTypoDescender", t->Descender, - "vertTypoLineGap", t->Line_Gap, - "advanceHeightMax",(unsigned)t->advance_Height_Max, - "minTopSideBearing", t->min_Top_Side_Bearing, - "minBottomSizeBearing", t->min_Bottom_Side_Bearing, - "yMaxExtent", t->yMax_Extent, - "caretSlopeRise", t->caret_Slope_Rise, - "caretSlopeRun", t->caret_Slope_Run, - "caretOffset", t->caret_Offset, - "metricDataFormat", t->metric_Data_Format, - "numOfLongVerMetrics", - (unsigned)t->number_Of_VMetrics)); + "version", + FIXED_MAJOR(t->Version), + FIXED_MINOR(t->Version), + "vertTypoAscender", t->Ascender, + "vertTypoDescender", t->Descender, + "vertTypoLineGap", t->Line_Gap, + "advanceHeightMax",(unsigned)t->advance_Height_Max, + "minTopSideBearing", t->min_Top_Side_Bearing, + "minBottomSizeBearing", t->min_Bottom_Side_Bearing, + "yMaxExtent", t->yMax_Extent, + "caretSlopeRise", t->caret_Slope_Rise, + "caretSlopeRun", t->caret_Slope_Run, + "caretOffset", t->caret_Offset, + "metricDataFormat", t->metric_Data_Format, + "numOfLongVerMetrics", + (unsigned)t->number_Of_VMetrics)); } case 5: { @@ -1660,7 +1660,7 @@ FT2Font::get_sfnt_table(const Py::Tuple & args) { pclt["symbolSet"] = Py::Int((short) t->SymbolSet); pclt["typeFace"] = Py::String((char *) t->TypeFace, 16); pclt["characterComplement"] = Py::String((char *) - t->CharacterComplement, 8); + t->CharacterComplement, 8); pclt["filename"] = Py::String((char *) t->FileName, 6); pclt["strokeWeight"] = Py::Int((int) t->StrokeWeight); pclt["widthType"] = Py::Int((int) t->WidthType); @@ -1735,23 +1735,23 @@ FT2Image::init_type() { behaviors().doc("FT2Image"); add_varargs_method("write_bitmap", &FT2Image::py_write_bitmap, - FT2Image::write_bitmap__doc__); + FT2Image::write_bitmap__doc__); add_varargs_method("draw_rect", &FT2Image::py_draw_rect, - FT2Image::draw_rect__doc__); + FT2Image::draw_rect__doc__); add_varargs_method("draw_rect_filled", &FT2Image::py_draw_rect_filled, - FT2Image::draw_rect_filled__doc__); + FT2Image::draw_rect_filled__doc__); add_varargs_method("as_array", &FT2Image::py_as_array, - FT2Image::as_array__doc__); + FT2Image::as_array__doc__); add_varargs_method("as_str", &FT2Image::py_as_str, - FT2Image::as_str__doc__); + FT2Image::as_str__doc__); add_varargs_method("as_rgb_str", &FT2Image::py_as_rgb_str, - FT2Image::as_rgb_str__doc__); + FT2Image::as_rgb_str__doc__); add_varargs_method("as_rgba_str", &FT2Image::py_as_rgba_str, - FT2Image::as_rgba_str__doc__); + FT2Image::as_rgba_str__doc__); add_varargs_method("get_width", &FT2Image::py_get_width, - "Returns the width of the image"); + "Returns the width of the image"); add_varargs_method("get_height", &FT2Image::py_get_height, - "Returns the height of the image"); + "Returns the height of the image"); } void @@ -1770,45 +1770,45 @@ FT2Font::init_type() { behaviors().doc("FT2Font"); add_varargs_method("clear", &FT2Font::clear, - FT2Font::clear__doc__); + FT2Font::clear__doc__); add_varargs_method("draw_glyph_to_bitmap", &FT2Font::draw_glyph_to_bitmap, - FT2Font::draw_glyph_to_bitmap__doc__); + FT2Font::draw_glyph_to_bitmap__doc__); add_varargs_method("draw_glyphs_to_bitmap", &FT2Font::draw_glyphs_to_bitmap, - FT2Font::draw_glyphs_to_bitmap__doc__); + FT2Font::draw_glyphs_to_bitmap__doc__); add_varargs_method("get_xys", &FT2Font::get_xys, - FT2Font::get_xys__doc__); + FT2Font::get_xys__doc__); add_varargs_method("get_num_glyphs", &FT2Font::get_num_glyphs, - FT2Font::get_num_glyphs__doc__); + FT2Font::get_num_glyphs__doc__); add_keyword_method("load_char", &FT2Font::load_char, - FT2Font::load_char__doc__); + FT2Font::load_char__doc__); add_keyword_method("set_text", &FT2Font::set_text, - FT2Font::set_text__doc__); + FT2Font::set_text__doc__); add_varargs_method("set_size", &FT2Font::set_size, - FT2Font::set_size__doc__); + FT2Font::set_size__doc__); add_varargs_method("set_charmap", &FT2Font::set_charmap, - FT2Font::set_charmap__doc__); + FT2Font::set_charmap__doc__); add_varargs_method("get_width_height", &FT2Font::get_width_height, - FT2Font::get_width_height__doc__); + FT2Font::get_width_height__doc__); add_varargs_method("get_descent", &FT2Font::get_descent, - FT2Font::get_descent__doc__); + FT2Font::get_descent__doc__); add_varargs_method("get_glyph_name", &FT2Font::get_glyph_name, - FT2Font::get_glyph_name__doc__); + FT2Font::get_glyph_name__doc__); add_varargs_method("get_charmap", &FT2Font::get_charmap, - FT2Font::get_charmap__doc__); + FT2Font::get_charmap__doc__); add_varargs_method("get_kerning", &FT2Font::get_kerning, - FT2Font::get_kerning__doc__); + FT2Font::get_kerning__doc__); add_varargs_method("get_sfnt", &FT2Font::get_sfnt, - FT2Font::get_sfnt__doc__); + FT2Font::get_sfnt__doc__); add_varargs_method("get_name_index", &FT2Font::get_name_index, - FT2Font::get_name_index__doc__); + FT2Font::get_name_index__doc__); add_varargs_method("get_ps_font_info", &FT2Font::get_ps_font_info, - FT2Font::get_ps_font_info__doc__); + FT2Font::get_ps_font_info__doc__); add_varargs_method("get_sfnt_table", &FT2Font::get_sfnt_table, - FT2Font::get_sfnt_table__doc__); + FT2Font::get_sfnt_table__doc__); add_varargs_method("get_image", &FT2Font::get_image, - FT2Font::get_image__doc__); + FT2Font::get_image__doc__); add_varargs_method("attach_file", &FT2Font::attach_file, FT2Font::attach_file__doc__); @@ -1882,28 +1882,28 @@ initft2font(void) import_array(); Py::Dict d = ft2font->moduleDictionary(); - d["SCALABLE"] = Py::Int(FT_FACE_FLAG_SCALABLE); - d["FIXED_SIZES"] = Py::Int(FT_FACE_FLAG_FIXED_SIZES); - d["FIXED_WIDTH"] = Py::Int(FT_FACE_FLAG_FIXED_WIDTH); - d["SFNT"] = Py::Int(FT_FACE_FLAG_SFNT); - d["HORIZONTAL"] = Py::Int(FT_FACE_FLAG_HORIZONTAL); - d["VERTICAL"] = Py::Int(FT_FACE_FLAG_SCALABLE); - d["KERNING"] = Py::Int(FT_FACE_FLAG_KERNING); - d["FAST_GLYPHS"] = Py::Int(FT_FACE_FLAG_FAST_GLYPHS); + d["SCALABLE"] = Py::Int(FT_FACE_FLAG_SCALABLE); + d["FIXED_SIZES"] = Py::Int(FT_FACE_FLAG_FIXED_SIZES); + d["FIXED_WIDTH"] = Py::Int(FT_FACE_FLAG_FIXED_WIDTH); + d["SFNT"] = Py::Int(FT_FACE_FLAG_SFNT); + d["HORIZONTAL"] = Py::Int(FT_FACE_FLAG_HORIZONTAL); + d["VERTICAL"] = Py::Int(FT_FACE_FLAG_SCALABLE); + d["KERNING"] = Py::Int(FT_FACE_FLAG_KERNING); + d["FAST_GLYPHS"] = Py::Int(FT_FACE_FLAG_FAST_GLYPHS); d["MULTIPLE_MASTERS"] = Py::Int(FT_FACE_FLAG_MULTIPLE_MASTERS); - d["GLYPH_NAMES"] = Py::Int(FT_FACE_FLAG_GLYPH_NAMES); - d["EXTERNAL_STREAM"] = Py::Int(FT_FACE_FLAG_EXTERNAL_STREAM); - d["ITALIC"] = Py::Int(FT_STYLE_FLAG_ITALIC); - d["BOLD"] = Py::Int(FT_STYLE_FLAG_BOLD); + d["GLYPH_NAMES"] = Py::Int(FT_FACE_FLAG_GLYPH_NAMES); + d["EXTERNAL_STREAM"] = Py::Int(FT_FACE_FLAG_EXTERNAL_STREAM); + d["ITALIC"] = Py::Int(FT_STYLE_FLAG_ITALIC); + d["BOLD"] = Py::Int(FT_STYLE_FLAG_BOLD); d["KERNING_DEFAULT"] = Py::Int(FT_KERNING_DEFAULT); d["KERNING_UNFITTED"] = Py::Int(FT_KERNING_UNFITTED); d["KERNING_UNSCALED"] = Py::Int(FT_KERNING_UNSCALED); - d["LOAD_DEFAULT"] = Py::Long(FT_LOAD_DEFAULT); - d["LOAD_NO_SCALE"] = Py::Long(FT_LOAD_NO_SCALE); - d["LOAD_NO_HINTING"] = Py::Long(FT_LOAD_NO_HINTING); - d["LOAD_RENDER"] = Py::Long(FT_LOAD_RENDER); - d["LOAD_NO_BITMAP"] = Py::Long(FT_LOAD_NO_BITMAP); + d["LOAD_DEFAULT"] = Py::Long(FT_LOAD_DEFAULT); + d["LOAD_NO_SCALE"] = Py::Long(FT_LOAD_NO_SCALE); + d["LOAD_NO_HINTING"] = Py::Long(FT_LOAD_NO_HINTING); + d["LOAD_RENDER"] = Py::Long(FT_LOAD_RENDER); + d["LOAD_NO_BITMAP"] = Py::Long(FT_LOAD_NO_BITMAP); d["LOAD_VERTICAL_LAYOUT"] = Py::Long(FT_LOAD_VERTICAL_LAYOUT); d["LOAD_FORCE_AUTOHINT"] = Py::Long(FT_LOAD_FORCE_AUTOHINT); d["LOAD_CROP_BITMAP"] = Py::Long(FT_LOAD_CROP_BITMAP); From 1131d0525df6266e2c9e0b699d1c3940987ce1fc Mon Sep 17 00:00:00 2001 From: Reinier Heeres Date: Thu, 10 Dec 2009 00:09:03 +0000 Subject: [PATCH 262/324] Mplot3d: fix scatter3d markers bug svn path=/branches/v0_99_maint/; revision=8016 --- lib/mpl_toolkits/mplot3d/art3d.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py index cec906e42360..19975d6c3747 100644 --- a/lib/mpl_toolkits/mplot3d/art3d.py +++ b/lib/mpl_toolkits/mplot3d/art3d.py @@ -240,6 +240,7 @@ class Patch3DCollection(PatchCollection): def __init__(self, *args, **kwargs): PatchCollection.__init__(self, *args, **kwargs) + self._old_draw = lambda x: PatchCollection.draw(self, x) def set_3d_properties(self, zs, zdir): xs, ys = zip(*self.get_offsets()) @@ -259,10 +260,15 @@ def do_3d_projection(self, renderer): return min(vzs) def draw(self, renderer): - PatchCollection.draw(self, renderer) + self._old_draw(renderer) def patch_collection_2d_to_3d(col, zs=0, zdir='z'): """Convert a PatchCollection to a Patch3DCollection object.""" + + # The tricky part here is that there are several classes that are + # derived from PatchCollection. We need to use the right draw method. + col._old_draw = col.draw + col.__class__ = Patch3DCollection col.set_3d_properties(zs, zdir) From 92181afd7885206d90bd6c404e6086b9d1526ac7 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 16 Dec 2009 19:21:44 +0000 Subject: [PATCH 263/324] add mpl book to index sidebar svn path=/branches/v0_99_maint/; revision=8036 --- doc/_templates/indexsidebar.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html index 77f69e3ac712..fb2695e1c986 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -8,6 +8,12 @@

News

pathto('users/installing') }}">installing

+

Sandro Tosi has a new book +Matplotlib for python +developers +also +at amazon.

+

Build websites like matplotlib's, with sphinx and extensions for mpl plots, math, inheritance diagrams -- try From 063dd0a135b8398a8c5dae825beb450eb4a502cc Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 31 Dec 2009 15:46:58 +0000 Subject: [PATCH 264/324] [2916753] Wrong API signature- yscale svn path=/branches/v0_99_maint/; revision=8057 --- lib/matplotlib/pyplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 68cefaf5288e..8805e2498587 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -954,7 +954,7 @@ def yscale(*args, **kwargs): """ call signature:: - xscale(scale, **kwargs) + yscale(scale, **kwargs) Set the scaling for the y-axis: %(scale)s From 8f703d30ca29c85030cea4de579a154a710f4137 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 4 Jan 2010 14:14:38 +0000 Subject: [PATCH 265/324] Fix bug in PDF, PS, SVG and OS-X backends: do not simplify filled paths. svn path=/branches/v0_99_maint/; revision=8068 --- lib/matplotlib/backends/backend_pdf.py | 16 +++++--- lib/matplotlib/backends/backend_ps.py | 21 ++++++---- lib/matplotlib/backends/backend_svg.py | 21 ++++++---- src/_macosx.m | 56 +++++++++++++------------- 4 files changed, 64 insertions(+), 50 deletions(-) diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index aeed7668d502..738de070a1bc 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -1043,7 +1043,8 @@ def writeHatches(self): # an API change self.output(*self.pathOperations( Path.hatch(hatch_style[2]), - Affine2D().scale(sidelen))) + Affine2D().scale(sidelen), + simplify=False)) self.output(Op.stroke) self.endStream() @@ -1124,7 +1125,7 @@ def writeImages(self): def markerObject(self, path, trans, fillp, lw): """Return name of a marker XObject representing the given path.""" - pathops = self.pathOperations(path, trans) + pathops = self.pathOperations(path, trans, simplify=False) key = (tuple(pathops), bool(fillp)) result = self.markers.get(key) if result is None: @@ -1153,10 +1154,11 @@ def writeMarkers(self): self.endStream() @staticmethod - def pathOperations(path, transform, clip=None): + def pathOperations(path, transform, clip=None, simplify=None): cmds = [] last_points = None - for points, code in path.iter_segments(transform, clip=clip): + for points, code in path.iter_segments(transform, clip=clip, + simplify=simplify): if code == Path.MOVETO: cmds.extend(points) cmds.append(Op.moveto) @@ -1178,9 +1180,11 @@ def pathOperations(path, transform, clip=None): def writePath(self, path, transform, clip=False): if clip: clip = (0.0, 0.0, self.width * 72, self.height * 72) + simplify = path.should_simplify else: clip = None - cmds = self.pathOperations(path, transform, clip) + simplify = False + cmds = self.pathOperations(path, transform, clip, simplify=simplify) self.output(*cmds) def reserveObject(self, name=''): @@ -1852,7 +1856,7 @@ def clip_cmd(self, cliprect, clippath): if self._clippath != clippath: path, affine = clippath.get_transformed_path_and_affine() cmds.extend( - PdfFile.pathOperations(path, affine) + + PdfFile.pathOperations(path, affine, simplify=False) + [Op.clip, Op.endpath]) return cmds diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 1c3fc3911f74..e32000ec6b43 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -248,7 +248,8 @@ def create_hatch(self, hatch): 0 setlinewidth """ % locals()) self._pswriter.write( - self._convert_path(Path.hatch(hatch), Affine2D().scale(72.0))) + self._convert_path(Path.hatch(hatch), Affine2D().scale(72.0), + simplify=False)) self._pswriter.write("""\ stroke } bind @@ -427,7 +428,7 @@ def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): # unflip im.flipud_out() - def _convert_path(self, path, transform, clip=False): + def _convert_path(self, path, transform, clip=False, simplify=None): ps = [] last_points = None if clip: @@ -435,7 +436,8 @@ def _convert_path(self, path, transform, clip=False): self.height * 72.0) else: clip = None - for points, code in path.iter_segments(transform, clip=clip): + for points, code in path.iter_segments(transform, clip=clip, + simplify=simplify): if code == Path.MOVETO: ps.append("%g %g m" % tuple(points)) elif code == Path.LINETO: @@ -458,7 +460,8 @@ def _get_clip_path(self, clippath, clippath_transform): if id is None: id = 'c%x' % len(self._clip_paths) ps_cmd = ['/%s {' % id] - ps_cmd.append(self._convert_path(clippath, clippath_transform)) + ps_cmd.append(self._convert_path(clippath, clippath_transform, + simplify=False)) ps_cmd.extend(['clip', 'newpath', '} bind def\n']) self._pswriter.write('\n'.join(ps_cmd)) self._clip_paths[(clippath, clippath_transform)] = id @@ -468,9 +471,10 @@ def draw_path(self, gc, path, transform, rgbFace=None): """ Draws a Path instance using the given affine transform. """ + clip = (rgbFace is None and gc.get_hatch_path() is None) + simplify = path.should_simplify and clip ps = self._convert_path( - path, transform, - clip=(rgbFace is None and gc.get_hatch_path() is None)) + path, transform, clip=clip, simplify=simplify) self._draw_ps(ps, gc, rgbFace) def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): @@ -491,7 +495,8 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None) # construct the generic marker command: ps_cmd = ['/o {', 'gsave', 'newpath', 'translate'] # dont want the translate to be global - ps_cmd.append(self._convert_path(marker_path, marker_trans)) + ps_cmd.append(self._convert_path(marker_path, marker_trans, + simplify=False)) if rgbFace: ps_cmd.extend(['gsave', ps_color, 'fill', 'grestore']) @@ -518,7 +523,7 @@ def draw_path_collection(self, master_transform, cliprect, clippath, name = 'p%x_%x' % (self._path_collection_id, i) ps_cmd = ['/%s {' % name, 'newpath', 'translate'] - ps_cmd.append(self._convert_path(path, transform)) + ps_cmd.append(self._convert_path(path, transform, simplify=False)) ps_cmd.extend(['} bind def\n']) write('\n'.join(ps_cmd)) path_codes.append(name) diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index 3a47caff1eb5..97aabb05a9ca 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -101,7 +101,8 @@ def _get_hatch(self, gc, rgbFace): self._svgwriter.write(' width="%d" height="%d" >\n' % (HATCH_SIZE, HATCH_SIZE)) path_data = self._convert_path( gc.get_hatch_path(), - Affine2D().scale(HATCH_SIZE).scale(1.0, -1.0).translate(0, HATCH_SIZE)) + Affine2D().scale(HATCH_SIZE).scale(1.0, -1.0).translate(0, HATCH_SIZE), + simplify=False) if rgbFace is None: fill = 'none' else: @@ -159,7 +160,7 @@ def _get_gc_clip_svg(self, gc): clippath, clippath_trans = gc.get_clip_path() if clippath is not None: clippath_trans = self._make_flip_transform(clippath_trans) - path_data = self._convert_path(clippath, clippath_trans) + path_data = self._convert_path(clippath, clippath_trans, simplify=False) path = '' % path_data elif cliprect is not None: x, y, w, h = cliprect.bounds @@ -210,7 +211,7 @@ def _make_flip_transform(self, transform): .scale(1.0, -1.0) .translate(0.0, self.height)) - def _convert_path(self, path, transform, clip=False): + def _convert_path(self, path, transform, clip=False, simplify=None): path_data = [] appender = path_data.append path_commands = self._path_commands @@ -219,7 +220,8 @@ def _convert_path(self, path, transform, clip=False): clip = (0.0, 0.0, self.width, self.height) else: clip = None - for points, code in path.iter_segments(transform, clip=clip): + for points, code in path.iter_segments(transform, clip=clip, + simplify=simplify): if code == Path.CLOSEPOLY: segment = 'z' else: @@ -234,15 +236,18 @@ def _convert_path(self, path, transform, clip=False): def draw_path(self, gc, path, transform, rgbFace=None): trans_and_flip = self._make_flip_transform(transform) + clip = (rgbFace is None and gc.get_hatch_path() is None) + simplify = path.should_simplify and clip path_data = self._convert_path( - path, trans_and_flip, - clip=(rgbFace is None and gc.get_hatch_path() is None)) + path, trans_and_flip, clip=clip, simplify=simplify) self._draw_svg_element('path', 'd="%s"' % path_data, gc, rgbFace) def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): write = self._svgwriter.write - key = self._convert_path(marker_path, marker_trans + Affine2D().scale(1.0, -1.0)) + key = self._convert_path(marker_path, + marker_trans + Affine2D().scale(1.0, -1.0), + simplify=False) name = self._markers.get(key) if name is None: name = 'm%s' % md5(key).hexdigest() @@ -276,7 +281,7 @@ def draw_path_collection(self, master_transform, cliprect, clippath, for i, (path, transform) in enumerate(self._iter_collection_raw_paths( master_transform, paths, all_transforms)): transform = Affine2D(transform.get_matrix()).scale(1.0, -1.0) - d = self._convert_path(path, transform) + d = self._convert_path(path, transform, simplify=False) name = 'coll%x_%x_%s' % (self._path_collection_id, i, md5(d).hexdigest()) write('\n' % (name, d)) diff --git a/src/_macosx.m b/src/_macosx.m index dc4190139090..cb9e3235384b 100644 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -536,7 +536,7 @@ static int _get_snap(GraphicsContext* self, enum e_quantize_mode* mode) return NULL; } CGContextSetAlpha(cr, alpha); - + self->color[3] = alpha; Py_INCREF(Py_None); @@ -881,7 +881,7 @@ static int _get_snap(GraphicsContext* self, enum e_quantize_mode* mode) 0, rect, QUANTIZE_AUTO, - 1); + rgbFace == NULL); if (!iterator) { PyErr_SetString(PyExc_RuntimeError, @@ -958,7 +958,7 @@ static int _get_snap(GraphicsContext* self, enum e_quantize_mode* mode) 0, rect, QUANTIZE_AUTO, - 1); + 0); if (!iterator) { Py_DECREF(hatchpath); @@ -1143,14 +1143,14 @@ static BOOL _clip(CGContextRef cr, PyObject* object) Py_DECREF(translation); PyErr_SetString(PyExc_ValueError, "transform_point did not return a NumPy array"); - return false; + return false; } if (PyArray_NDIM(translation)!=1 || PyArray_DIM(translation, 0)!=2) { Py_DECREF(translation); PyErr_SetString(PyExc_ValueError, "transform_point did not return an approriate array"); - return false; + return false; } tx = (CGFloat)(*(double*)PyArray_GETPTR1(translation, 0)); ty = (CGFloat)(*(double*)PyArray_GETPTR1(translation, 1)); @@ -1261,7 +1261,7 @@ static BOOL _clip(CGContextRef cr, PyObject* object) master.c = c; master.d = d; master.tx = tx; - master.ty = ty; + master.ty = ty; if (!ok) goto exit; CGContextConcatCTM(cr, master); } @@ -1429,7 +1429,7 @@ static BOOL _clip(CGContextRef cr, PyObject* object) Py_ssize_t Nlinestyles = PySequence_Size(linestyles); Py_ssize_t Naa = PySequence_Size(antialiaseds); if (N < Nlinestyles) Nlinestyles = N; - if ((Nfacecolors == 0 && Nedgecolors == 0) || Np == 0) goto exit; + if ((Nfacecolors == 0 && Nedgecolors == 0) || Np == 0) goto exit; /* Preset graphics context properties if possible */ if (Naa==1) @@ -1674,7 +1674,7 @@ static BOOL _clip(CGContextRef cr, PyObject* object) master.c = c; master.d = d; master.tx = tx; - master.ty = ty; + master.ty = ty; } else { @@ -2288,7 +2288,7 @@ static BOOL _clip(CGContextRef cr, PyObject* object) width = CTLineGetTypographicBounds(line, &ascent, &descent, NULL); rect = CTLineGetImageBounds(line, cr); - + CFRelease(line); return Py_BuildValue("fff", width, rect.size.height, descent); @@ -3044,7 +3044,7 @@ static void _data_provider_release(void* info, const void* data, size_t size) } /* NSSize contains CGFloat; cannot use size directly */ if(!PyArg_ParseTuple(args, "u#dd", - &characters, &n, &width, &height)) return NULL; + &characters, &n, &width, &height)) return NULL; size.width = width; size.height = height; @@ -3058,7 +3058,7 @@ static void _data_provider_release(void* info, const void* data, size_t size) NSRect rect = [view bounds]; NSString* filename = [NSString stringWithCharacters: characters - length: (unsigned)n]; + length: (unsigned)n]; NSString* extension = [filename pathExtension]; /* Calling dataWithPDFInsideRect on the view causes its update status @@ -3077,23 +3077,23 @@ static void _data_provider_release(void* info, const void* data, size_t size) if (! [extension isEqualToString: @"tiff"] && ! [extension isEqualToString: @"tif"]) { - NSBitmapImageFileType filetype; - NSBitmapImageRep* bitmapRep = [NSBitmapImageRep imageRepWithData: data]; - if ([extension isEqualToString: @"bmp"]) - filetype = NSBMPFileType; - else if ([extension isEqualToString: @"gif"]) - filetype = NSGIFFileType; - else if ([extension isEqualToString: @"jpg"] || - [extension isEqualToString: @"jpeg"]) - filetype = NSJPEGFileType; - else if ([extension isEqualToString: @"png"]) - filetype = NSPNGFileType; - else - { PyErr_SetString(PyExc_ValueError, "Unknown file type"); - return NULL; - } - - data = [bitmapRep representationUsingType:filetype properties:nil]; + NSBitmapImageFileType filetype; + NSBitmapImageRep* bitmapRep = [NSBitmapImageRep imageRepWithData: data]; + if ([extension isEqualToString: @"bmp"]) + filetype = NSBMPFileType; + else if ([extension isEqualToString: @"gif"]) + filetype = NSGIFFileType; + else if ([extension isEqualToString: @"jpg"] || + [extension isEqualToString: @"jpeg"]) + filetype = NSJPEGFileType; + else if ([extension isEqualToString: @"png"]) + filetype = NSPNGFileType; + else + { PyErr_SetString(PyExc_ValueError, "Unknown file type"); + return NULL; + } + + data = [bitmapRep representationUsingType:filetype properties:nil]; } [data writeToFile: filename atomically: YES]; From 96732509707f564b1adda6d0e11859e5c4ddc373 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 4 Jan 2010 14:28:57 +0000 Subject: [PATCH 266/324] Fix doc 'clean' svn path=/branches/v0_99_maint/; revision=8070 --- doc/make.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/make.py b/doc/make.py index 7d02e778ffb9..0e4636a9a877 100755 --- a/doc/make.py +++ b/doc/make.py @@ -67,13 +67,13 @@ def latex(): def clean(): shutil.rmtree("build") shutil.rmtree("examples") - for pattern in ['doc/mpl_examples/api/*.png', - 'doc/mpl_examples/pylab_examples/*.png', - 'doc/mpl_examples/pylab_examples/*.pdf', - 'doc/mpl_examples/units/*.png', - 'doc/pyplots/tex_demo.png', - 'doc/_static/matplotlibrc', - 'doc/_templates/gallery.html']: + for pattern in ['mpl_examples/api/*.png', + 'mpl_examples/pylab_examples/*.png', + 'mpl_examples/pylab_examples/*.pdf', + 'mpl_examples/units/*.png', + 'pyplots/tex_demo.png', + '_static/matplotlibrc', + '_templates/gallery.html']: for filename in glob.glob(pattern): if os.path.exists(filename): os.remove(filename) From c492ff8b29b2fd8b0ddb93c01b50731d942bc871 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Tue, 19 Jan 2010 00:26:16 +0000 Subject: [PATCH 267/324] update annotate documentation to explain *annotation_clip* parameter svn path=/branches/v0_99_maint/; revision=8092 --- lib/matplotlib/text.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index acfee1a46b8d..a1fa0b8712bf 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1438,6 +1438,14 @@ def __init__(self, s, xy, # 5 points below the top border xy=(10,-5), xycoords='axes points' + + The *annotation_clip* attribute contols the visibility of the + annotation when it goes outside the axes area. If True, the + annotation will only be drawn when the *xy* is inside the + axes. If False, the annotation will always be drawn regardless + of its position. The default is *None*, which behave as True + only if *xycoords* is"data". + Additional kwargs are Text properties: %(Text)s From 64b3b06100cd6a08f8a5bccfe3f6c7548cf8f15a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 8 Feb 2010 15:57:45 +0000 Subject: [PATCH 268/324] Fix for libpng-1.4 compatibility svn path=/branches/v0_99_maint/; revision=8116 --- src/_png.cpp | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/_png.cpp b/src/_png.cpp index 352a4169dd89..b2eb20178b87 100644 --- a/src/_png.cpp +++ b/src/_png.cpp @@ -130,12 +130,12 @@ Py::Object _png_module::write_png(const Py::Tuple& args) png_init_io(png_ptr, fp); } else { png_set_write_fn(png_ptr, (void*)py_fileobj.ptr(), - &write_png_data, &flush_png_data); + &write_png_data, &flush_png_data); } png_set_IHDR(png_ptr, info_ptr, - width, height, 8, - PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + width, height, 8, + PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); // Save the dpi of the image in the file if (args.size() == 5) { @@ -181,7 +181,7 @@ _png_module::read_png(const Py::Tuple& args) { args.verify_length(1); std::string fname = Py::String(args[0]); - png_byte header[8]; // 8 is the maximum size that can be checked + png_byte header[8]; // 8 is the maximum size that can be checked FILE *fp = fopen(fname.c_str(), "rb"); if (!fp) @@ -272,25 +272,29 @@ _png_module::read_png(const Py::Tuple& args) { for (png_uint_32 y = 0; y < height; y++) { png_byte* row = row_pointers[y]; - for (png_uint_32 x = 0; x < width; x++) { - size_t offset = y*A->strides[0] + x*A->strides[1]; - if (bit_depth == 16) { - png_uint_16* ptr = &reinterpret_cast (row)[x * dimensions[2]]; + for (png_uint_32 x = 0; x < width; x++) { + size_t offset = y*A->strides[0] + x*A->strides[1]; + if (bit_depth == 16) { + png_uint_16* ptr = &reinterpret_cast (row)[x * dimensions[2]]; for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++) - *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value; - } else { - png_byte* ptr = &(row[x * dimensions[2]]); - for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++) - { - *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value; - } - } + *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value; + } else { + png_byte* ptr = &(row[x * dimensions[2]]); + for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++) + { + *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value; + } + } } } //free the png memory png_read_end(png_ptr, info_ptr); +#ifndef png_infopp_NULL + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); +#else png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); +#endif fclose(fp); for (row = 0; row < height; row++) delete [] row_pointers[row]; From 24ccb6e1ee2ee228b75335e03bd5e98927862d42 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 8 Feb 2010 17:50:27 +0000 Subject: [PATCH 269/324] added Ariels csd patch for proper scaling at the dc component svn path=/branches/v0_99_maint/; revision=8121 --- doc/faq/installing_faq.rst | 13 ++++---- doc/glossary/index.rst | 13 ++++++++ doc/users/installing.rst | 61 +++++++++++++++++++++----------------- lib/matplotlib/mlab.py | 16 +++++++--- 4 files changed, 65 insertions(+), 38 deletions(-) diff --git a/doc/faq/installing_faq.rst b/doc/faq/installing_faq.rst index ccd1e027d19f..c53e0da347ec 100644 --- a/doc/faq/installing_faq.rst +++ b/doc/faq/installing_faq.rst @@ -146,11 +146,11 @@ generate postscript images from some numerical simulations, and still others in web application servers to dynamically serve up graphs. To support all of these use cases, matplotlib can target different -outputs, and each of these capabililities is called a backend (the +outputs, and each of these capabililities is called a backend; the "frontend" is the user facing code, ie the plotting code, whereas the "backend" does all the dirty work behind the scenes to make the figure. There are two types of backends: user interface backends (for -use in pygtk, wxpython, tkinter, qt or fltk) and hardcopy backends to +use in pygtk, wxpython, tkinter, qt, macosx, or fltk) and hardcopy backends to make image files (PNG, SVG, PDF, PS). There are a two primary ways to configure your backend. One is to set @@ -183,10 +183,10 @@ from the canvas (the place where the drawing goes). The canonical renderer for user interfaces is ``Agg`` which uses the `antigrain `_ C++ library to make a raster (pixel) image of the figure. All of the user interfaces can be used with agg -rendering, eg ``WXAgg``, ``GTKAgg``, ``QTAgg``, ``TkAgg``. In -addition, some of the user interfaces support other rendering engines. -For example, with GTK, you can also select GDK rendering (backend -``GTK``) or Cairo rendering (backend ``GTKCairo``). +rendering, eg ``WXAgg``, ``GTKAgg``, ``QTAgg``, ``TkAgg``, +``CocoaAgg``. In addition, some of the user interfaces support other +rendering engines. For example, with GTK, you can also select GDK +rendering (backend ``GTK``) or Cairo rendering (backend ``GTKCairo``). For the rendering engines, one can also distinguish between `vector `_ or `raster @@ -238,6 +238,7 @@ TkAgg Agg rendering to a :term:`Tk` canvas (requires TkInter_) QtAgg Agg rendering to a :term:`Qt` canvas (requires PyQt_) Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_) FLTKAgg Agg rendering to a :term:`FLTK` canvas (requires pyFLTK_) +macosx Cocoa rendering in OSX windows ============ ================================================================ .. _`Anti-Grain Geometry`: http://www.antigrain.com/ diff --git a/doc/glossary/index.rst b/doc/glossary/index.rst index 7db5c0e519d9..b2b0ee492f62 100644 --- a/doc/glossary/index.rst +++ b/doc/glossary/index.rst @@ -14,6 +14,11 @@ Glossary Cairo The `Cairo graphics `_ engine + + dateutil + The `dateutil `_ library + provides extensions to the standard datetime module + EPS Encapsulated Postscript (`EPS `_) @@ -86,6 +91,14 @@ Glossary language widely used for scripting, application development, web application servers, scientific computing and more. + + pytz + `pytz `_ provides the Olson tz + database in Python. it allows accurate and cross platform + timezone calculations and solves the issue of ambiguous times at + the end of daylight savings + + Qt `Qt `__ is a cross-platform application framework for desktop and embedded development. diff --git a/doc/users/installing.rst b/doc/users/installing.rst index 52ced3396edc..e2a4cd8008fc 100644 --- a/doc/users/installing.rst +++ b/doc/users/installing.rst @@ -44,10 +44,29 @@ progress:: matplotlib requires numpy version 1.1 or later. Although it is not a requirement to use matplotlib, we strongly encourage you to install `ipython `_, which is an interactive -shell for python that is matplotlib aware. Once you have ipython, -numpy and matplotlib installed, in ipython's "pylab" mode you have a -matlab-like environment that automatically handles most of the -configuration details for you, so you can get up and running quickly:: +shell for python that is matplotlib aware. + +Next we need to get matplotlib installed. We provide prebuilt +binaries for OS X and Windows on the matplotlib `download +`_ page. Click on +the latest release of the "matplotlib" package, choose your python +version (2.5 or 2.6) and your platform (macosx or win32) and you +should be good to go. If you have any problems, please check the +:ref:`installing-faq`, google around a little bit, and post a question +the `mailing list +`_. If +you are on debian/unbuntu linux, it suffices to do:: + + > sudo apt-get install python-matplotlib + +Instructions for installing our OSX binaries are found in the FAQ +:ref:`install_osx_binaries`. + + +Once you have ipython, numpy and matplotlib installed, in ipython's +"pylab" mode you have a matlab-like environment that automatically +handles most of the configuration details for you, so you can get up +and running quickly:: johnh@flag:~> ipython -pylab Python 2.4.5 (#4, Apr 12 2008, 09:09:16) @@ -60,20 +79,6 @@ configuration details for you, so you can get up and running quickly:: In [2]: hist(x, 100) -And a *voila*, a figure pops up. But we are putting the cart ahead of -the horse -- first we need to get matplotlib installed. We provide -prebuilt binaries for OS X and Windows on the matplotlib `download -`_ page. Click on -the latest release of the "matplotlib" package, choose your python -version (2.4 or 2.5) and your platform (macosx or win32) and you -should be good to go. If you have any problems, please check the -:ref:`installing-faq`, google around a little bit, and post a question -the `mailing list -`_. - -Instructions for installing our OSX binaries are found in the FAQ -ref:`install_osx_binaries`. - Note that when testing matplotlib installations from the interactive python console, there are some issues relating to user interface toolkits and interactive settings that are discussed in @@ -85,9 +90,9 @@ Installing from source ====================== If you are interested perhaps in contributing to matplotlib -development, or just like to build everything yourself, it is not -difficult to build matplotlib from source. Grab the latest *tar.gz* -release file from `sourceforge +development, running the latest greatest code, or just like to +build everything yourself, it is not difficult to build matplotlib +from source. Grab the latest *tar.gz* release file from `sourceforge `_, or if you want to develop matplotlib or just need the latest bugfixed version, grab the latest svn version :ref:`install-svn`. @@ -173,17 +178,17 @@ backends and the capabilities they provide agg template source statically, so it will not affect anything on your system outside of matplotlib. -pytz 2007g or later +:term:`pytz` 2007g or later timezone handling for python datetime objects. By default, matplotlib will install pytz if it isn't already installed on your - system. To override the default, use setup.cfg to force or + system. To override the default, use :file:`setup.cfg to force or prevent installation of pytz. -dateutil 1.1 or later - extensions to python datetime handling. By - default, matplotlib will install dateutil if it isn't already - installed on your system. To override the default, use setup.cfg - to force or prevent installation of dateutil. +:term:`dateutil` 1.1 or later + provides extensions to python datetime handling. By default, matplotlib + will install dateutil if it isn't already installed on your + system. To override the default, use :file:`setup.cfg` to force + or prevent installation of dateutil. diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index cc72c7fe9859..a9db6d7682cc 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -273,10 +273,18 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none, Pxy[:,i] = np.conjugate(fx[:numFreqs]) * fy[:numFreqs] # Scale the spectrum by the norm of the window to compensate for - # windowing loss; see Bendat & Piersol Sec 11.5.2. Also include - # scaling factors for one-sided densities and dividing by the sampling - # frequency, if desired. - Pxy *= scaling_factor / (np.abs(windowVals)**2).sum() + # windowing loss; see Bendat & Piersol Sec 11.5.2. + Pxy *= 1 / (np.abs(windowVals)**2).sum() + + # Also include scaling factors for one-sided densities and dividing by the + # sampling frequency, if desired. Scale everything, except the DC component + # and the NFFT/2 component: + Pxy[1:-1] *= scaling_factor + + #But do scale those components by Fs, if required + if scale_by_freq: + Pxy[[0,-1]] /= Fs + t = 1./Fs * (ind + NFFT / 2.) freqs = float(Fs) / pad_to * np.arange(numFreqs) From 4b2b8298fddf5ca745b9e341027bfb2b8637e5d6 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Tue, 16 Feb 2010 22:55:27 +0000 Subject: [PATCH 270/324] fix a bug in Text._get_layout that returns an incorrect information for an empty string svn path=/branches/v0_99_maint/; revision=8135 --- lib/matplotlib/text.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index a1fa0b8712bf..7f8728fe402a 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -275,8 +275,11 @@ def _get_layout(self, renderer): baseline = None for i, line in enumerate(lines): clean_line, ismath = self.is_math_text(line) - w, h, d = renderer.get_text_width_height_descent( - clean_line, self._fontproperties, ismath=ismath) + if clean_line: + w, h, d = renderer.get_text_width_height_descent( + clean_line, self._fontproperties, ismath=ismath) + else: + w, h, d = 0, 0, 0 if baseline is None: baseline = h - d whs[i] = w, h From 90bf7a7b6c9f7b9d4a0132e81e1317631ff8ab58 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 22 Feb 2010 14:31:45 +0000 Subject: [PATCH 271/324] fix setters for regular polygon svn path=/branches/v0_99_maint/; revision=8145 --- lib/matplotlib/patches.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index f094970b37d4..902d0145f5d6 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -631,19 +631,22 @@ def _update_transform(self): def _get_xy(self): return self._xy def _set_xy(self, xy): + self._xy = xy self._update_transform() xy = property(_get_xy, _set_xy) def _get_orientation(self): return self._orientation - def _set_orientation(self, xy): - self._orientation = xy + def _set_orientation(self, orientation): + self._orientation = orientation + self._update_transform() orientation = property(_get_orientation, _set_orientation) def _get_radius(self): return self._radius - def _set_radius(self, xy): - self._radius = xy + def _set_radius(self, radius): + self._radius = radius + self._update_transform() radius = property(_get_radius, _set_radius) def _get_numvertices(self): From 19873d1b80af7e7e3c5d945aeba0979178b83c36 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 22 Feb 2010 16:22:28 +0000 Subject: [PATCH 272/324] Backporting numpy version check fix to 0.99 branch svn path=/branches/v0_99_maint/; revision=8146 --- doc/make.py | 5 +++-- setupext.py | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/make.py b/doc/make.py index 0e4636a9a877..5bad51d62e96 100755 --- a/doc/make.py +++ b/doc/make.py @@ -65,8 +65,9 @@ def latex(): print 'latex build has not been tested on windows' def clean(): - shutil.rmtree("build") - shutil.rmtree("examples") + for dirpath in ['build', 'examples']: + if os.path.exists(dirpath): + shutil.rmtree(dirpath) for pattern in ['mpl_examples/api/*.png', 'mpl_examples/pylab_examples/*.png', 'mpl_examples/pylab_examples/*.pdf', diff --git a/setupext.py b/setupext.py index 849ee32add31..cb53252e26dc 100644 --- a/setupext.py +++ b/setupext.py @@ -499,9 +499,10 @@ def check_for_numpy(): return False nn = numpy.__version__.split('.') if not (int(nn[0]) >= 1 and int(nn[1]) >= 1): - print_message( - 'numpy 1.1 or later is required; you have %s' % numpy.__version__) - return False + if not int(nn[0]) >= 1: + print_message( + 'numpy 1.1 or later is required; you have %s' % numpy.__version__) + return False module = Extension('test', []) add_numpy_flags(module) add_base_flags(module) From 2ae46827b85f88861c118d77a49ab4ea7cedff3e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 26 Feb 2010 16:27:22 +0000 Subject: [PATCH 273/324] Fix offset_copy: the fig argument should be optional. svn path=/branches/v0_99_maint/; revision=8160 --- lib/matplotlib/transforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index bb1785067211..867bc8ea620e 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -2265,7 +2265,7 @@ def interval_contains_open(interval, val): ((a < b) and (a < val and b > val)) or (b < val and a > val)) -def offset_copy(trans, fig, x=0.0, y=0.0, units='inches'): +def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'): ''' Return a new transform with an added offset. args: From c13a68135b4ddf3f8f26518e6f32c7b1f950715d Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 3 Mar 2010 15:47:48 +0000 Subject: [PATCH 274/324] added favicon svn path=/branches/v0_99_maint/; revision=8171 --- doc/_static/favicon.ico | Bin 0 -> 22486 bytes doc/_templates/layout.html | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 doc/_static/favicon.ico diff --git a/doc/_static/favicon.ico b/doc/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..dc57242b5b93bdb1787ef43296858ce2d6d2f6d8 GIT binary patch literal 22486 zcmeHvd0bRS_HSJkF^XoQnapJ7Hxp-)naSWnG!k(~qXu^nH7#)=QCVDZ1y@>e!M()| z6`|b_H^h||0bATq5phRF!5w#05NMiv-uG1ZMNBep=KbD#pU?Z_RV?cEy|tV=b?R(Y zCqgKqy7=lVfwG2(t0RP;5Tbs4`|lb;)cH_|-~7h*JHSDRgTE8@`t?QJ--P({pS1e; zjd~|LX!YxhfNDaF_7>tx^ob#aFEWqANncYIwm-_dXCe}Myje9toqquz`&Cfj4Mp6u$i47j2CgD^Cb~77T!1)E8#t zJY<3FUcbJmudk2(&=&3W_1*E>9sl^ZuP_^Zxkrqz$2dk|cFz+fB_$#~JzeDI=Zoy@ zY!MJg!elaufNTITK3eTfJNF^DXTlb4q*Jj3&Zp7JqvfhYlvzWnk_5fH8y z21BH94=@V%$OPem9G8GH#4OUyX5pdF64_Z(^&%YE6YHc$ z)*0{)bYzUvi#U@W?ZSmFAYAwcg$uV3;21doIS5&=M+rJIAV)@G4U8y}4JLfUdW5Hk zi|l-~(_tNau_i$V;R|{Rz#0W1haiU=3?dRa4mlj_7H&q)GKjByBZX%W){QgPFC;t? z@I``dv7Vr(5M%@B)QB91Y%t;(ISx4iS(gwgBC}D37}3^sq_Msn>187=^Dtw*`=9li-whIRDNvc>NZ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0i<@v#KIyl@PN^h*>4X ztP)~YRm7|kVpc6hMQ`~I*5%ZcWR8ms2Cv|KDPcx@tcv(p`3o_!gcw;uj4UBW7I#0- zp-zdchw~lw#ZJV1@B+jwtBA=Z#N-lUatSfHgqU1HOfDfNmk^Unh{?syF9Hvj_dp~s z!dcNP!~qlHfK|i+6XJkX!~qlHfC+KHgg9VA955jcm=Fg{hy$iOdAW=yK3`EeHV!e! zDr^B2G021%WVJuo9%7IQG021%WI_xwAqJTcgG`7)hL7kzpY6d`DU$6G|NIK^&xH7A zLi{r!{+ST}Oo)Fb#6J__p9%5L5+8_vmS>Z4ZNbw(XZI0%JtX&5PBCJyRm5JGBlcQF z>@^|wnh<+Uh`lDnUK3)k39;9b5Aq-8fuNZ|u=hCDJDG_DsT48agqUyWyXAzKZ$ivB zA?BM9^Q|K08*6NlN&wCr&hz;b{Ag9ij2_VdcLE9!UrvZGw;;Y;MSQu6_;MBTTr?bUkq>>n;C - +

Date: Wed, 3 Mar 2010 17:15:58 +0000 Subject: [PATCH 277/324] added support for favicon in docs build svn path=/branches/v0_99_maint/; revision=8174 --- doc/_templates/indexsidebar.html | 2 +- doc/_templates/layout.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html index fb2695e1c986..a183402d2797 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -9,7 +9,7 @@

News

Sandro Tosi has a new book -Matplotlib for python +Matplotlib for python developers also at amazon.

diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html index 54d60510f251..49db6a305047 100644 --- a/doc/_templates/layout.html +++ b/doc/_templates/layout.html @@ -23,7 +23,7 @@ - +
Date: Fri, 5 Mar 2010 23:51:22 +0000 Subject: [PATCH 279/324] fix a bug in SubplotDivider.new_horizontal that gave incrroect result when pack_start=True svn path=/branches/v0_99_maint/; revision=8179 --- lib/mpl_toolkits/axes_grid/axes_divider.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/mpl_toolkits/axes_grid/axes_divider.py b/lib/mpl_toolkits/axes_grid/axes_divider.py index 56a8c185b856..4e478acae640 100644 --- a/lib/mpl_toolkits/axes_grid/axes_divider.py +++ b/lib/mpl_toolkits/axes_grid/axes_divider.py @@ -449,7 +449,6 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs): locator = self.new_locator(nx=len(self._horizontal)-1, ny=0) ax = self._get_new_axes(**kwargs) - locator = self.new_locator(nx=len(self._horizontal)-1, ny=0) ax.set_axes_locator(locator) return ax From 28c15725f8f8a2a2a3c05724574a8f8674754a62 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Mon, 8 Mar 2010 18:09:55 +0000 Subject: [PATCH 280/324] dates.py: fix num2jul, jul2num; fixes bug 2963391; thanks to G. Lichtenberg svn path=/branches/v0_99_maint/; revision=8181 --- lib/matplotlib/dates.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index 75f2c30dbe84..c97e3cc0d092 100644 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -3,8 +3,9 @@ Matplotlib provides sophisticated date plotting capabilities, standing on the shoulders of python :mod:`datetime`, the add-on modules :mod:`pytz` and :mod:`dateutils`. :class:`datetime` objects are -converted to floating point numbers which represent the number of days -since 0001-01-01 UTC. The helper functions :func:`date2num`, +converted to floating point numbers which represent time in days +since 0001-01-01 UTC, plus 1. For example, 0001-01-01, 06:00 is +1.25, not 0.25. The helper functions :func:`date2num`, :func:`num2date` and :func:`drange` are used to facilitate easy conversion to and from :mod:`datetime` and numeric ranges. @@ -225,7 +226,7 @@ def date2num(d): *d* is either a :class:`datetime` instance or a sequence of datetimes. Return value is a floating point number (or sequence of floats) - which gives number of days (fraction part represents hours, + which gives one plus the number of days (fraction part represents hours, minutes, seconds) since 0001-01-01 00:00:00 UTC. """ if not cbook.iterable(d): return _to_ordinalf(d) @@ -235,17 +236,18 @@ def date2num(d): def julian2num(j): 'Convert a Julian date (or sequence) to a matplotlib date (or sequence).' if cbook.iterable(j): j = np.asarray(j) - return j + 1721425.5 + return j - 1721424.5 def num2julian(n): 'Convert a matplotlib date (or sequence) to a Julian date (or sequence).' if cbook.iterable(n): n = np.asarray(n) - return n - 1721425.5 + return n + 1721424.5 def num2date(x, tz=None): """ - *x* is a float value which gives number of days (fraction part - represents hours, minutes, seconds) since 0001-01-01 00:00:00 UTC. + *x* is a float value which gives one plus the number of days + (fraction part represents hours, minutes, seconds) since + 0001-01-01 00:00:00 UTC. Return value is a :class:`datetime` instance in timezone *tz* (default to rcparams TZ value). From 08d6b4026e3c25f7387d9a7a0d3da9d8122d625b Mon Sep 17 00:00:00 2001 From: John Hunter Date: Tue, 9 Mar 2010 15:41:30 +0000 Subject: [PATCH 281/324] tagging for branch release candidate svn path=/branches/v0_99_maint/; revision=8184 --- lib/matplotlib/__init__.py | 2 +- lib/matplotlib/cbook.py | 4 +++- make.osx | 41 ++++++++++++++++++++++++-------------- release/osx/Makefile | 35 ++++++++++++++++---------------- release/osx/data/setup.cfg | 2 +- 5 files changed, 49 insertions(+), 35 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 6ed461c7cc0f..acb67dbc8da3 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.1.1' +__version__ = '0.99.1.3rc1' __revision__ = '$Revision$' __date__ = '$Date$' diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index ea5dc004c8ac..8ad439ce0eaf 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -20,7 +20,9 @@ try: preferredencoding = locale.getpreferredencoding() -except (ValueError, ImportError): +except ValueError: + preferredencoding = None +except ImportError: preferredencoding = None def unicode_safe(s): diff --git a/make.osx b/make.osx index eae1e0c17dfe..d8fa60b5768f 100644 --- a/make.osx +++ b/make.osx @@ -1,38 +1,47 @@ -# build mpl into a local install dir with +# build mpl into a local install dir with # PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install -MPLVERSION=0.99.1.1 PYVERSION=2.6 PYTHON=python${PYVERSION} ZLIBVERSION=1.2.3 -PNGVERSION=1.2.33 -FREETYPEVERSION=2.3.7 -MACOSX_DEPLOYMENT_TARGET=10.4 +PNGVERSION=1.2.39 +FREETYPEVERSION=2.3.11 +MACOSX_DEPLOYMENT_TARGET=10.6 +OSX_SDK_VER=10.6 +ARCH_FLAGS="-arch i386-arch x86_64" + ## You shouldn't need to configure past this point +#PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" +#CFLAGS="${ARCH_FLAGS} -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" +#LDFLAGS="${ARCH_FLAGS} -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" -CFLAGS="-arch i386 -arch ppc -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" -LDFLAGS="-arch i386 -arch ppc -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" +PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" +CFLAGS="-arch i386 -arch x86_64 -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" +LDFLAGS="-arch i386 -arch x86_64 -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" +FFLAGS="-arch i386 -arch x86_64" clean: rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \ freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-${BDISTMPKGVERSION}.tar.gz \ bdist_mpkg-${BDISTMPKGVERSION} \ - zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} + zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} \ + build + fetch: ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz", "zlib-${ZLIBVERSION}.tar.gz")' &&\ - ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2", "libpng-${PNGVERSION}.tar.bz2")' &&\ + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://downloads.sourceforge.net/project/libpng/libpng-stable/${PNGVERSION}/libpng-${PNGVERSION}.tar.gz", "libpng-${PNGVERSION}.tar.gz")' &&\ ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2", "freetype-${FREETYPEVERSION}.tar.bz2")' zlib: - unset PKG_CONFIG_PATH &&\ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\ rm -rf zlib-${ZLIBVERSION} &&\ - tar xvfz zlib-${ZLIBVERSION}.tar.gz &&\ + tar xvfj zlib-${ZLIBVERSION}.tar.gz &&\ cd zlib-${ZLIBVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ export CFLAGS=${CFLAGS} &&\ @@ -42,9 +51,9 @@ zlib: unset MACOSX_DEPLOYMENT_TARGET png: zlib - unset PKG_CONFIG_PATH &&\ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\ rm -rf libpng-${PNGVERSION} &&\ - tar xvfj libpng-${PNGVERSION}.tar.bz2 + tar xvfz libpng-${PNGVERSION}.tar.gz && \ cd libpng-${PNGVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ export CFLAGS=${CFLAGS} &&\ @@ -56,7 +65,7 @@ png: zlib freetype: zlib - unset PKG_CONFIG_PATH &&\ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\ rm -rf ${FREETYPEVERSION} &&\ tar xvfj freetype-${FREETYPEVERSION}.tar.bz2 &&\ cd freetype-${FREETYPEVERSION} &&\ @@ -73,12 +82,14 @@ deps: zlib png freetype echo 'all done' mpl_build: + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ - ${PYTHON} setup.py build + ${PYTHON} setup.py build mpl_install: + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ diff --git a/release/osx/Makefile b/release/osx/Makefile index 5866bdae946a..6b95793e134c 100644 --- a/release/osx/Makefile +++ b/release/osx/Makefile @@ -2,12 +2,14 @@ PYVERSION=2.6 PYTHON=python${PYVERSION} SRCDIR=${PWD} ZLIBVERSION=1.2.3 -PNGVERSION=1.2.33 +PNGVERSION=1.2.39 FREETYPEVERSION=2.3.7 -MPLVERSION=0.99.0 +MPLVERSION=0.99.1.3rc1 BDISTMPKGVERSION=0.4.4 MPLSRC=matplotlib-${MPLVERSION} -MACOSX_DEPLOYMENT_TARGET=10.4 +OSX_SDK_VER=10.6 +MACOSX_DEPLOYMENT_TARGET=10.6 +BDIST_MPKG=/Users/jdh2358/dev/bin/bdist_mpkg ## You shouldn't need to configure past this point @@ -15,11 +17,11 @@ CFLAGS="-Os -arch ppc -arch i386 -I${SRCDIR}/zlib-${ZLIBVERSION} -I${SRCDIR}/lib LDFLAGS="-arch ppc -arch i386 -L${SRCDIR}/zlib-${ZLIBVERSION} -L${SRCDIR}/libpng-${PNGVERSION} -L${SRCDIR}/freetype-${FREETYPEVERSION}" -CFLAGS_ZLIB="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" -LDFLAGS_ZLIB="-arch i386 -arch ppc -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" +CFLAGS_ZLIB="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" +LDFLAGS_ZLIB="-arch i386 -arch ppc -syslibroot,/Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" -CFLAGS_DEPS="-arch i386 -arch ppc -I${SRCDIR}/zlib-${ZLIBVERSION} -isysroot /Developer/SDKs/MacOSX10.4u.sdk" -LDFLAGS_DEPS="-arch i386 -arch ppc -L${SRCDIR}/zlib-${ZLIBVERSION} -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" +CFLAGS_DEPS="-arch i386 -arch ppc -I${SRCDIR}/zlib-${ZLIBVERSION} -isysroot /Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" +LDFLAGS_DEPS="-arch i386 -arch ppc -L${SRCDIR}/zlib-${ZLIBVERSION} -syslibroot,/Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" clean: rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \ @@ -29,12 +31,11 @@ clean: matplotlib-${MPLVERSION} *~ fetch: - wget http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz &&\ - wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2 &&\ - wget http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2&&\ - wget http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-${BDISTMPKGVERSION}.tar.gz&&\ - tar xvfz bdist_mpkg-${BDISTMPKGVERSION}.tar.gz &&\ - echo "You need to to install bdist_mpkg-${BDISTMPKGVERSION} now" + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz", "zlib-${ZLIBVERSION}.tar.gz")' &&\ + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://downloads.sourceforge.net/project/libpng/libpng-stable/${PNGVERSION}/libpng-${PNGVERSION}.tar.gz", "libpng-${PNGVERSION}.tar.gz")' &&\ + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2", "freetype-${FREETYPEVERSION}.tar.bz2")' &&\ + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-${BDISTMPKGVERSION}.tar.gz", "bdist_mpkg-${BDISTMPKGVERSION}.tar.gz")' + @@ -53,7 +54,7 @@ zlib: png: zlib unset PKG_CONFIG_PATH &&\ rm -rf libpng-${PNGVERSION} &&\ - tar xvfj libpng-${PNGVERSION}.tar.bz2 + tar xvfz libpng-${PNGVERSION}.tar.gz &&\ cd libpng-${PNGVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ export CFLAGS=${CFLAGS_DEPS} &&\ @@ -88,8 +89,8 @@ installers: cp ../data/setup.cfg ../data/ReadMe.txt . &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ - /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg --readme=ReadMe.txt &&\ - hdiutil create -srcdir dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.dmg &&\ + ${BDIST_MPKG} --readme=ReadMe.txt &&\ + hdiutil create -srcdir dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx${MACOSX_DEPLOYMENT_TARGET}.mpkg dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx${MACOSX_DEPLOYMENT_TARGET}.dmg &&\ ${PYTHON} setupegg.py bdist_egg upload: @@ -97,7 +98,7 @@ upload: mkdir upload &&\ cp matplotlib-${MPLVERSION}.tar.gz upload/ &&\ cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py${PYVERSION}-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-macosx-py${PYVERSION}.egg &&\ - cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py${PYVERSION}-mpkg.zip&&\ + cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx${MACOSX_DEPLOYMENT_TARGET}.zip upload/matplotlib-${MPLVERSION}-py${PYVERSION}-mpkg.zip&&\ scp upload/* jdh2358@frs.sourceforge.net:uploads/ all: diff --git a/release/osx/data/setup.cfg b/release/osx/data/setup.cfg index f711111a34d0..db8a69029186 100644 --- a/release/osx/data/setup.cfg +++ b/release/osx/data/setup.cfg @@ -54,7 +54,7 @@ dateutil = True #gtk = False #gtkagg = False tkagg = True -wxagg = True +wxagg = False macosx = True [rc_options] From f304ef5317efa297708cda22751bbf1fb01ba1f0 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Tue, 9 Mar 2010 15:44:16 +0000 Subject: [PATCH 282/324] remove micromicro version num svn path=/branches/v0_99_maint/; revision=8185 --- lib/matplotlib/__init__.py | 2 +- release/osx/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index acb67dbc8da3..fad85ef73cfa 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.1.3rc1' +__version__ = '0.99.3rc1' __revision__ = '$Revision$' __date__ = '$Date$' diff --git a/release/osx/Makefile b/release/osx/Makefile index 6b95793e134c..192eb542b8a1 100644 --- a/release/osx/Makefile +++ b/release/osx/Makefile @@ -4,7 +4,7 @@ SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.39 FREETYPEVERSION=2.3.7 -MPLVERSION=0.99.1.3rc1 +MPLVERSION=0.99.3rc1 BDISTMPKGVERSION=0.4.4 MPLSRC=matplotlib-${MPLVERSION} OSX_SDK_VER=10.6 From cfe5ca601c12aff4201851f673d8bfa98ddaf193 Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Sat, 13 Mar 2010 22:27:57 +0000 Subject: [PATCH 283/324] fix the bug that handles for scatter are incorrectly set when dpi!=72. Thanks to Ray Speth for the bug report. svn path=/branches/v0_99_maint/; revision=8191 --- CHANGELOG | 3 +++ lib/matplotlib/legend.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 50e6f2cbc943..f1bd926341f0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2010-03-13 fix the bug that handles for scatter are incorrectly set when + dpi!=72. Thanks to Ray Speth for the bug report. -JJL + =============================================== 2009-09-21 Tagged for release 0.99.1 diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index dd56198775e6..981fd85908aa 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -580,6 +580,13 @@ def _init_legend_box(self, handles, labels): handle = handle_list[-1] handlebox.add_artist(handle) + + # special case for collection instances + if isinstance(handle, RegularPolyCollection) or \ + isinstance(handle, CircleCollection): + handle._transOffset = handlebox.get_transform() + handle.set_transform(None) + if hasattr(handle, "_legmarker"): handlebox.add_artist(handle._legmarker) handleboxes.append(handlebox) From 32493833a157696a58728c488829d6fd4dd90574 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 15 Mar 2010 20:33:40 +0000 Subject: [PATCH 284/324] fix ticker docstring bug svn path=/branches/v0_99_maint/; revision=8193 --- lib/matplotlib/ticker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index c89eda596b6d..238b545c7768 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -355,7 +355,7 @@ def set_powerlimits(self, lims): ''' Sets size thresholds for scientific notation. - e.g. ``xaxis.set_powerlimits((-3, 4))`` sets the pre-2007 default in + e.g. ``formatter.set_powerlimits((-3, 4))`` sets the pre-2007 default in which scientific notation is used for numbers less than 1e-3 or greater than 1e4. See also :meth:`set_scientific`. From b60d7d8639bde8e8e1659f3165a820722fc12025 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Tue, 16 Mar 2010 00:55:20 +0000 Subject: [PATCH 285/324] patches.py: correct docstring in set_color svn path=/branches/v0_99_maint/; revision=8195 --- lib/matplotlib/patches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 65c2e1bc7f28..f3f5f0a6aa8c 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -203,7 +203,7 @@ def set_color(self, c): """ Set both the edgecolor and the facecolor. - ACCEPTS: matplotlib color arg or sequence of rgba tuples + ACCEPTS: matplotlib color spec .. seealso:: From bb8675c7e9ffd0840a26512b3f1c7f8515f2a6ac Mon Sep 17 00:00:00 2001 From: Reinier Heeres Date: Fri, 19 Mar 2010 16:49:29 +0000 Subject: [PATCH 286/324] Add 3d surface plot example (radial coordinates) svn path=/branches/v0_99_maint/; revision=8197 --- examples/mplot3d/surface3d_radial_demo.py | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 examples/mplot3d/surface3d_radial_demo.py diff --git a/examples/mplot3d/surface3d_radial_demo.py b/examples/mplot3d/surface3d_radial_demo.py new file mode 100644 index 000000000000..ab24df7b9023 --- /dev/null +++ b/examples/mplot3d/surface3d_radial_demo.py @@ -0,0 +1,27 @@ +# By Armin Moser + +from mpl_toolkits.mplot3d import Axes3D +import matplotlib +import numpy as np +from matplotlib import cm +from matplotlib import pyplot as plt +step = 0.04 +maxval = 1.0 +fig = plt.figure() +ax = Axes3D(fig) + +# create supporting points in polar coordinates +r = np.linspace(0,1.25,50) +p = np.linspace(0,2*np.pi,50) +R,P = np.meshgrid(r,p) +# transform them to cartesian system +X,Y = R*np.cos(P),R*np.sin(P) + +Z = ((R**2 - 1)**2) +ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet) +ax.set_zlim3d(0, 1) +ax.set_xlabel(r'$\phi_\mathrm{real}$') +ax.set_ylabel(r'$\phi_\mathrm{im}$') +ax.set_zlabel(r'$V(\phi)$') +ax.set_xticks([]) +plt.show() From da95d9e21a5b6397c942dd670d33cdbc81f91cbe Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 19 May 2010 17:24:00 +0000 Subject: [PATCH 287/324] added get_children offsetTex patch; closes sf 3001208 svn path=/branches/v0_99_maint/; revision=8325 --- lib/matplotlib/axis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index be6dd6d90108..3c9eabde44e6 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -591,7 +591,7 @@ def limit_range_for_scale(self, vmin, vmax): return self._scale.limit_range_for_scale(vmin, vmax, self.get_minpos()) def get_children(self): - children = [self.label] + children = [self.label, self.offsetText] majorticks = self.get_major_ticks() minorticks = self.get_minor_ticks() From d559f6b43b42932a79f69b979ded155f5ce3fe3b Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 30 May 2010 20:30:47 +0000 Subject: [PATCH 288/324] update version num for release svn path=/branches/v0_99_maint/; revision=8345 --- lib/matplotlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index fad85ef73cfa..f2c9e2e1ea43 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.3rc1' +__version__ = '0.99.3' __revision__ = '$Revision$' __date__ = '$Date$' From 76448c80c09594f68065afb9f5fa1f1172bec328 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Fri, 4 Jun 2010 13:05:24 +0000 Subject: [PATCH 289/324] fix the web page archive link to point to sf rather than nabble svn path=/branches/v0_99_maint/; revision=8375 --- doc/_templates/indexsidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html index a183402d2797..c8c910a1c8c6 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -46,7 +46,7 @@

Need help?

Check the user guide, the faq, the api docs, -archives, +archives, and join the matplotlib mailing lists. The search tool searches all of From 1044127139e86de9fe348a9ad6f400938769c7a3 Mon Sep 17 00:00:00 2001 From: Ben Root Date: Mon, 13 Dec 2010 21:14:11 +0000 Subject: [PATCH 290/324] Fixed typo in mplot3d tutorial svn path=/branches/v1_0_maint/; revision=8835 --- doc/mpl_toolkits/mplot3d/tutorial.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/mpl_toolkits/mplot3d/tutorial.rst b/doc/mpl_toolkits/mplot3d/tutorial.rst index 97a4e034a0ac..3027b4938e74 100644 --- a/doc/mpl_toolkits/mplot3d/tutorial.rst +++ b/doc/mpl_toolkits/mplot3d/tutorial.rst @@ -14,7 +14,7 @@ add a new axes to it of type :class:`~mpl_toolkits.mplot3d.Axes3D`:: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D - fig = pyplt.figure() + fig = plt.figure() ax = fig.add_subplot(111, projection='3d') Line plots From 795724bf2c2124f9a238f6df498213b5bf445f36 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 14 Dec 2010 15:54:03 +0000 Subject: [PATCH 291/324] NonUniformImage only supports nearest and bilinear interpolation, so if the user passes something else, an exception should be raised. svn path=/branches/v1_0_maint/; revision=8837 --- lib/matplotlib/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 395de7452f86..8528289c130c 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -659,7 +659,7 @@ def __init__(self, ax, **kwargs): interp = kwargs.pop('interpolation', 'nearest') AxesImage.__init__(self, ax, **kwargs) - AxesImage.set_interpolation(self, interp) + self.set_interpolation(interp) def _check_unsampled_image(self, renderer): """ From 95b98b527185054576ac731dce7a8a750d3b93ee Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 14 Dec 2010 17:30:12 +0000 Subject: [PATCH 292/324] Fix memory leak in text layout handling. svn path=/branches/v1_0_maint/; revision=8839 --- lib/matplotlib/text.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index b35732d5b623..90a321f51b9f 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -143,6 +143,9 @@ class Text(Artist): Handle storing and drawing of text in window or data coordinates. """ zorder = 3 + + cached = maxdict(50) + def __str__(self): return "Text(%g,%g,%s)"%(self._y,self._y,repr(self._text)) @@ -168,7 +171,6 @@ def __init__(self, """ Artist.__init__(self) - self.cached = maxdict(5) self._x, self._y = x, y if color is None: color = rcParams['text.color'] From 90004014e213d3976eae1e2b216b8830cb0e9785 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 14 Dec 2010 17:37:42 +0000 Subject: [PATCH 293/324] [3137172] Fix cyclical import problem. svn path=/branches/v1_0_maint/; revision=8841 --- lib/matplotlib/tri/triplot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tri/triplot.py b/lib/matplotlib/tri/triplot.py index 9624e9023271..5702e3459c2e 100644 --- a/lib/matplotlib/tri/triplot.py +++ b/lib/matplotlib/tri/triplot.py @@ -1,4 +1,3 @@ -import matplotlib.axes from matplotlib.cbook import ls_mapper from matplotlib.patches import PathPatch from matplotlib.path import Path @@ -39,6 +38,8 @@ def triplot(ax, *args, **kwargs): .. plot:: mpl_examples/pylab_examples/triplot_demo.py """ + import matplotlib.axes + tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args, **kwargs) x = tri.x From d4583de19acfa0f14832ed0d48778bc23719047f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Dec 2010 17:57:59 +0000 Subject: [PATCH 294/324] Fix Unicode encoding error saving SVGs with Unicode characters on some platforms svn path=/branches/v1_0_maint/; revision=8842 --- lib/matplotlib/backends/backend_svg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index 0942f83f1c5f..69e556b3bc83 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -860,7 +860,7 @@ def print_svg(self, filename, *args, **kwargs): if is_string_like(filename): fh_to_close = svgwriter = codecs.open(filename, 'w', 'utf-8') elif is_writable_file_like(filename): - svgwriter = codecs.EncodedFile(filename, 'utf-8') + svgwriter = codecs.getwriter('utf-8')(filename) fh_to_close = None else: raise ValueError("filename must be a path or a file-like object") @@ -869,10 +869,10 @@ def print_svg(self, filename, *args, **kwargs): def print_svgz(self, filename, *args, **kwargs): if is_string_like(filename): gzipwriter = gzip.GzipFile(filename, 'w') - fh_to_close = svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') + fh_to_close = svgwriter = codecs.getwriter('utf-8')(gzipwriter) elif is_writable_file_like(filename): fh_to_close = gzipwriter = gzip.GzipFile(fileobj=filename, mode='w') - svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') + svgwriter = codecs.getwriter('utf-8')(gzipwriter) else: raise ValueError("filename must be a path or a file-like object") return self._print_svg(filename, svgwriter, fh_to_close) From 1c12e35f776dfcda80b53922949422c5fdbacfbe Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 21 Dec 2010 16:08:28 +0000 Subject: [PATCH 295/324] [3138764] Small speed fix (submitted by notmuchtotell) svn path=/branches/v1_0_maint/; revision=8844 --- lib/matplotlib/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 58c3321e9775..d1cef6a0d878 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -637,7 +637,7 @@ class RcParams(dict): def __setitem__(self, key, val): try: - if key in _deprecated_map.keys(): + if key in _deprecated_map: alt = _deprecated_map[key] warnings.warn(self.msg_depr % (key, alt)) key = alt @@ -652,7 +652,7 @@ def __setitem__(self, key, val): See rcParams.keys() for a list of valid parameters.' % (key,)) def __getitem__(self, key): - if key in _deprecated_map.keys(): + if key in _deprecated_map: alt = _deprecated_map[key] warnings.warn(self.msg_depr % (key, alt)) key = alt From d8ee4244807cb122e364a7d2357e234be5640c6f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 21 Dec 2010 16:28:00 +0000 Subject: [PATCH 296/324] [3053296] backend_qt4 Toolbar2QT string format fix svn path=/branches/v1_0_maint/; revision=8845 --- lib/matplotlib/backends/backend_qt4.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_qt4.py b/lib/matplotlib/backends/backend_qt4.py index 7c2d22c956f1..9c62ab1889aa 100644 --- a/lib/matplotlib/backends/backend_qt4.py +++ b/lib/matplotlib/backends/backend_qt4.py @@ -182,7 +182,7 @@ def wheelEvent( self, event ): y = self.figure.bbox.height - event.y() # from QWheelEvent::delta doc steps = event.delta()/120 - if (event.orientation() == Qt.Qt.Vertical): + if (event.orientation() == QtCore.Qt.Vertical): FigureCanvasBase.scroll_event( self, x, y, steps) if DEBUG: print 'scroll event : delta = %i, steps = %i ' % (event.delta(),steps) @@ -450,7 +450,7 @@ def edit_parameters(self): text += ": "+ylabel text += " (%s)" elif ylabel: - text = "%s (%s)" % ylabel + text = "%%s (%s)" % ylabel else: text = "%s" titles.append(text % repr(axes)) From f6827299262a01f36bdd10f9ed411350648cd85e Mon Sep 17 00:00:00 2001 From: Jae-Joon Lee Date: Wed, 29 Dec 2010 02:43:08 +0000 Subject: [PATCH 297/324] revocer the negative coordinates support of annotation svn path=/branches/v1_0_maint/; revision=8846 --- lib/matplotlib/text.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 90a321f51b9f..dbcb70a8a84e 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1443,6 +1443,9 @@ def _get_xy(self, renderer, x, y, s): y = float(self.convert_yunits(y)) + if s in ['axes points', 'axes pixel', 'figure points', 'figure pixel']: + return self._get_xy_legacy(renderer, x, y, s) + tr = self._get_xy_transform(renderer, s) x1, y1 = tr.transform_point((x, y)) return x1, y1 From 4c43a089f1042ccdb6c911fde12955b8276b0a7a Mon Sep 17 00:00:00 2001 From: John Hunter Date: Sun, 2 Jan 2011 17:53:33 +0000 Subject: [PATCH 298/324] bumped version number to 1.0.1rc svn path=/branches/v1_0_maint/; revision=8870 --- lib/matplotlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index d1cef6a0d878..72933e427ba2 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -99,7 +99,7 @@ """ from __future__ import generators -__version__ = '1.0.0' +__version__ = '1.0.1rc1' __revision__ = '$Revision$' __date__ = '$Date$' From cc62a7db445fccd54c2e861b1eec68790c862b71 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Mon, 3 Jan 2011 20:34:57 +0000 Subject: [PATCH 299/324] update pytz to 2010o svn path=/branches/v1_0_maint/; revision=8876 --- examples/animation/animation_blit_gtk.py | 29 ++++++++------- examples/animation/animation_blit_gtk2.py | 16 ++++----- lib/pytz/__init__.py | 33 +++++++++++++++--- lib/pytz/tests/test_tzinfo.py | 26 +++++++++++++- lib/pytz/zoneinfo/Africa/Bamako | Bin 208 -> 224 bytes lib/pytz/zoneinfo/Africa/Cairo | Bin 9343 -> 9371 bytes lib/pytz/zoneinfo/Africa/Casablanca | Bin 514 -> 558 bytes lib/pytz/zoneinfo/Africa/Conakry | Bin 208 -> 224 bytes lib/pytz/zoneinfo/Africa/Dar_es_Salaam | Bin 213 -> 229 bytes lib/pytz/zoneinfo/Africa/Kampala | Bin 253 -> 269 bytes lib/pytz/zoneinfo/Africa/Mogadishu | Bin 194 -> 210 bytes lib/pytz/zoneinfo/Africa/Nairobi | Bin 253 -> 269 bytes lib/pytz/zoneinfo/Africa/Nouakchott | Bin 208 -> 224 bytes lib/pytz/zoneinfo/Africa/Timbuktu | Bin 208 -> 224 bytes lib/pytz/zoneinfo/America/Argentina/Catamarca | Bin 1087 -> 1103 bytes .../zoneinfo/America/Argentina/ComodRivadavia | Bin 1087 -> 1103 bytes lib/pytz/zoneinfo/America/Argentina/Cordoba | Bin 1087 -> 1103 bytes lib/pytz/zoneinfo/America/Argentina/Jujuy | Bin 1087 -> 1119 bytes lib/pytz/zoneinfo/America/Argentina/La_Rioja | Bin 1101 -> 1117 bytes lib/pytz/zoneinfo/America/Argentina/Mendoza | Bin 1115 -> 1147 bytes .../zoneinfo/America/Argentina/Rio_Gallegos | Bin 1087 -> 1103 bytes lib/pytz/zoneinfo/America/Argentina/Salta | Bin 1059 -> 1075 bytes lib/pytz/zoneinfo/America/Argentina/San_Juan | Bin 1101 -> 1117 bytes lib/pytz/zoneinfo/America/Argentina/San_Luis | Bin 1938 -> 1125 bytes lib/pytz/zoneinfo/America/Argentina/Tucuman | Bin 1115 -> 1131 bytes lib/pytz/zoneinfo/America/Argentina/Ushuaia | Bin 1087 -> 1103 bytes lib/pytz/zoneinfo/America/Asuncion | Bin 2020 -> 2036 bytes lib/pytz/zoneinfo/America/Cambridge_Bay | Bin 2052 -> 2084 bytes lib/pytz/zoneinfo/America/Cancun | Bin 1450 -> 1466 bytes lib/pytz/zoneinfo/America/Caracas | Bin 224 -> 240 bytes lib/pytz/zoneinfo/America/Catamarca | Bin 1087 -> 1103 bytes lib/pytz/zoneinfo/America/Chicago | Bin 3543 -> 3559 bytes lib/pytz/zoneinfo/America/Chihuahua | Bin 1492 -> 1508 bytes lib/pytz/zoneinfo/America/Cordoba | Bin 1087 -> 1103 bytes lib/pytz/zoneinfo/America/Goose_Bay | Bin 3187 -> 3203 bytes lib/pytz/zoneinfo/America/Hermosillo | Bin 424 -> 440 bytes lib/pytz/zoneinfo/America/Indiana/Knox | Bin 2395 -> 2411 bytes lib/pytz/zoneinfo/America/Indiana/Tell_City | Bin 1677 -> 1709 bytes lib/pytz/zoneinfo/America/Iqaluit | Bin 2000 -> 2032 bytes lib/pytz/zoneinfo/America/Jujuy | Bin 1087 -> 1119 bytes lib/pytz/zoneinfo/America/Knox_IN | Bin 2395 -> 2411 bytes lib/pytz/zoneinfo/America/Managua | Bin 421 -> 437 bytes lib/pytz/zoneinfo/America/Mazatlan | Bin 1534 -> 1550 bytes lib/pytz/zoneinfo/America/Mendoza | Bin 1115 -> 1147 bytes lib/pytz/zoneinfo/America/Menominee | Bin 2241 -> 2257 bytes lib/pytz/zoneinfo/America/Merida | Bin 1426 -> 1442 bytes lib/pytz/zoneinfo/America/Montevideo | Bin 2118 -> 2134 bytes lib/pytz/zoneinfo/America/Ojinaga | Bin 1492 -> 1508 bytes lib/pytz/zoneinfo/America/Pangnirtung | Bin 2062 -> 2094 bytes lib/pytz/zoneinfo/America/Rankin_Inlet | Bin 1900 -> 1916 bytes lib/pytz/zoneinfo/America/Rosario | Bin 1087 -> 1103 bytes lib/pytz/zoneinfo/America/St_Johns | Bin 3632 -> 3648 bytes lib/pytz/zoneinfo/Antarctica/Casey | Bin 211 -> 227 bytes lib/pytz/zoneinfo/Asia/Aqtau | Bin 1112 -> 1128 bytes lib/pytz/zoneinfo/Asia/Colombo | Bin 347 -> 363 bytes lib/pytz/zoneinfo/Asia/Dili | Bin 277 -> 293 bytes lib/pytz/zoneinfo/Asia/Gaza | Bin 2285 -> 2285 bytes lib/pytz/zoneinfo/Asia/Harbin | Bin 447 -> 463 bytes lib/pytz/zoneinfo/Asia/Ho_Chi_Minh | Bin 239 -> 255 bytes lib/pytz/zoneinfo/Asia/Hong_Kong | Bin 1187 -> 1175 bytes lib/pytz/zoneinfo/Asia/Irkutsk | Bin 1935 -> 1967 bytes lib/pytz/zoneinfo/Asia/Jayapura | Bin 209 -> 225 bytes lib/pytz/zoneinfo/Asia/Jerusalem | Bin 2197 -> 2213 bytes lib/pytz/zoneinfo/Asia/Krasnoyarsk | Bin 1914 -> 1946 bytes lib/pytz/zoneinfo/Asia/Magadan | Bin 1915 -> 1947 bytes lib/pytz/zoneinfo/Asia/Makassar | Bin 247 -> 263 bytes lib/pytz/zoneinfo/Asia/Manila | Bin 319 -> 335 bytes lib/pytz/zoneinfo/Asia/Omsk | Bin 1914 -> 1946 bytes lib/pytz/zoneinfo/Asia/Phnom_Penh | Bin 239 -> 255 bytes lib/pytz/zoneinfo/Asia/Pyongyang | Bin 242 -> 258 bytes lib/pytz/zoneinfo/Asia/Riyadh87 | Bin 8669 -> 8685 bytes lib/pytz/zoneinfo/Asia/Riyadh88 | Bin 8523 -> 8539 bytes lib/pytz/zoneinfo/Asia/Riyadh89 | Bin 8523 -> 8539 bytes lib/pytz/zoneinfo/Asia/Saigon | Bin 239 -> 255 bytes lib/pytz/zoneinfo/Asia/Seoul | Bin 380 -> 396 bytes lib/pytz/zoneinfo/Asia/Taipei | Bin 724 -> 724 bytes lib/pytz/zoneinfo/Asia/Tbilisi | Bin 1100 -> 1116 bytes lib/pytz/zoneinfo/Asia/Tehran | Bin 1622 -> 1638 bytes lib/pytz/zoneinfo/Asia/Tel_Aviv | Bin 2197 -> 2213 bytes lib/pytz/zoneinfo/Asia/Ujung_Pandang | Bin 247 -> 263 bytes lib/pytz/zoneinfo/Asia/Vientiane | Bin 239 -> 255 bytes lib/pytz/zoneinfo/Asia/Vladivostok | Bin 1929 -> 1961 bytes lib/pytz/zoneinfo/Asia/Yakutsk | Bin 1914 -> 1946 bytes lib/pytz/zoneinfo/Atlantic/Stanley | Bin 1961 -> 1993 bytes lib/pytz/zoneinfo/Canada/Newfoundland | Bin 3632 -> 3648 bytes lib/pytz/zoneinfo/Egypt | Bin 9343 -> 9371 bytes lib/pytz/zoneinfo/Europe/Helsinki | Bin 1883 -> 1883 bytes lib/pytz/zoneinfo/Europe/Mariehamn | Bin 1883 -> 1883 bytes lib/pytz/zoneinfo/Europe/Moscow | Bin 2194 -> 2226 bytes lib/pytz/zoneinfo/Hongkong | Bin 1187 -> 1175 bytes lib/pytz/zoneinfo/Iran | Bin 1622 -> 1638 bytes lib/pytz/zoneinfo/Israel | Bin 2197 -> 2213 bytes lib/pytz/zoneinfo/Mexico/BajaSur | Bin 1534 -> 1550 bytes lib/pytz/zoneinfo/Mideast/Riyadh87 | Bin 8669 -> 8685 bytes lib/pytz/zoneinfo/Mideast/Riyadh88 | Bin 8523 -> 8539 bytes lib/pytz/zoneinfo/Mideast/Riyadh89 | Bin 8523 -> 8539 bytes lib/pytz/zoneinfo/Pacific/Apia | Bin 268 -> 268 bytes lib/pytz/zoneinfo/Pacific/Fiji | Bin 296 -> 296 bytes lib/pytz/zoneinfo/Pacific/Kosrae | Bin 188 -> 204 bytes lib/pytz/zoneinfo/Pacific/Truk | Bin 144 -> 144 bytes lib/pytz/zoneinfo/Pacific/Yap | Bin 144 -> 144 bytes lib/pytz/zoneinfo/ROC | Bin 724 -> 724 bytes lib/pytz/zoneinfo/ROK | Bin 380 -> 396 bytes lib/pytz/zoneinfo/US/Central | Bin 3543 -> 3559 bytes lib/pytz/zoneinfo/US/Indiana-Starke | Bin 2395 -> 2411 bytes lib/pytz/zoneinfo/W-SU | Bin 2194 -> 2226 bytes lib/pytz/zoneinfo/localtime | Bin 255 -> 118 bytes lib/pytz/zoneinfo/zone.tab | 9 ++--- src/_gtkagg.cpp | 1 + 109 files changed, 85 insertions(+), 29 deletions(-) diff --git a/examples/animation/animation_blit_gtk.py b/examples/animation/animation_blit_gtk.py index ea9bca3aa916..30b193ca182a 100644 --- a/examples/animation/animation_blit_gtk.py +++ b/examples/animation/animation_blit_gtk.py @@ -29,15 +29,28 @@ # for profiling tstart = time.time() +def on_draw(event): + background = canvas.copy_from_bbox(ax.bbox) + if on_draw.background is None: + gobject.idle_add(update_line) + + on_draw.background = background + +on_draw.background = None + +fig.canvas.mpl_connect('draw_event', on_draw) + def update_line(*args): - print 'you are here', update_line.cnt - if update_line.background is None: - update_line.background = canvas.copy_from_bbox(ax.bbox) + if on_draw.background is None: + return True + + print 'frame', update_line.cnt # restore the clean slate background - canvas.restore_region(update_line.background) + canvas.restore_region(on_draw.background) # update the data line.set_ydata(np.sin(x+update_line.cnt/10.0)) + # just draw the animated artist ax.draw_artist(line) @@ -54,14 +67,6 @@ def update_line(*args): return True update_line.cnt = 0 -update_line.background = None - - -def start_anim(event): - gobject.idle_add(update_line) - canvas.mpl_disconnect(start_anim.cid) - -start_anim.cid = canvas.mpl_connect('draw_event', start_anim) diff --git a/examples/animation/animation_blit_gtk2.py b/examples/animation/animation_blit_gtk2.py index 24d389a3821f..8d6393c2f2b2 100644 --- a/examples/animation/animation_blit_gtk2.py +++ b/examples/animation/animation_blit_gtk2.py @@ -20,9 +20,9 @@ class UpdateLine(object): def get_bg_bbox(self): - + return self.ax.bbox.padded(-3) - + def __init__(self, canvas, ax): self.cnt = 0 self.canvas = canvas @@ -31,7 +31,7 @@ def __init__(self, canvas, ax): self.prev_time = time.time() self.start_time = self.prev_time self.prev_pixel_offset = 0. - + self.x0 = 0 self.phases = np.random.random_sample((20,)) * np.pi * 2 @@ -70,7 +70,7 @@ def restore_background_shifted(self, dx_pixel): # restore the clean slate background self.canvas.restore_region(self.background1) - # restore subregion (x1+dx, y1, x2, y2) of the second bg + # restore subregion (x1+dx, y1, x2, y2) of the second bg # in a offset position (x1-dx, y1) x1, y1, x2, y2 = self.background2.get_extents() self.canvas.restore_region(self.background2, @@ -82,18 +82,18 @@ def restore_background_shifted(self, dx_pixel): def on_draw(self, *args): self.save_bg() return False - + def update_line(self, *args): if self.background1 is None: return True - + cur_time = time.time() pixel_offset = int((cur_time - self.start_time)*100.) dx_pixel = pixel_offset - self.prev_pixel_offset self.prev_pixel_offset = pixel_offset dx_data = self.get_dx_data(dx_pixel) #cur_time - self.prev_time) - + x0 = self.x0 self.x0 += dx_data self.prev_time = cur_time @@ -109,7 +109,7 @@ def update_line(self, *args): self.line.set_color(self.color_cycle.next()) - # now plot line segment within [x0, x0+dx_data], + # now plot line segment within [x0, x0+dx_data], # Note that we're only plotting a line between [x0, x0+dx_data]. xx = np.array([x0, self.x0]) self.line.set_xdata(xx) diff --git a/lib/pytz/__init__.py b/lib/pytz/__init__.py index 8b8f5e873d62..2c1f776f6874 100644 --- a/lib/pytz/__init__.py +++ b/lib/pytz/__init__.py @@ -9,7 +9,7 @@ ''' # The Olson database is updated several times a year. -OLSON_VERSION = '2010h' +OLSON_VERSION = '2010o' VERSION = OLSON_VERSION # Version format for a patch release - only one so far. #VERSION = OLSON_VERSION + '.2' @@ -358,7 +358,7 @@ def __reduce__(self): return FixedOffset, (self._minutes, ) def dst(self, dt): - return None + return ZERO def tzname(self, dt): return None @@ -387,12 +387,16 @@ def FixedOffset(offset, _tzinfos = {}): pytz.FixedOffset(-330) >>> one.utcoffset(datetime.datetime.now()) datetime.timedelta(-1, 66600) + >>> one.dst(datetime.datetime.now()) + datetime.timedelta(0) >>> two = FixedOffset(1380) >>> two pytz.FixedOffset(1380) >>> two.utcoffset(datetime.datetime.now()) datetime.timedelta(0, 82800) + >>> two.dst(datetime.datetime.now()) + datetime.timedelta(0) The datetime.timedelta must be between the range of -1 and 1 day, non-inclusive. @@ -530,6 +534,7 @@ def _test(): 'America/Atikokan', 'America/Atka', 'America/Bahia', + 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', @@ -956,6 +961,7 @@ def _test(): 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Chatham', + 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', @@ -981,6 +987,7 @@ def _test(): 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', + 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', @@ -1095,6 +1102,7 @@ def _test(): 'America/Asuncion', 'America/Atikokan', 'America/Bahia', + 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', @@ -1155,6 +1163,7 @@ def _test(): 'America/Maceio', 'America/Managua', 'America/Manaus', + 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', @@ -1195,6 +1204,8 @@ def _test(): 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', + 'America/Shiprock', + 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', @@ -1220,8 +1231,10 @@ def _test(): 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', + 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Vostok', + 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', @@ -1331,6 +1344,7 @@ def _test(): 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', + 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', @@ -1338,35 +1352,46 @@ def _test(): 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', + 'Europe/Guernsey', 'Europe/Helsinki', + 'Europe/Isle_of_Man', 'Europe/Istanbul', + 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', + 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', + 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Oslo', 'Europe/Paris', + 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', + 'Europe/San_Marino', + 'Europe/Sarajevo', 'Europe/Simferopol', + 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Uzhgorod', 'Europe/Vaduz', + 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', + 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'GMT', @@ -1384,6 +1409,7 @@ def _test(): 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Chatham', + 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', @@ -1409,14 +1435,13 @@ def _test(): 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', - 'Pacific/Ponape', + 'Pacific/Pohnpei', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', - 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'US/Alaska', diff --git a/lib/pytz/tests/test_tzinfo.py b/lib/pytz/tests/test_tzinfo.py index 09b0da7288db..f930c4fe4bd4 100644 --- a/lib/pytz/tests/test_tzinfo.py +++ b/lib/pytz/tests/test_tzinfo.py @@ -16,7 +16,7 @@ # I test for expected version to ensure the correct version of pytz is # actually being tested. -EXPECTED_VERSION='2010h' +EXPECTED_VERSION='2010o' fmt = '%Y-%m-%d %H:%M:%S %Z%z' @@ -44,6 +44,7 @@ def prettydt(dt): dt.hour, dt.minute, dt.second, dt.tzname(), offset) + class BasicTest(unittest.TestCase): def testVersion(self): @@ -643,6 +644,28 @@ def no_testCreateLocaltime(self): '2004-10-31 02:00:00 CET+0100' ) + +class CommonTimezonesTestCase(unittest.TestCase): + def test_bratislava(self): + # Bratislava is the default timezone for Slovakia, but our + # heuristics where not adding it to common_timezones. Ideally, + # common_timezones should be populated from zone.tab at runtime, + # but I'm hesitant to pay the startup cost as loading the list + # on demand whilst remaining backwards compatible seems + # difficult. + self.failUnless('Europe/Bratislava' in pytz.common_timezones) + self.failUnless('Europe/Bratislava' in pytz.common_timezones_set) + + def test_us_eastern(self): + self.failUnless('US/Eastern' in pytz.common_timezones) + self.failUnless('US/Eastern' in pytz.common_timezones_set) + + def test_belfast(self): + # Belfast uses London time. + self.failUnless('Europe/Belfast' in pytz.all_timezones_set) + self.failIf('Europe/Belfast' in pytz.common_timezones) + self.failIf('Europe/Belfast' in pytz.common_timezones_set) + def test_suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite('pytz')) @@ -651,6 +674,7 @@ def test_suite(): suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_tzinfo)) return suite + if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/lib/pytz/zoneinfo/Africa/Bamako b/lib/pytz/zoneinfo/Africa/Bamako index a9259a604ac74f568156e61bc02418e0ec102e2d..da18d7137740abeff3e856eefd86ff70d104ee09 100644 GIT binary patch literal 224 zcmWHE%1kq2zyK^j5fBCeW*`Q!c_uxZ#;|A7j)r%F?E;KUjQ{`tXaEX>0L%aXA3rc~ pK-fOMAq?(79PStb761_;Bv|tw2tZbWXpnUvnhYzsfNn700szD1F5O==nS&{qk%^IEvLmzkqCu$_fc;7kD;1m0_fQb(KYn1~ pfUtdhLm1qFINUJ=EC3=xNU-KV5P+-#(ID$UG#OTM0o`E01pxUHF}DB! literal 208 zcmWHE%1kq2zyQoZ5fBCe7@KF(v)M6wChcf=Yalj(k%{sD|IaEA6$~u@|9||zz~SQ? i!r%_X;f^6ti4YQu{|^KpD?l{J8W2r_Ra`)u4Y&aP^D(Ia diff --git a/lib/pytz/zoneinfo/Africa/Dar_es_Salaam b/lib/pytz/zoneinfo/Africa/Dar_es_Salaam index 05643e9abce4e57df8c2811f92a4f3d279196344..3b81079f23bdc794780e3eea8d5a9c13f88c0819 100644 GIT binary patch literal 229 zcmWHE%1kq2zyK^j5fBCeW*`Q!`L->-yyn{6`U~%c(jGH1F)}cyTmi{z8GxkK<}z?V s*gn1?46cqL3{I|&p&=jzU=TurMgM^SWEqGCSqP%ZvXl$x4qam|0Ag({82|tP literal 213 zcmWHE%1kq2zyQoZ5fBCe7@Kd~;>&BU&8@%iUMTG`BNHP7gUS_4NTm}vw q-w*~@#}Ec5SI5v0kQ5MvkYK@oAOKkcqCpmcXp$`B0@|)?%mn~?Br8_{ diff --git a/lib/pytz/zoneinfo/Africa/Kampala b/lib/pytz/zoneinfo/Africa/Kampala index 1afbe233fd24058ec59819c329d314ad5302e1ac..eab63498a625c92ae80fc74bab13d43627704f0b 100644 GIT binary patch delta 81 zcmey%*vm9QT#%K4fdPa;fCY$ICu$h5F)(NuFtAL#Ej_VN5{ru24hR*T3=CYZjv>0n FTmZU#3mO0b delta 64 rcmeBW`pY;$T#$ujoo`qh$aj7?d>_SRiay#}Ec55CH)p z*o_4$25A5TkdYuZ?|&dD*pu=DM1!mV(O_$sfEH0n FTmZU#3mO0b delta 64 rcmeBW`pY;$T#$uXBMkdDp|3C6TR4}jr*&i40L%aXA3rc~ pK-fOMAq?(79PStb761_;Bv|tw2tZbWXpnUvnhYzsfNn700szD1FxF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESFxF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESFxF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESF36 hLBJY_xi%kTbZ3I71(HCu9Fuujbihiu9D_oPxd6)Z88!d_ delta 70 zcmcc5v7cjtxF9IDXt$&HM1ObiS_RUAMW5C#D|Am-S7 boH2%p3#^R8$2Wulq?8LJ%jFmpV$1~qT7eSI delta 70 zcmcc1ah79(xF8z?0|N+yfGrTSZPbWloZQYRH+eauxF9=F1cX7r4v5(|pJ$9=nrz6T M!p7wo6k^N;0EABp36 hLBJM>xi(*5jAVkS1(HCu9FsL!bihiu9D_oPxd8FS8QK5< delta 75 zcmey(ahqd;xF9NO3Nhva0M$eclK=n! diff --git a/lib/pytz/zoneinfo/America/Argentina/Rio_Gallegos b/lib/pytz/zoneinfo/America/Argentina/Rio_Gallegos index 5fb3092e47ee1d46edc780cefb4d906141f47e64..65d0230a2d06ca8b94cfeb60aee0ba3b1a3faf0d 100644 GIT binary patch delta 92 zcmdnbah_v>xF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESF%P}a#mcpa1{> diff --git a/lib/pytz/zoneinfo/America/Argentina/San_Juan b/lib/pytz/zoneinfo/America/Argentina/San_Juan index a2373bbedfe7302c9a531287e5cadef44abfcec5..fe7007b85ca4a22659c2c3093d078893fa2f466d 100644 GIT binary patch delta 93 zcmX@hahGF)xF9IDXt$&HM1ObiS_RUAMW5C#D|Am-S7 boH2%p3#^R8$2Wulq?8LJ%jFmpV$1~qT7eSI delta 70 zcmcc1ah79(xF8z?0|N+yfGrTSZPbWloZQYRH+eauxF9=F1cX7r4v5(|pJ$9=nrz6T M!p7wo6k^N;0EABpboyUF70v5Z^*=4T7$ delta 856 zcmb8t%S#nu9Eb77W5+H;M7rogga#6L`PCS7A$W_TMNQ>7lbYEvPad@FVqT7BM+d4+ zuC#$RNst6ZM7+@|l6r|~lY-GA+}OribZF(GB8lE-{0p3c`Mk{X`@G*)++90T=Jbwk zTL_Mh)ylCKdzF`S<@o4kb)u<6P7drgwflZaqH&{1ZkiE)&w}y)zLvTTv!-tDi?07; zOvC$E`t;1WX?%2FpLzFIHQgT6XU89^RBN+tzIjWX^K#OX&Zu-{O3oiVqFUD|$&_wa znV+T7w)(JXn<|v{e0htx@a(%>{J7F|+$+$Rp61Qv-Z_0`c*X#*_WT3-%ha1J`9D7g$#y_h75;{hYW~}hzyC08EFSaMvb(?BI6{%Cy`}y@!mqKPq+j9fkgAz>% diff --git a/lib/pytz/zoneinfo/America/Argentina/Tucuman b/lib/pytz/zoneinfo/America/Argentina/Tucuman index eb68d6d1d04d6205e677e1c917dbb834bc9e0952..be7bd271639a551eff3b1bedb3b0646beab4e9b7 100644 GIT binary patch delta 78 zcmcc3@tR|T_~hM;JgjyM3=HfWHR2fA{{O#vfq`Xm8>8IhMU0Yy96$*W1_65@=Gc6O WF_j6Ties`NiwaPZ%P}a#mxF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESFMP7z7%Dm~As7 T^J*4|Dvrr(*rg{QWtRs4E&>%H delta 76 zcmeyu|Ac>nxF8Dy0|N+yKm!o7Y}A;;#N+52!VnM%!oeYvZ!jqcvI3<*7z7%Dm~}HJ Q^JSRyb%T#%cAfdPa;pc;s|H)~aA9))?#n delta 75 zcmZ1?&>}EFT#%E2fdPa;pc;rdH)s3PasZR# B3f}+# diff --git a/lib/pytz/zoneinfo/America/Cancun b/lib/pytz/zoneinfo/America/Cancun index 3d56e51a457da8f02ae32e435adc8ca6b4cc8446..90993faa70518700e2df6eace3e27334ce1b6bc3 100644 GIT binary patch delta 81 zcmZ3*y^DK-xF8z?0|N+yKsXSyZPd8R$oBvL>IDoelm9ZxO_pSm#8kA|naPkDS=9tq FDFB$C5&i%G delta 99 zcmdnRy^4E+xF9P70|N+yKsXSyZq&HSDD2}K!r&Yn!r>n`~UyI4h9xy-w=i{*ATE2hybc)1yUdk0w7(i Z6Pq1aK&mGm6ys)K-~uW)u`)K`0sspk5xW2Y delta 72 zcmeys_<(VOxF9nF0|N+y0GK^dLzUgxH-sU~HDqFpoFEHO9E3pt%%0foF!7=YCl^rO J#LC!!3jl<^3n~Br diff --git a/lib/pytz/zoneinfo/America/Catamarca b/lib/pytz/zoneinfo/America/Catamarca index 3f8232be8776fcb04bd0190508e6dc5a4c0ed5b2..b9c987bb56894c23ca7a74d02d792585e3f4fe00 100644 GIT binary patch delta 92 zcmdnbah_v>xF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESF46WoBSx04ie#N`Wv4ya8hN f&FZWr99&>^96r7w3_!IKTtKy8z{oIpKd%G;7@ZWG delta 61 zcmaDZeO-EjxF9P70|N+yz-u68-KepXW%62HiOK(2SQ!~7D6_r+in49iXD#8FypmU$ Kk#X{QUI_rBRt`Y` diff --git a/lib/pytz/zoneinfo/America/Chihuahua b/lib/pytz/zoneinfo/America/Chihuahua index 8758bab11149e8e079224ee7cbfa4ecd03dbfe7c..b2687241cd05b6904a7d95bae697642becbe5b1a 100644 GIT binary patch delta 81 zcmcb@{e*jhxF8z?0|N+yKok(OZPa+e$oBvL+zAXUljpI@P1azN#8k97h{=Z;S=BC9 FDFCBF5!e6# delta 67 wcmaFDeT931xF9P70|N+yKok(OZq#_fIC%}L++-srEV7%Un0%PQ(q~vD0DU$KqyPW_ diff --git a/lib/pytz/zoneinfo/America/Cordoba b/lib/pytz/zoneinfo/America/Cordoba index 2a3eca9d911a484a7e2bebe9788cdc096d9c336c..a703e957d5ebe02e0651d77ddfff4d3f7b8b851b 100644 GIT binary patch delta 92 zcmdnbah_v>xF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESFqDf@3437ab10%y^Umi68!08iX delta 70 zcmZpc{46m+T#%E2fdPa;;4~0(ZqzVjnHj21s#j-ocW?&f?=6!T^+0 Pob1oT&B!=8mPZW$v&{_; diff --git a/lib/pytz/zoneinfo/America/Hermosillo b/lib/pytz/zoneinfo/America/Hermosillo index 08ce31c7cccaa3dc0842a3628dc0820268215032..26c269d9674847059472850a5287339df9213bff 100644 GIT binary patch delta 124 zcmZ3%yn}gyxF8z?0|N+y06!43P1MMh{{MgO1O^r#-w+1h;1C99APxXxUzZRDhKVbb Vu;{tHQU{M7u;CDb3uvG@7XTQ47&-s| delta 64 ucmdnNyn=axxF9P70|N+y06!43PSnVqI9qPwZfsJIR|2KjxO{^{%((zTX$tEA diff --git a/lib/pytz/zoneinfo/America/Indiana/Knox b/lib/pytz/zoneinfo/America/Indiana/Knox index 6e66a418902dba837dc0dca0f9c4a3ffa06e526d..33169f4596381b700b3598dabf7706dce25f65ba 100644 GIT binary patch delta 124 zcmcaD^jc_w_~aU99@d!*3=C`=HRPGq{{LUSfPux?C4|8_7>L7xI3R?<703nxMi2oa zCx{EO16d#p0<(aaeRD7KBvv-CevZlVoJukvgW%z&op_!{dO=^5zw8XD>u>KSkW E0N;BV?EnA( delta 84 zcmaDYbX#bGxF9P70|N+yz)T=!-KZhYJlT*_oShLQ#KUCTQ`T#$o-fdPa;AO(myHfqQ)@%;b4a|0v8|NpBOFtAMaXOo^B&&0;gz`zJn z1=Pd|q(B%1Qh}Ir^8}{d%n)5HU|k%Oz1h^|p*pyngG0=mT|#txjrEN540L=A4fPE5 G47dP2Z5)OG delta 106 zcmZ3>+sivaT#$`{fdPa;AO(ooHfqQ)O%7mEWM*Vw0Lrri#XuMYQh}I#^8%*b%q%{> oAq+rO(#i}#Wgq~gxSWGS%$!|9bbO8VjPwk2d<_lt4D}4S0Ow2&@Bjb+ diff --git a/lib/pytz/zoneinfo/America/Iqaluit b/lib/pytz/zoneinfo/America/Iqaluit index a8640e54f67558d5888ae6c3df635dcb20111bfa..cea5c2e0f30fb1b562d2982d874c4141ddff4f8d 100644 GIT binary patch delta 135 zcmcb>|ABvkxF8n;0|N+yKqU}!ZPb{^#Pk3E@dJ#4|NrmYz`!wiCzBR80|O&i36Q|1 nX|oV>DGP=!Wh7l(uE8Out}Y=uzQ%e+dImbahK72EdInqo53wDB delta 101 zcmeyse}R93xF81u0|N+yKqU}!Y}A;@H2El#7CR$Yi~*aP%}UIrEFeYlP(@s>!6Bxu WE+IO;#(GA220FfmhI)p223!CGun%$o diff --git a/lib/pytz/zoneinfo/America/Jujuy b/lib/pytz/zoneinfo/America/Jujuy index 832ba901b3b897353c172ea7f98638c24f9d4454..86800f0344a08623a9b526db0953de0da2c5db90 100644 GIT binary patch delta 100 zcmdnbai3#?xF9D30|N+yfE5sPZqx{136 hLBJY_xi%kTbZ3I71(HCu9Fuujbihiu9D_oPxd6)Z88!d_ delta 70 zcmcc5v7cjtxF9L7xI3R?<703nxMi2oa zCx{EO16d#p0<(aaeRD7KBvv-CevZlVoJukvgW%z&op_!{dO=^5zw8XD>u>KSkW E0N;BV?EnA( delta 84 zcmaDYbX#bGxF9P70|N+yz)T=!-KZhYJlT*_oShLQ#Kr1@bwL0a1IV(a0Oy#mk_Wdh?t36 hLBJM>xi(*5jAVkS1(HCu9FsL!bihiu9D_oPxd8FS8QK5< delta 75 zcmey(ahqd;xF9NO3Nhva0M$eclK=n! diff --git a/lib/pytz/zoneinfo/America/Menominee b/lib/pytz/zoneinfo/America/Menominee index c07a950c7489bd66e065af7a9a90a64f01e7eb60..438f5ff0b846447eab7ef45c8ef19d49db69f12f 100644 GIT binary patch delta 117 zcmX>ocu{bIxF8z?0|N+yKpzmZZPa+d#PIDoelLeS%SQr=?7=Y^7fpQ=W0{uYD zzB!CppOp)&ki*9}gaN2neDVSgb{UWcF6ZD7GiR3&9baQTBRvBhUqeGZLp=j706M!C A`v3p{ delta 103 zcmca8cu;VHxF9P70|N+yKpzmZZq#_eBsPO;)>IDoeKE5Fg&cPuJu0ZVU5&~8OA+TxO QY|f<3ERI9xma7|!>_+(jT9@b_C1_q9e8he@8{{MgcfRS(VQzpg9EX27wkJ=G?5u Se1ip|N@y}0hx%k~4ru`D!4qNt delta 53 zcmca6a7XU6bBmo>W B3mE_a diff --git a/lib/pytz/zoneinfo/America/Ojinaga b/lib/pytz/zoneinfo/America/Ojinaga index c77d083c4c3a160a44996eeadc6acdde9f8f946b..37d78301bd100b7c34b183a7e355021f55cb366e 100644 GIT binary patch delta 81 zcmcb@{e*jhxF8z?0|N+yKok(OZPa+e$oBvL+zAXUljpI@P1azN#8k97h{=Z;S=BC9 FDFCBF5!e6# delta 67 wcmaFDeT931xF9P70|N+yKok(OZq#_fIC%}L++-srEV7%Un0%PQ(q~vD0DU$KqyPW_ diff --git a/lib/pytz/zoneinfo/America/Pangnirtung b/lib/pytz/zoneinfo/America/Pangnirtung index bb428471d71a8a69a616de9bbd032bcd6f356905..80a6009381ef1cc8f8cbd2551f0665733e6ffb6d 100644 GIT binary patch delta 104 zcmeAZSSK(+T#$!>fdPa;pbCh2Hfk(l;`#so_yI=A|NnPxV33`Bipi9ffq{{MVG^?( SruxnL%v~%vG)#WaE)M|zQyM=2 delta 71 zcmZ1{&?hiKT#$=_fdPa;pbCh&Hfk(lntYAPl#y|=0J9vX{APRRE*7W)ehzs6i0ca{ diff --git a/lib/pytz/zoneinfo/America/Rankin_Inlet b/lib/pytz/zoneinfo/America/Rankin_Inlet index cbc34996980251e1a3c14c8bcbe20184fee616a5..99195714c4b30750dedc3be8f70d79fd6ffbf4a6 100644 GIT binary patch delta 81 zcmaFE_lIwSxF8z?0|N+yKsgYzZPX}bV*CGp^#TUY$#a?HC+}jC#8kBT2~!{ovZ^3< FDFDx365ap+ delta 101 zcmeyv_l9qRxF9P70|N+yKsgYzZqz7c5~-@HVsLhG31M&!24W!X8XPitCzBGU^389U M0$H%Dk7QQ{0Nz&=N&o-= diff --git a/lib/pytz/zoneinfo/America/Rosario b/lib/pytz/zoneinfo/America/Rosario index 2a3eca9d911a484a7e2bebe9788cdc096d9c336c..a703e957d5ebe02e0651d77ddfff4d3f7b8b851b 100644 GIT binary patch delta 92 zcmdnbah_v>xF9IDXt$u*2}lV>nW3UUA?Ko|sUftX|S bA;w@PF0d*NAKwrLkV-C)ESF!%s?HJIr-E9Cgvq5HpxF97kgMcL0KguyQuhy#E)9Ee?j0wBN$CPCB$W!CpV W4##GH*4Z4BKk%wCGESD{QwIRNDG(e0 diff --git a/lib/pytz/zoneinfo/Antarctica/Casey b/lib/pytz/zoneinfo/Antarctica/Casey index 9acead42be0fe77daec55996f21826d3804f8292..76d0794e956578671becc6975b8c136ee027557f 100644 GIT binary patch literal 227 zcmWHE%1kq2zyK^j5fBCeW*`Q!dH>0sY4Ezmrr_Ow>H{MaBS;Pe3K~GtvourKmrCrNU-NW5P<9g=>^#bqRFw73+M`63oZaf*CRjx literal 211 zcmWHE%1kq2zyQoZ5fBCe7@PN>+?fWiTWkv6{ii-KGBHAA85jy07+4q>W^G{LsH&=B k2oDZnaCQU|5D-Fw`Tv0cWCutm$Q}?)id|elyLBzN092JBQUCw| diff --git a/lib/pytz/zoneinfo/Asia/Aqtau b/lib/pytz/zoneinfo/Asia/Aqtau index 31195d7fc0447a55badb688ffd7482c5ef7aac1a..27a3d50d373900078a7088e74e08ce25e002eda7 100644 GIT binary patch delta 77 zcmcb?@q%N5xS#+70|N+yfH4pYY}ANlWMN=%3z#g(Vn6u+qa>!1&94|WnGkCHShxVm C&I`T( delta 67 wcmaFCaf4%mxFA0R0|N+yfH4sBZ`6oooUF)VJNXnN7TL|87&V!|(g`da0Bh34Hv#s=2RFJG& delta 70 zcmaFObem~{xF8z?0|N+y06P$~P1Nw7?7%2HafY}ch!4UbzyZYU6AzS4wqaD};_?g* L(KWR)HsAsPbK45W diff --git a/lib/pytz/zoneinfo/Asia/Dili b/lib/pytz/zoneinfo/Asia/Dili index b7ac96e9bf6dd96a6302622b3c46d6f70ea1e157..37bfc4b2786b53487a2507e39dd077d50eef6e70 100644 GIT binary patch delta 127 zcmbQrw3KOrxF8z?0|N+y04or)P1LYfVqmD7z`)|;8^RFc6T;vX9Kzu283I-UBe3dR P>aR&yCl}C2T}v(iCxj4} delta 101 zcmZ3=G?i(BxF9P70|N+y0GK^d!pF delta 67 wcmX@lyq|f3xF9P70|N+yfFKaFPShx$yqZyZ;vsBuuXcmv*twj8Lv$^;0B!6Gi~s-t diff --git a/lib/pytz/zoneinfo/Asia/Ho_Chi_Minh b/lib/pytz/zoneinfo/Asia/Ho_Chi_Minh index e8dc8068bb99e9597db9163d2b60d67ccf2ebbfb..6401a10256bb3d7c420494dbcce37b3013522194 100644 GIT binary patch literal 255 zcmWHE%1kq2zyPd35fBCe79a+(c{=i)8YafSyD+(RGTcL%^yaLg9RTO44nF_@ diff --git a/lib/pytz/zoneinfo/Asia/Jayapura b/lib/pytz/zoneinfo/Asia/Jayapura index af227c029d7c3a4f5ef3a08453ffd84b5393cd78..0e79d3178813898789d7130d8e3fb8a40b927cfc 100644 GIT binary patch literal 225 zcmWHE%1kq2zyK^j5fBCeW*`Q!d3K2%oN*yy=Z7y_7iBOqF)}bTzW~YCO#n%^&S2nx quzh?(7+gI=7@UJcK+<3kLV`8_fdFI`hz3~)qRFt53+M)2OD+Hp6)zzG delta 89 zcmaFJc#&~}xF9nF0|N+y0GK^dLzUadH-y2}Glao8IAmgi92PbGhLT8XAi5d2fLe4d Fxd29~48{Ne diff --git a/lib/pytz/zoneinfo/Asia/Jerusalem b/lib/pytz/zoneinfo/Asia/Jerusalem index f64f3afde5f00bff3ba085220ab71312b9784322..4e6410f2b2d35afa6563a0963e069e48684551e0 100644 GIT binary patch delta 114 zcmbO#xKwb0_+%?)9@ahv1_suR8jqMH7#Oq+7+Ji0Ll`_=fH)XL0~rjHrI-~2*?`JG e7zFx(m~FE+vnH!1SPzE}P!Fa)uv!Sg#RUMRz!9tf delta 57 zcmZ1~I8|_hxF8Dy0|N+yKpzmZY}9zfG+BUIa)L5zKakJ5Iha|KmBq(5gaIfj&BVn8 E02Z1Fb^rhX diff --git a/lib/pytz/zoneinfo/Asia/Krasnoyarsk b/lib/pytz/zoneinfo/Asia/Krasnoyarsk index 9b2fb8eb2f453badfceda7198db7a10ba296f326..e0a53b915125fc33f041301c47968183e4bc800b 100644 GIT binary patch delta 99 zcmeyxH;aFQxF8n;0|N+yKq(M&ZPch`0tyr~Fmf_5Bo$1yW|w4PWMp8NyoX61Q}yOI NOo1#|m4~pa0RZxe4+j7M delta 67 xcmbQm|BG*exF81u0|N+yKq(M&Y}BY_n!J%oeDWD4c}&^Of0zPUz|tk`Y5Hvza3}gTR diff --git a/lib/pytz/zoneinfo/Asia/Makassar b/lib/pytz/zoneinfo/Asia/Makassar index 736a25b4a0a77882b15bb200e31feb4df6d738b9..f35823303bcd8ae8184f664127c6208e9509e033 100644 GIT binary patch literal 263 zcmWHE%1kq2zyPd35fBCe79a+(1r~maov=&n>V(rBvJIEQ-W4!1F*7kR7|E1Bj;79b7=C I=~{3B0K2C;L;wH) delta 65 tcmZo?`p!5(T#$usE3GfIGVF>UDVekqLnOG$!$O@DIVG!T~V%CW( RYbI+mO0#nT73o@V0RX!+3(5ch diff --git a/lib/pytz/zoneinfo/Asia/Omsk b/lib/pytz/zoneinfo/Asia/Omsk index 77b82ed0fcd4295adaf7152ee2b97d5c83e5b760..f47337f62f5a5a3e2d2bf540a6599d61a6eb2b22 100644 GIT binary patch delta 99 zcmeyxH;aFQxF8n;0|N+yKq(M&ZPch`0tzG*Fmf_5gd|M1W|w4PWMp8NyoX61Q}yOI NOo1#|m4~pa0RZ1s4vzo; delta 67 xcmbQm|BG*exF81u0|N+yKq(M&Y}BY_n!J%oeDWD4c}&^Of0zPUz|tk`Y5GTcLqLk4AcO=v{{sQYUJwnk8$^Tb2ho(cfeYv)U2`q~ D#EUc~ delta 65 tcmey*_?~fsxF8Dy0|N+y0GK^d!(iegk%=YPq~%I!@oA%m6%PvogSPSH1fK7c?%I!@o}Su6%T7wRTTrn(ff@nWL}GY<;`gSPzSEcv&S!xUaj{=+MQscf?(ff@qD8OGtXp0p4XFQd7n>a<-?+4vo4>zAY6%`A};{$ CEEBo_ diff --git a/lib/pytz/zoneinfo/Asia/Riyadh89 b/lib/pytz/zoneinfo/Asia/Riyadh89 index daba1e72f01a82b4a11dfd3a98376eb1aa2bef97..a50ca48a91b9f37ae573a09c21bc208d8b0bbe60 100644 GIT binary patch delta 85 zcmX@@blYiyxZn#01_lrY0>(ff@nWL}GY<;`gSN`#Ecv&S!xUaj{=+MQscf?(ff@qD8OGtXp0p4XFQd7n>a<-?+4vo4>zAY6%`A};{$ CEEBo_ diff --git a/lib/pytz/zoneinfo/Asia/Saigon b/lib/pytz/zoneinfo/Asia/Saigon index e8dc8068bb99e9597db9163d2b60d67ccf2ebbfb..6401a10256bb3d7c420494dbcce37b3013522194 100644 GIT binary patch literal 255 zcmWHE%1kq2zyPd35fBCe79a+(c{=i)8YafSyD+(RGTcL%^yaLpt|v6Gb1;M4+223$@NU303>}48vp$70UOz`*718lr2$1pq083@`uy delta 75 zcmcb^afV}pxF8P$0|N+yfGH63Y}5#4oUFhiJ9z=4$mDH|;)1+DQ4j_JGa%;Oe2>wB RX|fE9IXjoTYlyB17XZtk3-$m2 diff --git a/lib/pytz/zoneinfo/Asia/Tehran b/lib/pytz/zoneinfo/Asia/Tehran index 916694077383aa4c81b6c9e2c3209e1596db2d55..16149ed6bf5bc85657f6a684a70341d719df4f58 100644 GIT binary patch delta 82 zcmcb{^NeSLxF9V(rBvJIEQ-W4!1F*7kR7|E1Bj;79b7=C I=~{3B0K2C;L;wH) delta 65 tcmZo?`p!5(T#$uGTcLqLk4AcO=v{{sQYUJwnk8$^Tb2ho(cfeYv)U2`q~ D&EqsB delta 65 tcmey*_?~fsxF8Dy0|N+y0GK^d!(iegk%=YPq~s}f(dNKZT`#@$f8G@d6Sda)d9|=80`Q6 delta 74 xcmZ3<-^o8gT#$o-fdPa;pcIHXHfq!|P2R{P2NPt#rf4%Wb07;y)#N62bpUVq3RD09 diff --git a/lib/pytz/zoneinfo/Asia/Yakutsk b/lib/pytz/zoneinfo/Asia/Yakutsk index 5887a102005c04bbefdbd2a3427221ba77962b3a..e25574570c2a10bae57f589f75e665b78eebbdee 100644 GIT binary patch delta 99 zcmeyxH;aFQxF8n;0|N+yKq(M&ZPch`0t)mjVB}IFuY|NoC4n7p1za`F)-X+aL4BnX2* h4G?o|{=n42A^=v&0aD4p>*E{3FnJ@B_~dSOIRLVD8}a}E delta 66 zcmX@fzmk7~xF9P70|N+yKs6AvZq(>xn!J}ueDVz@aX~hq2nd5f4G^!%s?HJIr-E9Cgvq5HpxF97kgMcL0KguyQuhy#E)9Ee?j0wBN$CPCB$W!CpV W4##GH*4Z4BKk%wCGESD{QwIRNDG(e0 diff --git a/lib/pytz/zoneinfo/Egypt b/lib/pytz/zoneinfo/Egypt index cd80457fd67c9ee7e1791fead8e77e43e5966e8b..0b0f374d52c4b7f1a819ce489da42c97a94443ca 100644 GIT binary patch delta 72 zcmezGG23&3GUJAgDo+{N6Zc;5>5O==nS&{qk%^IEvLmzk`OS#6NFn*yypFk&$r{Q{m)Nrgo{j4Gcg4k_XWsHDDU3 YZnGG32{Q{5GZXXV32Zr&f3YP306b+Fx&QzG delta 81 zcmcc3cbjj572oR#V#0SOh%=v^ApUvZgpD4%87B)erA(G*;+tH`)GqaU0s|0$lz?cE bGB6EPx>=05gn9A=ww%ce*w`ljVT%U`OS#6NFn*yypFk&$r{Q{m)Nrgo{j4Gcg4k_XWsHDDU3 YZnGG32{Q{5GZXXV32Zr&f3YP306b+Fx&QzG delta 81 zcmcc3cbjj572oR#V#0SOh%=v^ApUvZgpD4%87B)erA(G*;+tH`)GqaU0s|0$lz?cE bGB6EPx>=05gn9A=ww%ce*w`ljVT%UO@I*yz`{@hsF)YX1YrC8`9 NCWmwAPwwK-006jW3v>Vg diff --git a/lib/pytz/zoneinfo/Hongkong b/lib/pytz/zoneinfo/Hongkong index 7ef66519555b7617c62f303420da38b2fe0447c4..45db6e226144e0d72ff942f93d51f1eebc8d2d45 100644 GIT binary patch delta 144 zcmZ3?Ih}KYxF9P70|N+yfGZHQZqyK9ob15pJGq}xLXm-?pn-wY$2Ww*!#fy6gfMsk eX#~J#!sZu@3QUtFSOP&tXb?1l3uvmY1s4EMRu(+~ delta 153 zcmbQvxtMc;xF8Dy0|N+yfIASgY}627%I!@oA%m6%PvogSPSH1fK7c?%I!@o}Su6%T7wRTTrn(ff@nWL}GY<;`gSPzSEcv&S!xUaj{=+MQscf?(ff@qD8OGtXp0p4XFQd7n>a<-?+4vo4>zAY6%`A};{$ CEEBo_ diff --git a/lib/pytz/zoneinfo/Mideast/Riyadh89 b/lib/pytz/zoneinfo/Mideast/Riyadh89 index daba1e72f01a82b4a11dfd3a98376eb1aa2bef97..a50ca48a91b9f37ae573a09c21bc208d8b0bbe60 100644 GIT binary patch delta 85 zcmX@@blYiyxZn#01_lrY0>(ff@nWL}GY<;`gSN`#Ecv&S!xUaj{=+MQscf?(ff@qD8OGtXp0p4XFQd7n>a<-?+4vo4>zAY6%`A};{$ CEEBo_ diff --git a/lib/pytz/zoneinfo/Pacific/Apia b/lib/pytz/zoneinfo/Pacific/Apia index 52844a9e51efced4f0678f550f02b336b28bd3c6..8886f365f0363d1e11f71dbd3889256859db54c9 100644 GIT binary patch delta 25 gcmeBS>S3B-#TIP9$i&Pv@uJbhq9CSVgNeu709T0zg8%>k delta 25 gcmeBS>S3B-#pbHO$i&Pv@uJbhq97($g^9=9095w}M*si- diff --git a/lib/pytz/zoneinfo/Pacific/Fiji b/lib/pytz/zoneinfo/Pacific/Fiji index e0d580639cac3fb423f40148144310be561fcf6c..b2f6cac9c242ee4dfdf104cdfb314c2ac5f7f65d 100644 GIT binary patch delta 24 bcmZ3%w1R1ZFLROOgNXt2A(Y-^1x5}4b5aPY delta 24 bcmZ3%w1R1ZFLUq5goy$3A(Y-^1x5}4d)o;= diff --git a/lib/pytz/zoneinfo/Pacific/Kosrae b/lib/pytz/zoneinfo/Pacific/Kosrae index 6cac75a51e5a6e1e1c8991a2008addac25b4e080..61b7561589cb7897117aa8a4b1f8c8d606a34884 100644 GIT binary patch literal 204 zcmWHE%1kq2zyQoZ5fBCeCLji}S^u|52bguIJ1_z{vo-(;h7|`uB#7pt|v6Gb1;M4+223$@NU303>}48vp46WoBSx04ie#N`Wv4ya8hN f&FZWr99&>^96r7w3_!IKTtKy8z{oIpKd%G;7@ZWG delta 61 zcmaDZeO-EjxF9P70|N+yz-u68-KepXW%62HiOK(2SQ!~7D6_r+in49iXD#8FypmU$ Kk#X{QUI_rBRt`Y` diff --git a/lib/pytz/zoneinfo/US/Indiana-Starke b/lib/pytz/zoneinfo/US/Indiana-Starke index 6e66a418902dba837dc0dca0f9c4a3ffa06e526d..33169f4596381b700b3598dabf7706dce25f65ba 100644 GIT binary patch delta 124 zcmcaD^jc_w_~aU99@d!*3=C`=HRPGq{{LUSfPux?C4|8_7>L7xI3R?<703nxMi2oa zCx{EO16d#p0<(aaeRD7KBvv-CevZlVoJukvgW%z&op_!{dO=^5zw8XD>u>KSkW E0N;BV?EnA( delta 84 zcmaDYbX#bGxF9P70|N+yz)T=!-KZhYJlT*_oShLQ#KO@I*yz`{@hsF)YX1YrC8`9 NCWmwAPwwK-006jW3v>Vg diff --git a/lib/pytz/zoneinfo/localtime b/lib/pytz/zoneinfo/localtime index a65f97edd26d012ce00cf0e2cc5bbce807844eec..2ee14295f108ab15ee013cd912e7688407fa3cde 100644 GIT binary patch literal 118 mcmWHE%1kq2zyORu5fFv}5Ss -# @(#)zone.tab 8.35 +# @(#)zone.tab 8.38 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # @@ -41,7 +41,7 @@ AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay AQ -6835+07758 Antarctica/Davis Davis Station, Vestfold Hills AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula -AQ -7824+10654 Antarctica/Vostok Vostok Station, S Magnetic Pole +AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island @@ -177,8 +177,8 @@ ET +0902+03842 Africa/Addis_Ababa FI +6010+02458 Europe/Helsinki FJ -1808+17825 Pacific/Fiji FK -5142-05751 Atlantic/Stanley -FM +0725+15147 Pacific/Truk Truk (Chuuk) and Yap -FM +0658+15813 Pacific/Ponape Ponape (Pohnpei) +FM +0725+15147 Pacific/Chuuk Chuuk (Truk) and Yap +FM +0658+15813 Pacific/Pohnpei Pohnpei (Ponape) FM +0519+16259 Pacific/Kosrae Kosrae FO +6201-00646 Atlantic/Faroe FR +4852+00220 Europe/Paris @@ -288,6 +288,7 @@ MX +2934-10425 America/Ojinaga US Mountain Time - Chihuahua near US border MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora MX +3232-11701 America/Tijuana US Pacific Time - Baja California near US border MX +3018-11452 America/Santa_Isabel Mexican Pacific Time - Baja California away from US border +MX +2048-10515 America/Bahia_Banderas Mexican Central Time - Bahia de Banderas MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia MY +0133+11020 Asia/Kuching Sabah & Sarawak MZ -2558+03235 Africa/Maputo diff --git a/src/_gtkagg.cpp b/src/_gtkagg.cpp index 650c1354c896..0ad0e999cbfe 100644 --- a/src/_gtkagg.cpp +++ b/src/_gtkagg.cpp @@ -136,6 +136,7 @@ init_gtkagg(void) { init_pygobject(); init_pygtk(); + import_array(); //suppress unused warning by creating in two lines static _gtkagg_module* _gtkagg = NULL; From c2b3c1d45b7fd4fda53fcb0a317b5c44e221ecc4 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Tue, 4 Jan 2011 00:45:25 +0000 Subject: [PATCH 300/324] apply patch by Paul Ivanov to move twinx second axis offset to the RHS svn path=/branches/v1_0_maint/; revision=8879 --- lib/matplotlib/axes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 60a1aea59973..3a053361d92d 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -7378,6 +7378,7 @@ def twinx(self): frameon=False) ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') + ax2.yaxis.set_offset_position('right') self.yaxis.tick_left() ax2.xaxis.set_visible(False) return ax2 From 2f86ae77f465c9294a7179a4b3001f41b5c87c50 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Tue, 4 Jan 2011 20:24:12 +0000 Subject: [PATCH 301/324] Bugfix: invert_xaxis and invert_yaxis now notify observers. Closes 3123226 svn path=/branches/v1_0_maint/; revision=8882 --- lib/matplotlib/axes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 3a053361d92d..6c9090c3dafb 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -2263,7 +2263,7 @@ def set_axis_bgcolor(self, color): def invert_xaxis(self): "Invert the x-axis." left, right = self.get_xlim() - self.viewLim.intervalx = (right, left) + self.set_xlim(right, left) def xaxis_inverted(self): 'Returns True if the x-axis is inverted.' @@ -2471,7 +2471,7 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs): def invert_yaxis(self): "Invert the y-axis." bottom, top = self.get_ylim() - self.viewLim.intervaly = (top, bottom) + self.set_ylim(top, bottom) def yaxis_inverted(self): 'Returns True if the y-axis is inverted.' From ea7344e018dfb0b62ea1f7f87abac280400affb3 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Tue, 4 Jan 2011 20:52:42 +0000 Subject: [PATCH 302/324] Finance: change volume to float; close 3108059 svn path=/branches/v1_0_maint/; revision=8884 --- lib/matplotlib/finance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/finance.py b/lib/matplotlib/finance.py index 08b9c21adadb..aa1a951a200e 100644 --- a/lib/matplotlib/finance.py +++ b/lib/matplotlib/finance.py @@ -38,7 +38,7 @@ ('close', np.float), ('high', np.float), ('low', np.float), - ('volume', np.int), + ('volume', np.float), ('aclose', np.float)]) @@ -57,7 +57,7 @@ def parse_yahoo_historical(fh, adjusted=True, asobject=False): by the adjusted close, regardless of whether you choose adjusted = True|False. - + *asobject* If False (default for compatibility with earlier versions) return a list of tuples containing @@ -101,7 +101,7 @@ def parse_yahoo_historical(fh, adjusted=True, asobject=False): dt = datetime.date(*[int(val) for val in datestr.split('-')]) dnum = date2num(dt) open, high, low, close = [float(val) for val in vals[1:5]] - volume = int(vals[5]) + volume = float(vals[5]) aclose = float(vals[6]) results.append((dt, dt.year, dt.month, dt.day, From 42b838851e5ebdd463c4a922276eecb65c5acb93 Mon Sep 17 00:00:00 2001 From: Michiel de Hoon Date: Wed, 5 Jan 2011 13:31:24 +0000 Subject: [PATCH 303/324] Replace MacOS.WMAvailable, as the MacOS module is not available with 64-bit Pythons, and deprecated for Python 3. svn path=/branches/v1_0_maint/; revision=8886 --- lib/matplotlib/backends/backend_macosx.py | 3 +- src/_macosx.m | 39 ++++++++++++++++------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/lib/matplotlib/backends/backend_macosx.py b/lib/matplotlib/backends/backend_macosx.py index c353d3378297..85f510e3291d 100644 --- a/lib/matplotlib/backends/backend_macosx.py +++ b/lib/matplotlib/backends/backend_macosx.py @@ -2,7 +2,6 @@ import os import numpy -import MacOS from matplotlib._pylab_helpers import Gcf from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ @@ -229,7 +228,7 @@ def new_figure_manager(num, *args, **kwargs): """ Create a new figure manager instance """ - if not MacOS.WMAvailable(): + if not _macosx.verify_main_display(): import warnings warnings.warn("Python is not installed as a framework. The MacOSX backend may not work correctly if Python is not installed as a framework. Please see the Python documentation for more information on installing Python as a framework on Mac OS X") FigureClass = kwargs.pop('FigureClass', Figure) diff --git a/src/_macosx.m b/src/_macosx.m index a9d05e920d8f..8de03b50b48f 100644 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -4399,16 +4399,6 @@ -(void)save_figure:(id)sender return Py_None; } -static char show__doc__[] = "Show all the figures and enter the main loop.\nThis function does not return until all Matplotlib windows are closed,\nand is normally not needed in interactive sessions."; - -static PyObject* -show(PyObject* self) -{ - if(nwin > 0) [NSApp run]; - Py_INCREF(Py_None); - return Py_None; -} - @implementation Window - (Window*)initWithContentRect:(NSRect)rect styleMask:(unsigned int)mask backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation withManager: (PyObject*)theManager { @@ -5139,11 +5129,32 @@ - (int)index } @end + +static PyObject* +show(PyObject* self) +{ + if(nwin > 0) [NSApp run]; + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject* +verify_main_display(PyObject* self) +{ + CGDirectDisplayID display = CGMainDisplayID(); + if (display == 0) { + PyErr_SetString(PyExc_RuntimeError, "Failed to obtain the display ID of the main display"); + return NULL; + } + Py_INCREF(Py_True); + return Py_True; +} + static struct PyMethodDef methods[] = { {"show", (PyCFunction)show, METH_NOARGS, - show__doc__ + "Show all the figures and enter the main loop.\nThis function does not return until all Matplotlib windows are closed,\nand is normally not needed in interactive sessions." }, {"choose_save_file", (PyCFunction)choose_save_file, @@ -5155,11 +5166,17 @@ - (int)index METH_VARARGS, "Sets the active cursor." }, + {"verify_main_display", + (PyCFunction)verify_main_display, + METH_NOARGS, + "Verifies if the main display can be found. This function fails if Python is not built as a framework." + }, {NULL, NULL, 0, NULL}/* sentinel */ }; void init_macosx(void) { PyObject *m; + import_array(); if (PyType_Ready(&GraphicsContextType) < 0) return; From f954a510002cfa03ff044dcca379074182389d00 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 5 Jan 2011 15:59:33 +0000 Subject: [PATCH 304/324] fix rc file defaults issue for docs; python 2.4 compliance for formlayout svn path=/branches/v1_0_maint/; revision=8889 --- doc/matplotlibrc | 2 +- lib/matplotlib/__init__.py | 13 +++++++++++-- lib/matplotlib/backends/qt4_editor/formlayout.py | 6 +++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/matplotlibrc b/doc/matplotlibrc index f7088e15440e..303241b90b43 100644 --- a/doc/matplotlibrc +++ b/doc/matplotlibrc @@ -232,7 +232,7 @@ lines.linewidth : 1.5 # line width in points ### FIGURE # See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure -figure.figsize : 6, 4 # figure size in inches +figure.figsize : 5.5, 4.5 # figure size in inches #figure.dpi : 80 # figure dots per inch #figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray #figure.edgecolor : white # figure edgecolor diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 72933e427ba2..3e43b2edd993 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -762,6 +762,7 @@ def rc_params(fail_on_error=False): # this is the instance used by the matplotlib classes rcParams = rc_params() +rcParamsOrig = rcParams.copy() rcParamsDefault = RcParams([ (key, default) for key, (default, converter) in \ defaultParams.iteritems() ]) @@ -843,11 +844,19 @@ def rc(group, **kwargs): def rcdefaults(): """ - Restore the default rc params - the ones that were created at - matplotlib load time. + Restore the default rc params - these are not the params loaded by + the rc file, but mpl's internal params. See rc_file_defaults for + reloading the default params from the rc file """ rcParams.update(rcParamsDefault) +def rc_file_defaults(): + """ + Restore the default rc params from the original matplotlib rc that + was loaded + """ + rcParams.update(rcParamsOrig) + _use_error_msg = """ This call to matplotlib.use() has no effect because the the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, diff --git a/lib/matplotlib/backends/qt4_editor/formlayout.py b/lib/matplotlib/backends/qt4_editor/formlayout.py index 0accdbbdade9..5805249b91f6 100644 --- a/lib/matplotlib/backends/qt4_editor/formlayout.py +++ b/lib/matplotlib/backends/qt4_editor/formlayout.py @@ -272,7 +272,11 @@ def setup(self): field.setCurrentIndex(selindex) elif isinstance(value, bool): field = QCheckBox(self) - field.setCheckState(Qt.Checked if value else Qt.Unchecked) + if value: + field.setCheckState(Qt.Checked) + else: + field.setCheckedState(Qt.Unchecked) + elif isinstance(value, float): field = QLineEdit(repr(value), self) elif isinstance(value, int): From ea2292e02d8fad33ccdb8a72863c60d731384c02 Mon Sep 17 00:00:00 2001 From: Ben Root Date: Wed, 5 Jan 2011 17:44:17 +0000 Subject: [PATCH 305/324] Applying a similar fix to r8873 which seemed to only have been applied to the development branch. This fixes a math domain error when using log scales. svn path=/branches/v1_0_maint/; revision=8891 --- lib/matplotlib/ticker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 9c55604faf3e..f97a1cbc9100 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1194,7 +1194,7 @@ def is_decade(x, base=10): return False if x == 0.0: return True - lx = math.log(x)/math.log(base) + lx = math.log(abs(x))/math.log(base) return is_close_to_int(lx) def is_close_to_int(x): From 79537dced361acf8eb851cbbbb0ca5ea72df638a Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 5 Jan 2011 18:14:36 +0000 Subject: [PATCH 306/324] remove unused params from doc rc; add comment on examples.download params svn path=/branches/v1_0_maint/; revision=8892 --- doc/matplotlibrc | 317 +---------------------------------------------- 1 file changed, 6 insertions(+), 311 deletions(-) diff --git a/doc/matplotlibrc b/doc/matplotlibrc index 303241b90b43..795d4be07e3b 100644 --- a/doc/matplotlibrc +++ b/doc/matplotlibrc @@ -1,318 +1,13 @@ -### MATPLOTLIBRC FORMAT - -# This is a sample matplotlib configuration file. It should be placed -# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and -# C:\Documents and Settings\yourname\.matplotlib (win32 systems) -# -# By default, the installer will overwrite the existing file in the -# install path, so if you want to preserve your's, please move it to -# your HOME dir and set the environment variable if necessary. -# -# This file is best viewed in a editor which supports python mode -# syntax highlighting -# -# Blank lines, or lines starting with a comment symbol, are ignored, -# as are trailing comments. Other lines must have the format -# -# key : val # optional comment -# -# Colors: for the color values below, you can either use -# - a matplotlib color string, such as r, k, or b -# - an rgb tuple, such as (1.0, 0.5, 0.0) -# - a hex string, such as ff00ff (no '#' symbol) -# - a scalar grayscale intensity such as 0.75 -# - a legal html color name, eg red, blue, darkslategray - -#### CONFIGURATION BEGINS HERE -# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg -# WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template backend : Agg -#maskedarray : False # True to use external maskedarray module - # instead of numpy.ma; this is a temporary - # setting for testing maskedarray. -#interactive : False # see http://matplotlib.sourceforge.net/interactive.html -#toolbar : toolbar2 # None | classic | toolbar2 -#timezone : UTC # a pytz timezone string, eg US/Central or Europe/Paris - -# Where your matplotlib data lives if you installed to a non-default -# location. This is where the matplotlib fonts, bitmaps, etc reside -#datapath : /home/jdhunter/mpldata - - -### LINES -# See http://matplotlib.sourceforge.net/matplotlib.lines.html for more -# information on line properties. -lines.linewidth : 1.5 # line width in points -#lines.linestyle : - # solid line -#lines.color : blue -#lines.marker : None # the default marker -#lines.markeredgewidth : 0.5 # the line width around the marker symbol -#lines.markersize : 6 # markersize, in points -#lines.dash_joinstyle : miter # miter|round|bevel -#lines.dash_capstyle : butt # butt|round|projecting -#lines.solid_joinstyle : miter # miter|round|bevel -#lines.solid_capstyle : projecting # butt|round|projecting -#lines.antialiased : True # render lines in antialised (no jaggies) - -### PATCHES -# Patches are graphical objects that fill 2D space, like polygons or -# circles. See -# http://matplotlib.sourceforge.net/matplotlib.patches.html for more -# information on patch properties -#patch.linewidth : 1.0 # edge width in points -#patch.facecolor : blue -#patch.edgecolor : black -#patch.antialiased : True # render patches in antialised (no jaggies) - -### FONT -# -# font properties used by text.Text. See -# http://matplotlib.sourceforge.net/matplotlib.font_manager.html for more -# information on font properties. The 6 font properties used for font -# matching are given below with their default values. -# -# The font.family property has five values: 'serif' (e.g. Times), -# 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery), -# 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier). Each of -# these font families has a default list of font names in decreasing -# order of priority associated with them. -# -# The font.style property has three values: normal (or roman), italic -# or oblique. The oblique style will be used for italic, if it is not -# present. -# -# The font.variant property has two values: normal or small-caps. For -# TrueType fonts, which are scalable fonts, small-caps is equivalent -# to using a font size of 'smaller', or about 83% of the current font -# size. -# -# The font.weight property has effectively 13 values: normal, bold, -# bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as -# 400, and bold is 700. bolder and lighter are relative values with -# respect to the current weight. -# -# The font.stretch property has 11 values: ultra-condensed, -# extra-condensed, condensed, semi-condensed, normal, semi-expanded, -# expanded, extra-expanded, ultra-expanded, wider, and narrower. This -# property is not currently implemented. -# -# The font.size property is the default font size for text, given in pts. -# 12pt is the standard value. -# -#font.family : sans-serif -#font.style : normal -#font.variant : normal -#font.weight : medium -#font.stretch : normal -# note that font.size controls default text sizes. To configure -# special text sizes tick labels, axes, labels, title, etc, see the rc -# settings for axes and ticks. Special text sizes can be defined -# relative to font.size, using the following values: xx-small, x-small, -# small, medium, large, x-large, xx-large, larger, or smaller -#font.size : 12.0 -#font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif -#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif -#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive -#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy -#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace - -### TEXT -# text properties used by text.Text. See -# http://matplotlib.sourceforge.net/matplotlib.text.html for more -# information on text properties - -#text.color : black - -### LaTeX customizations. See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex -#text.usetex : False # use latex for all text handling. The following fonts - # are supported through the usual rc parameter settings: - # new century schoolbook, bookman, times, palatino, - # zapf chancery, charter, serif, sans-serif, helvetica, - # avant garde, courier, monospace, computer modern roman, - # computer modern sans serif, computer modern typewriter - # If another font is desired which can loaded using the - # LaTeX \usepackage command, please inquire at the - # matplotlib mailing list -#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling - # unicode strings. -#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES - # AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP - # IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO. - # preamble is a comma separated list of LaTeX statements - # that are included in the LaTeX document preamble. - # An example: - # text.latex.preamble : \usepackage{bm},\usepackage{euler} - # The following packages are always loaded with usetex, so - # beware of package collisions: color, geometry, graphicx, - # type1cm, textcomp. Adobe Postscript (PSSNFS) font packages - # may also be loaded, depending on your font settings -#text.dvipnghack : False # some versions of dvipng don't handle - # alpha channel properly. Use True to correct and flush - # ~/.matplotlib/tex.cache before testing -#text.markup : 'plain' # Affects how text, such as titles and labels, are - # interpreted by default. - # 'plain': As plain, unformatted text - # 'tex': As TeX-like text. Text between $'s will be - # formatted as a TeX math expression. - # This setting has no effect when text.usetex is True. - # In that case, all text will be sent to TeX for - # processing. - -# The following settings allow you to select the fonts in math mode. -# They map from a TeX font name to a fontconfig font pattern. -# These settings are only used if mathtext.fontset is 'custom'. -#mathtext.cal : cursive -#mathtext.rm : serif -#mathtext.tt : monospace -#mathtext.it : serif:italic -#mathtext.bf : serif:bold -#mathtext.sf : sans -#mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix', - # 'stixsans' or 'custom' -#mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern - # fonts when a symbol can not be found in one of - # the custom math fonts. - -### AXES -# default face and edge color, default tick sizes, -# default fontsizes for ticklabels, and so on. See -# http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes -#axes.hold : True # whether to clear the axes by default on -#axes.facecolor : white # axes background color -#axes.edgecolor : black # axes edge color -#axes.linewidth : 1.0 # edge linewidth -#axes.grid : False # display grid or not -#axes.titlesize : 14 # fontsize of the axes title -#axes.labelsize : 12 # fontsize of the x any y labels -#axes.labelcolor : black -#axes.axisbelow : False # whether axis gridlines and ticks are below - # the axes elements (lines, text, etc) -#axes.formatter.limits : -7, 7 # use scientific notation if log10 - # of the axis range is smaller than the - # first or larger than the second - -#polaraxes.grid : True # display grid on polar axes - -### TICKS -# see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks -#xtick.major.size : 4 # major tick size in points -#xtick.minor.size : 2 # minor tick size in points -#xtick.major.pad : 4 # distance to major tick label in points -#xtick.minor.pad : 4 # distance to the minor tick label in points -#xtick.color : k # color of the tick labels -#xtick.labelsize : 12 # fontsize of the tick labels -#xtick.direction : in # direction: in or out - -#ytick.major.size : 4 # major tick size in points -#ytick.minor.size : 2 # minor tick size in points -#ytick.major.pad : 4 # distance to major tick label in points -#ytick.minor.pad : 4 # distance to the minor tick label in points -#ytick.color : k # color of the tick labels -#ytick.labelsize : 12 # fontsize of the tick labels -#ytick.direction : in # direction: in or out - -### GRIDS -#grid.color : black # grid color -#grid.linestyle : : # dotted -#grid.linewidth : 0.5 # in points - -### Legend -#legend.isaxes : True -#legend.numpoints : 2 # the number of points in the legend line -#legend.fontsize : 14 -#legend.pad : 0.2 # the fractional whitespace inside the legend border -#legend.markerscale : 1.0 # the relative size of legend markers vs. original -# the following dimensions are in axes coords -#legend.labelsep : 0.010 # the vertical space between the legend entries -#legend.handlelen : 0.05 # the length of the legend lines -#legend.handletextsep : 0.02 # the space between the legend line and legend text -#legend.axespad : 0.02 # the border between the axes and legend edge -#legend.shadow : False - -### FIGURE -# See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure figure.figsize : 5.5, 4.5 # figure size in inches -#figure.dpi : 80 # figure dots per inch -#figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray -#figure.edgecolor : white # figure edgecolor - -# The figure subplot parameters. All dimensions are fraction of the -# figure width or height -figure.subplot.left : 0.2 # the left side of the subplots of the figure -#figure.subplot.right : 0.9 # the right side of the subplots of the figure -figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure -#figure.subplot.top : 0.9 # the top of the subplots of the figure -#figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots -#figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots - -#figure.autolayout : False # when True, adjust the axes so that text doesn't overlap - -### IMAGES -#image.aspect : equal # equal | auto | a number -#image.interpolation : bilinear # see help(imshow) for options -#image.cmap : jet # gray | jet etc... -#image.lut : 256 # the size of the colormap lookup table -#image.origin : upper # lower | upper - - -### CONTOUR PLOTS -#contour.negative_linestyle : dashed # dashed | solid - -### SAVING FIGURES -# the default savefig params can be different for the GUI backends. -# Eg, you may want a higher resolution, or to make the figure -# background white savefig.dpi : 80 # figure dots per inch -#savefig.facecolor : white # figure facecolor when saving -#savefig.edgecolor : white # figure edgecolor when saving - -#cairo.format : png # png, ps, pdf, svg - -# tk backend params -#tk.window_focus : False # Maintain shell focus for TkAgg -#tk.pythoninspect : False # tk sets PYTHONINSEPCT - -# ps backend params -#ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10 -#ps.useafm : False # use of afm fonts, results in small files -#ps.usedistiller : False # can be: None, ghostscript or xpdf - # Experimental: may produce smaller files. - # xpdf intended for production of publication quality files, - # but requires ghostscript, xpdf and ps2eps -#ps.distiller.res : 6000 # dpi -#ps.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType) - -# pdf backend params -#pdf.compression : 6 # integer from 0 to 9 - # 0 disables compression (good for debugging) -#pdf.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType) - -# svg backend params -#svg.image_inline : True # write raster image data directly into the svg file -#svg.image_noscale : False # suppress scaling of raster data embedded in SVG -#svg.embed_chars : True # embed character outlines in the SVG file - -# docstring params docstring.hardcopy : True # set this when you want to generate hardcopy docstring -# Set the verbose flags. This controls how much information -# matplotlib gives you at runtime and where it goes. The verbosity -# levels are: silent, helpful, debug, debug-annoying. Any level is -# inclusive of all the levels below it. If you setting is debug, -# you'll get all the debug and helpful messages. When submitting -# problems to the mailing-list, please set verbose to helpful or debug -# and paste the output into your report. -# -# The fileo gives the destination for any calls to verbose.report. -# These objects can a filename, or a filehandle like sys.stdout. -# -# You can override the rc default verbosity from the command line by -# giving the flags --verbose-LEVEL where LEVEL is one of the legal -# levels, eg --verbose-helpful. -# -# You can access the verbose instance in your code -# from matplotlib import verbose. +# these parameters are useful for packagers who want to build the docs +# w/o invoking file downloads for the sampledata (see +# matplotlib.cbook.get_sample_data. Unpack +# mpl_sampledata-VERSION.tar.gz and point examples.directory to it. -#verbose.level : silent # one of silent, helpful, debug, debug-annoying -#verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr +#examples.download : False # False to bypass downloading mechanism +#examples.directory : /home/titan/johnh/python/svn/matplotlib.trunk/sample_data/ # directory to look in if download is false From 85217d6649ed59b5316437e31f0f2af595e942cf Mon Sep 17 00:00:00 2001 From: John Hunter Date: Wed, 5 Jan 2011 22:04:47 +0000 Subject: [PATCH 307/324] bumpt the rc version num svn path=/branches/v1_0_maint/; revision=8893 --- doc/pyplots/tex_demo.png | Bin 24785 -> 24773 bytes lib/matplotlib/__init__.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/pyplots/tex_demo.png b/doc/pyplots/tex_demo.png index 883f22546130da55ed7f8b358afbb0a8f146b08c..6ac6b7c46c9a1def49b5dff637cf2e0e509ce2ad 100644 GIT binary patch literal 24773 zcmbrmby!tx_by5(C@I~bgs31$gOmzLi;AR_q%_jGfEQ^5QIG}&X(UBNV$q$_(%s#; z_E^5(cYgcqef~RKcySSP&gU7=i2J_Bm;7w7bX0V))AlHGC zwDJ3DiR&Er!#_!4yUJ!cYG^}UwN%@WtGh1=R$m}oVSwnSJA(BjgJpGlO!jd%|AKu znb7-Otw&EvAZmwk>$bdiSnGW|jNxkCGyGM!Zlk!ES+X8ASuCTMCvD!ugI*Gz5L4!p z;FPjSMiG8tF#>*}P^kbS+@7A#UDH3NU)9)9VINfd^0`1WcGw&C-?B?tX zG<1lhyJA_3sTrABnN$6p9E14ic6S?vi+6TfZXl~Acmk}fI8Ov|i7?jJBPVfj-D2N! z1`<+|kaSYvVRBLR{JGPlUIysh3QxQfd)>G(L~@BspG0fD|1o0J|g7zXydyhBlu#l;P;>PBt&E{cM9$rsU&kTJ{DT)3I{o!|Yu_60dr zXq7qwsrhMPqhh~&GF><+QryhJ$z}EMEQptyj`Mj;Hd2D4zUILk>dSjgKNXe6M#G-+ z?##_|uCJv|7bAW?ni@q}a;U1;)9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--- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -99,7 +99,7 @@ """ from __future__ import generators -__version__ = '1.0.1rc1' +__version__ = '1.0.1rc2' __revision__ = '$Revision$' __date__ = '$Date$' From 15fa2140f5589ffb3b17cc0c362187452dd133f7 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 6 Jan 2011 01:26:23 +0000 Subject: [PATCH 308/324] fix the plot directive svn path=/branches/v1_0_maint/; revision=8895 --- lib/matplotlib/sphinxext/plot_directive.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 6ba8e1521d52..b3c256b0bd3f 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -263,12 +263,10 @@ def run_savefig(plot_path, basename, tmpdir, destdir, formats): return len(fig_managers) + def clear_state(): plt.close('all') - matplotlib.rcdefaults() - # Set a default figure size that doesn't overflow typical browser - # windows. The script is free to override it if necessary. - matplotlib.rcParams['figure.figsize'] = (5.5, 4.5) + matplotlib.rc_file_defaults() def render_figures(plot_path, function_name, plot_code, tmpdir, destdir, formats, context=False): From a9f3f3a50745a1ca0e666bb1b6d0b9d782553dd9 Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 6 Jan 2011 13:50:07 +0000 Subject: [PATCH 309/324] tag 1.0.1 for release svn path=/branches/v1_0_maint/; revision=8897 --- CHANGELOG | 4 +++- doc/api/gridspec_api.rst | 4 ++-- doc/pyplots/tex_demo.png | Bin 24773 -> 18782 bytes lib/matplotlib/__init__.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6f70ce6cc7a2..714568e5af0c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,11 @@ +2011-01-04 Tag 1.0.1 for release at r8896 + 2010-11-22 Fixed error with Hammer projection. - BVR 2010-11-12 Fixed the placement and angle of axis labels in 3D plots. - BVR 2010-11-07 New rc parameters examples.download and examples.directory - allow bypassing the download mechanism in get_sample_data. + allow bypassing the download mechanism in get_sample_data. - JKS 2010-08-21 Change Axis.set_view_interval() so that when updating an diff --git a/doc/api/gridspec_api.rst b/doc/api/gridspec_api.rst index c0107dfa6bf9..6e4135ae401b 100644 --- a/doc/api/gridspec_api.rst +++ b/doc/api/gridspec_api.rst @@ -1,6 +1,6 @@ -************* +******************* matplotlib gridspec -************* +******************* :mod:`matplotlib.gridspec` diff --git a/doc/pyplots/tex_demo.png b/doc/pyplots/tex_demo.png index 6ac6b7c46c9a1def49b5dff637cf2e0e509ce2ad..8dcb9e6832b1d35bb242fd8c9a7019bad3e71df2 100644 GIT binary patch literal 18782 zcmZsD1yqw^|MmtF(j^^&s3=m>jig9RHv%%GyHij^Nc&2aucE~|47FtV|ymhhhZd>XBU1gDM`q{ zjlkM>eKKJvpU1&rf}88})XV1)H9}O)T4&Qv$7UA^Yfkkwh7?nV$FeFa57K9*%1`bk zFMH*jCyhG4a0^WzPyT3}Z25-kE@9)R)`X$KN^YL&BuzWBjoM&Fc9m-DzQ_FTz13t3rJ&a=luQ<%RZpIn7ySMM zDu@K{z{eYgP=Z$(HL+FkS;Jjq{{8X$L<9EC@DK75B-g@__Hd}9qs)u-{gaoEj^ShJ zC<#_-MHsl+^IBNRf}=gQo&Cg;599BxYia4B$<#Ngv29?!N@;~P-Y9G=RFTQJXvp?0?kA+`c7B3!f8X&|FkvL$@*FW98XLv znI(9~A6a1~<0;51)!U@;M)5a2FYC`bS=Q0r*S@GHs| zo(b8Bn+l|%cv$IkxNT+MppK3!%UnV{r3+`SvRzrXV5_rf!;ZDEw8tbjabuMXa} zPgJc<8jY4t5B|u~i0v*bGI9!lj^3Ub{&}_I7AgHQotEAd`%d@=ePagua6H`crRDkZ zWeA_FNG@1|IG)vsyC5!N0os$Xkb$6*>o>H z`!KqQ={KY29~}qQh#&YHSC=%G9@53^4~!<)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O~DXcn2viBO{|zn4jmv94LD&cXfBuUlva-EG|}lW1HWeJA}tQ zX6zB=ad9{Ikln1iZaLrB`KYT6=&iUqLvS}`qRLEkK(E=@*5OX|2M@3Pv3y1%s|c_D zu|LL^)4nII1=c!*azvu^l=PKt!K0Y&qhO3SZ0ufVxFTUI!O0TZ6l442@{uM8yap!3 zi(HYFqN5bO<1+(SHR1}qPKP`Y4z~g*UpYzopQvO}!;{#^Y-;hAr%T_BFtnYZC^91$1!7Y_A6B|~<0 h(y9Od`=5u|Mt{vP^&VB3wt(gk8mihVMM{>>{|{f%A&dY3 diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index e0f2a4cfa5b0..57f45b39a736 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -99,7 +99,7 @@ """ from __future__ import generators -__version__ = '1.0.1rc2' +__version__ = '1.0.1' __revision__ = '$Revision$' __date__ = '$Date$' From d21caa5e01054fce94b0312dcc9644d69cfbcd8c Mon Sep 17 00:00:00 2001 From: John Hunter Date: Thu, 6 Jan 2011 19:42:08 +0000 Subject: [PATCH 310/324] support relative paths in examples.directory svn path=/branches/v1_0_maint/; revision=8899 --- doc/matplotlibrc | 4 +++- lib/matplotlib/__init__.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/matplotlibrc b/doc/matplotlibrc index 795d4be07e3b..aca4828a0799 100644 --- a/doc/matplotlibrc +++ b/doc/matplotlibrc @@ -8,6 +8,8 @@ docstring.hardcopy : True # set this when you want to generate hardcopy docstri # w/o invoking file downloads for the sampledata (see # matplotlib.cbook.get_sample_data. Unpack # mpl_sampledata-VERSION.tar.gz and point examples.directory to it. +# You can use a relative path for examples.directory and it must be +# relative to this matplotlibrc file #examples.download : False # False to bypass downloading mechanism -#examples.directory : /home/titan/johnh/python/svn/matplotlib.trunk/sample_data/ # directory to look in if download is false +#examples.directory : /your/path/to/sample_data/ # directory to look in if download is false diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 57f45b39a736..66d333094da4 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -762,6 +762,21 @@ def rc_params(fail_on_error=False): # this is the instance used by the matplotlib classes rcParams = rc_params() + +if rcParams['examples.directory']: + # paths that are intended to be relative to matplotlib_fname() + # are allowed for the examples.directory parameter. + # However, we will need to fully qualify the path because + # Sphinx requires absolute paths. + if not os.path.isabs(rcParams['examples.directory']): + _basedir, _fname = os.path.split(matplotlib_fname()) + # Sometimes matplotlib_fname() can return relative paths, + # Also, using realpath() guarentees that Sphinx will use + # the same path that matplotlib sees (in case of weird symlinks). + _basedir = os.path.realpath(_basedir) + _fullpath = os.path.join(_basedir, rcParams['examples.directory']) + rcParams['examples.directory'] = _fullpath + rcParamsOrig = rcParams.copy() rcParamsDefault = RcParams([ (key, default) for key, (default, converter) in \ @@ -770,6 +785,8 @@ def rc_params(fail_on_error=False): rcParams['ps.usedistiller'] = checkdep_ps_distiller(rcParams['ps.usedistiller']) rcParams['text.usetex'] = checkdep_usetex(rcParams['text.usetex']) + + def rc(group, **kwargs): """ Set the current rc params. Group is the grouping for the rc, eg. From d8c134c2bbf1e31409bd463219a96bb2b54de250 Mon Sep 17 00:00:00 2001 From: Michiel de Hoon Date: Sat, 8 Jan 2011 07:09:23 +0000 Subject: [PATCH 311/324] Fixing a bug. Due to a race condition, the view of a closing window could get one release too many. svn path=/branches/v1_0_maint/; revision=8902 --- src/_macosx.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/_macosx.m b/src/_macosx.m index 8de03b50b48f..83e7346e7643 100644 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -3363,7 +3363,6 @@ static void _data_provider_release(void* info, const void* data, size_t size) [window setDelegate: view]; [window makeFirstResponder: view]; [[window contentView] addSubview: view]; - [view release]; [window makeKeyAndOrderFront: nil]; nwin++; @@ -4448,6 +4447,10 @@ - (void)dealloc gstate = PyGILState_Ensure(); Py_DECREF(manager); PyGILState_Release(gstate); + /* The reference count of the view that was added as a subview to the + * content view of this window was increased during the call to addSubview, + * and is decreased during the call to [super dealloc]. + */ [super dealloc]; } @end From 7c9dd2caaa9a23b7158897091d3975ba52906f20 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Wed, 12 Jan 2011 07:53:37 +0000 Subject: [PATCH 312/324] Fix eps distillation bbox bug; closes 3032385 svn path=/branches/v1_0_maint/; revision=8906 --- lib/matplotlib/backends/backend_ps.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 94901e8177fb..fba529b9c655 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -1363,7 +1363,8 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False): operators. The output is low-level, converting text to outlines. """ - paper_option = "-sPAPERSIZE=%s" % ptype + if eps: paper_option = "-dEPSCrop" + else: paper_option = "-sPAPERSIZE=%s" % ptype psfile = tmpfile + '.ps' outfile = tmpfile + '.output' @@ -1385,14 +1386,6 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False): shutil.move(psfile, tmpfile) - # While it is best if above steps preserve the original bounding - # box, it does not seems to be the case. pstoeps not only convert - # the input to eps format, but also restores the original bbox. - - if eps: - pstoeps(tmpfile, bbox, rotated=rotated) - - def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False): """ Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file. @@ -1432,17 +1425,9 @@ def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False): os.remove(tmpfile) shutil.move(psfile, tmpfile) - - # Similar to the gs_distillier case, ps2pdf does not seem to - # preserve the bbox of the original file (at least w/ gs - # 8.61). Thus, the original bbox need to be resotred. - - if eps: - pstoeps(tmpfile, bbox, rotated) for fname in glob.glob(tmpfile+'.*'): os.remove(fname) - def get_bbox_header(lbrt, rotated=False): """ return a postscript header stringfor the given bbox lbrt=(l, b, r, t). From e335d1268d4703cfb27cc136cfa4f205c087d015 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Wed, 12 Jan 2011 08:04:06 +0000 Subject: [PATCH 313/324] Backport 8657 from trunk; patch by C. Gohlke; closes 3151544 svn path=/branches/v1_0_maint/; revision=8907 --- lib/matplotlib/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 66d333094da4..3c9cb7407d2f 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -904,10 +904,11 @@ def use(arg, warn=True): if 'matplotlib.backends' in sys.modules: if warn: warnings.warn(_use_error_msg) return - arg = arg.lower() if arg.startswith('module://'): name = arg else: + # Lowercase only non-module backend names (modules are case-sensitive) + arg = arg.lower() be_parts = arg.split('.') name = validate_backend(be_parts[0]) if len(be_parts) > 1: From 63c6868de962e6d00ae2b7129fcb6bad7d07e40f Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Wed, 12 Jan 2011 08:14:53 +0000 Subject: [PATCH 314/324] Add missing show() to example; patch by C. Gohlke; closes 3151545 svn path=/branches/v1_0_maint/; revision=8908 --- examples/api/quad_bezier.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/api/quad_bezier.py b/examples/api/quad_bezier.py index cad7379df55c..f1ab74eea2a0 100644 --- a/examples/api/quad_bezier.py +++ b/examples/api/quad_bezier.py @@ -16,5 +16,4 @@ ax.plot([0.75], [0.25], "ro") ax.set_title('The red point should be on the path') -plt.draw() - +plt.show() \ No newline at end of file From 75f6f9654ae60e7322e8d39f67a7322a31867e58 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Thu, 13 Jan 2011 07:25:48 +0000 Subject: [PATCH 315/324] Apply Laurent Dufreshou's bug fix to animiation_blit_qt4.py. Closes 2880692. svn path=/branches/v1_0_maint/; revision=8911 --- examples/animation/animation_blit_qt4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/animation/animation_blit_qt4.py b/examples/animation/animation_blit_qt4.py index bd52e02d718d..ee1a3826d461 100644 --- a/examples/animation/animation_blit_qt4.py +++ b/examples/animation/animation_blit_qt4.py @@ -46,7 +46,7 @@ def timerEvent(self, evt): self.draw() self.ax_background = self.copy_from_bbox(self.ax.bbox) - self.restore_region(self.ax_background, bbox=self.ax.bbox) + self.restore_region(self.ax_background) # update the data self.sin_line.set_ydata(np.sin(self.x+self.cnt/10.0)) From c02a3ae0040b7c622d295151ce51837ed18cbbb6 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 13 Jan 2011 13:57:12 +0000 Subject: [PATCH 316/324] [3154456] confirm file overwrite (gtk) svn path=/branches/v1_0_maint/; revision=8913 --- lib/matplotlib/backends/backend_gtk.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_gtk.py b/lib/matplotlib/backends/backend_gtk.py index a7a70b4a09dc..8d818f89c24e 100644 --- a/lib/matplotlib/backends/backend_gtk.py +++ b/lib/matplotlib/backends/backend_gtk.py @@ -993,8 +993,9 @@ def __init__ (self, filetypes = [], default_filetype = None ): - super (FileChooserDialog, self).__init__ (title, parent, action, - buttons) + super(FileChooserDialog, self).__init__ (title, parent, action, + buttons) + super(FileChooserDialog, self).set_do_overwrite_confirmation(True) self.set_default_response (gtk.RESPONSE_OK) if not path: path = os.getcwd() + os.sep From c5ccff94a8b28735d360cbe28cd513f10f9fbfa0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 14 Jan 2011 18:15:33 +0000 Subject: [PATCH 317/324] Fix doc build with recent versions of Sphinx (reported by Sandro Tosi) svn path=/branches/v1_0_maint/; revision=8917 --- lib/matplotlib/sphinxext/plot_directive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index b3c256b0bd3f..cd23a1c2de15 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -346,7 +346,7 @@ def _plot_directive(plot_path, basedir, function_name, plot_code, caption, del options['nofigs'] formats = setup.config.plot_formats - if type(formats) == str: + if isinstance(formats, basestring): formats = eval(formats) fname = os.path.basename(plot_path) From 5114b14121fcd1a21f5e03acba34b0d0c1d71d0b Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sun, 16 Jan 2011 01:00:37 +0000 Subject: [PATCH 318/324] Change pcolor and contourf default antialiasing to False; closes 3151847. To avoid misplaced boundaries and artifacts with alpha < 1, we do not stroke the pcolor and contourf patch boundaries by default; but without that stroking, antialiasing produces boundary artifacts that tend to be visually disturbing. Therefore we sacrifice antialiasing for these patches. svn path=/branches/v1_0_maint/; revision=8920 --- lib/matplotlib/axes.py | 35 +++++++++++++++++++++-------------- lib/matplotlib/contour.py | 20 ++++++++++++++++---- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index 6c9090c3dafb..3df3b6c1bfbd 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -6921,14 +6921,14 @@ def pcolor(self, *args, **kwargs): %(PolyCollection)s - Note: the default *antialiaseds* is taken from + Note: the default *antialiaseds* is False if the default + *edgecolors*="none" is used. This eliminates artificial lines + at patch boundaries, and works regardless of the value of + alpha. If *edgecolors* is not "none", then the default + *antialiaseds* is taken from rcParams['patch.antialiased'], which defaults to *True*. - In some cases, particularly if *alpha* is 1, - you may be able to reduce rendering artifacts (light or - dark patch boundaries) by setting it to *False*. An - alternative it to set *edgecolors* to 'face'. Unfortunately, - there seems to be no single combination of parameters that - eliminates artifacts under all conditions. + Stroking the edges may be preferred if *alpha* is 1, but + will cause artifacts otherwise. """ @@ -6977,21 +6977,28 @@ def pcolor(self, *args, **kwargs): C = compress(ravelmask, ma.filled(C[0:Ny-1,0:Nx-1]).ravel()) + linewidths = (0.25,) + if 'linewidth' in kwargs: + kwargs['linewidths'] = kwargs.pop('linewidth') + kwargs.setdefault('linewidths', linewidths) + if shading == 'faceted': edgecolors = 'k', else: edgecolors = 'none' - linewidths = (0.25,) - # Not sure if we want to have the following, or just trap - # invalid kwargs and raise an exception. if 'edgecolor' in kwargs: kwargs['edgecolors'] = kwargs.pop('edgecolor') - if 'linewidth' in kwargs: - kwargs['linewidths'] = kwargs.pop('linewidth') + ec = kwargs.setdefault('edgecolors', edgecolors) + + # aa setting will default via collections to patch.antialiased + # unless the boundary is not stroked, in which case the + # default will be False; with unstroked boundaries, aa + # makes artifacts that are often disturbing. if 'antialiased' in kwargs: kwargs['antialiaseds'] = kwargs.pop('antialiased') - kwargs.setdefault('edgecolors', edgecolors) - kwargs.setdefault('linewidths', linewidths) + if 'antialiaseds' not in kwargs and ec.lower() == "none": + kwargs['antialiaseds'] = False + collection = mcoll.PolyCollection(verts, **kwargs) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 9b4cc75e830f..9c8ef0e34b30 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -662,7 +662,14 @@ def __init__(self, ax, *args, **kwargs): self.colors = kwargs.get('colors', None) norm = kwargs.get('norm', None) self.extend = kwargs.get('extend', 'neither') - self.antialiased = kwargs.get('antialiased', True) + self.antialiased = kwargs.get('antialiased', None) + if self.antialiased is None and self.filled: + self.antialiased = False # eliminate artifacts; we are not + # stroking the boundaries. + # The default for line contours will be taken from + # the LineCollection default, which uses the + # rcParams['lines.antialiased'] + self.nchunk = kwargs.get('nchunk', 0) self.locator = kwargs.get('locator', None) if (isinstance(norm, colors.LogNorm) @@ -734,11 +741,15 @@ def __init__(self, ax, *args, **kwargs): tlinewidths = self._process_linewidths() self.tlinewidths = tlinewidths tlinestyles = self._process_linestyles() + aa = self.antialiased + if aa is not None: + aa = (self.antialiased,) for level, width, lstyle, segs in \ zip(self.levels, tlinewidths, tlinestyles, self.allsegs): # Default zorder taken from LineCollection zorder = kwargs.get('zorder', 2) col = collections.LineCollection(segs, + antialiaseds = aa, linewidths = width, linestyle = lstyle, alpha=self.alpha, @@ -1358,6 +1369,10 @@ def _initialize_x_y(self, z): Override axis units by specifying an instance of a :class:`matplotlib.units.ConversionInterface`. + *antialiased*: [ True | False ] + enable antialiasing, overriding the defaults. For + filled contours, the default is True. For line contours, + it is taken from rcParams['lines.antialiased']. contour-only keyword arguments: @@ -1385,9 +1400,6 @@ def _initialize_x_y(self, z): contourf-only keyword arguments: - *antialiased*: [ True | False ] - enable antialiasing - *nchunk*: [ 0 | integer ] If 0, no subdivision of the domain. Specify a positive integer to divide the domain into subdomains of roughly *nchunk* by *nchunk* From 5cee3792dd167f6c7d2240d42563165228c17c5a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 18 Jan 2011 18:59:03 +0000 Subject: [PATCH 319/324] Increase tolerance in pcolormesh test. svn path=/branches/v1_0_maint/; revision=8926 --- lib/matplotlib/tests/test_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 1e40c5c3bf94..eaeee01b1975 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -474,7 +474,7 @@ def test_symlog(): fig.savefig('symlog') -@image_comparison(baseline_images=['pcolormesh']) +@image_comparison(baseline_images=['pcolormesh'], tol=0.02) def test_pcolormesh(): n = 12 x = np.linspace(-1.5,1.5,n) From bfe6032292502544454eb7882a45206a9f3ea31d Mon Sep 17 00:00:00 2001 From: Ben Root Date: Fri, 21 Jan 2011 21:42:45 +0000 Subject: [PATCH 320/324] Fixes colors normalization with 'under' colors in LinearSegmentedColormap (values between -1 and 0 were being made positive due to an int cast). Thanks to Eoghan Harrington for discovering and supplying the patch! svn path=/branches/v1_0_maint/; revision=8931 --- lib/matplotlib/colors.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index eb2f44557eb3..650f767f525c 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -523,6 +523,10 @@ def __call__(self, X, alpha=None, bytes=False): np.clip(xa * self.N, -1, self.N, out=xa) else: xa = np.clip(xa * self.N, -1, self.N) + + # ensure that all 'under' values will still have negative + # value after casting to int + np.putmask(xa, xa<0.0, -1) xa = xa.astype(int) # Set the over-range indices before the under-range; # otherwise the under-range values get converted to over-range. From 92814db19d3b52a0eda4935634dd25141dfb7d9e Mon Sep 17 00:00:00 2001 From: Ben Root Date: Sat, 22 Jan 2011 16:35:26 +0000 Subject: [PATCH 321/324] Fixing problem where reversed colormaps of LinearSegmentedColormaps were not initialized properly. Thanks to LittleBigBrain for reporting and Friedrich Romstedt for making the original patch. svn path=/branches/v1_0_maint/; revision=8933 --- lib/matplotlib/cm.py | 56 ++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index a35ceb8c8075..4a1762be6991 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -25,6 +25,7 @@ def freversed(x): return freversed def revcmap(data): + """Can only handle specification *data* in dictionary format.""" data_r = {} for key, val in data.iteritems(): if callable(val): @@ -39,32 +40,51 @@ def revcmap(data): data_r[key] = valnew return data_r +def _reverse_cmap_spec(spec): + """Reverses cmap specification *spec*, can handle both dict and tuple + type specs.""" + + if 'red' in spec: + return revcmap(spec) + else: + revspec = list(reversed(spec)) + if len(revspec[0]) == 2: # e.g., (1, (1.0, 0.0, 1.0)) + revspec = [(1.0 - a, b) for a, b in revspec] + return revspec + +def _generate_cmap(name, lutsize): + """Generates the requested cmap from it's name *name*. The lut size is + *lutsize*.""" + + spec = datad[name] + + # Generate the colormap object. + if 'red' in spec: + return colors.LinearSegmentedColormap(name, spec, lutsize) + else: + return colors.LinearSegmentedColormap.from_list(spec, spec, lutsize) + LUTSIZE = mpl.rcParams['image.lut'] _cmapnames = datad.keys() # need this list because datad is changed in loop +# Generate the reversed specifications ... + for cmapname in _cmapnames: - cmapname_r = cmapname+'_r' - cmapspec = datad[cmapname] - if 'red' in cmapspec: - datad[cmapname_r] = revcmap(cmapspec) - cmap_d[cmapname] = colors.LinearSegmentedColormap( - cmapname, cmapspec, LUTSIZE) - cmap_d[cmapname_r] = colors.LinearSegmentedColormap( - cmapname_r, datad[cmapname_r], LUTSIZE) - else: - revspec = list(reversed(cmapspec)) - if len(revspec[0]) == 2: # e.g., (1, (1.0, 0.0, 1.0)) - revspec = [(1.0 - a, b) for a, b in revspec] - datad[cmapname_r] = revspec + spec = datad[cmapname] + spec_reversed = _reverse_cmap_spec(spec) + datad[cmapname + '_r'] = spec_reversed + +# Precache the cmaps with ``lutsize = LUTSIZE`` ... - cmap_d[cmapname] = colors.LinearSegmentedColormap.from_list( - cmapname, cmapspec, LUTSIZE) - cmap_d[cmapname_r] = colors.LinearSegmentedColormap.from_list( - cmapname_r, revspec, LUTSIZE) +# Use datad.keys() to also add the reversed ones added in the section above: +for cmapname in datad.keys(): + cmap_d[cmapname] = _generate_cmap(cmapname, LUTSIZE) locals().update(cmap_d) +# Continue with definitions ... + def register_cmap(name=None, cmap=None, data=None, lut=None): """ Add a colormap to the set recognized by :func:`get_cmap`. @@ -128,7 +148,7 @@ def get_cmap(name=None, lut=None): if lut is None: return cmap_d[name] elif name in datad: - return colors.LinearSegmentedColormap(name, datad[name], lut) + return _generate_cmap(name, lut) else: raise ValueError("Colormap %s is not recognized" % name) From 9e89b76e9668a8f91da84829fe8a030965dda961 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 1 Feb 2011 16:02:54 +0000 Subject: [PATCH 322/324] [3167200] Use from PIL import Image svn path=/branches/v1_0_maint/; revision=8939 --- examples/pylab_examples/image_demo3.py | 2 +- examples/pylab_examples/to_numeric.py | 2 +- examples/user_interfaces/histogram_demo_canvasagg.py | 2 +- lib/matplotlib/image.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/pylab_examples/image_demo3.py b/examples/pylab_examples/image_demo3.py index 46f87147f4e4..ba1c7011ae8f 100644 --- a/examples/pylab_examples/image_demo3.py +++ b/examples/pylab_examples/image_demo3.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from pylab import * try: - import Image + from PIL import Image except ImportError, exc: raise SystemExit("PIL must be installed to run this example") diff --git a/examples/pylab_examples/to_numeric.py b/examples/pylab_examples/to_numeric.py index 67aff0a2731e..c58a2d4d6116 100644 --- a/examples/pylab_examples/to_numeric.py +++ b/examples/pylab_examples/to_numeric.py @@ -8,7 +8,7 @@ from pylab import * from matplotlib.backends.backend_agg import FigureCanvasAgg try: - import Image + from PIL import Image except ImportError, exc: raise SystemExit("PIL must be installed to run this example") diff --git a/examples/user_interfaces/histogram_demo_canvasagg.py b/examples/user_interfaces/histogram_demo_canvasagg.py index a2b368f689a6..3f99c3d1f42e 100644 --- a/examples/user_interfaces/histogram_demo_canvasagg.py +++ b/examples/user_interfaces/histogram_demo_canvasagg.py @@ -54,7 +54,7 @@ if 0: # pass off to PIL - import Image + from PIL import Image im = Image.fromstring( "RGB", (w,h), s) im.show() diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 8528289c130c..e628d99b97d7 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1157,7 +1157,7 @@ def imread(fname, format=None): def pilread(): 'try to load the image with PIL or return None' - try: import Image + try: from PIL import Image except ImportError: return None image = Image.open( fname ) return pil_to_array(image) From 8ce6b679bbd8770ebee34c39cf235b494224ff01 Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Sun, 6 Feb 2011 17:49:43 +0000 Subject: [PATCH 323/324] bug: xlim, ylim with no arguments should not affect autoscaling svn path=/branches/v1_0_maint/; revision=8953 --- lib/matplotlib/pyplot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 12e3017105fc..c73439d580a0 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1054,10 +1054,14 @@ def xlim(*args, **kwargs): xlim(xmax=3) # adjust the max leaving min unchanged xlim(xmin=1) # adjust the min leaving max unchanged + Setting limits turns autoscaling off for the x-axis. + The new axis limits are returned as a length 2 tuple. """ ax = gca() + if not args and not kwargs: + return ax.get_xlim() ret = ax.set_xlim(*args, **kwargs) draw_if_interactive() return ret @@ -1077,9 +1081,13 @@ def ylim(*args, **kwargs): ylim(ymax=3) # adjust the max leaving min unchanged ylim(ymin=1) # adjust the min leaving max unchanged + Setting limits turns autoscaling off for the y-axis. + The new axis limits are returned as a length 2 tuple. """ ax = gca() + if not args and not kwargs: + return ax.get_ylim() ret = ax.set_ylim(*args, **kwargs) draw_if_interactive() return ret From 3922443018b097846ad442c55bb8a4bc2541fa3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Mon, 7 Feb 2011 16:42:17 +0000 Subject: [PATCH 324/324] Quick workaround for dviread bug #3175113 svn path=/branches/v1_0_maint/; revision=8955 --- CHANGELOG | 2 ++ lib/matplotlib/dviread.py | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 714568e5af0c..795c0751bc81 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2011-02-07 Quick workaround for dviread bug #3175113 - JKS + 2011-01-04 Tag 1.0.1 for release at r8896 2010-11-22 Fixed error with Hammer projection. - BVR diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py index 5843a3c5894d..7aca0ed26b59 100644 --- a/lib/matplotlib/dviread.py +++ b/lib/matplotlib/dviread.py @@ -714,22 +714,30 @@ def _register(self, words): subsetting, but I have no example of << in my TeX installation. """ texname, psname = words[:2] - effects, encoding, filename = '', None, None + effects, encodings, filename = '', [], None for word in words[2:]: if not word.startswith('<'): effects = word else: word = word.lstrip('<') if word.startswith('['): - assert encoding is None - encoding = word[1:] + encodings.append(word[1:]) elif word.endswith('.enc'): - assert encoding is None - encoding = word + encodings.append(word) else: assert filename is None filename = word + if len(encodings) > 1: + # TODO this is a stopgap workaround, need to handle this correctly + matplotlib.verbose.report('Multiple encodings for %s = %s, skipping' + % (texname, psname), 'debug') + return + elif len(encodings) == 1: + encoding, = encodings + else: + encoding = None + eff = effects.split() effects = {} try: