From f35a719674cd4e269fccd929128e9dec9420035e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 8 Jan 2008 22:10:52 +0000 Subject: [PATCH 001/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] [ 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] [ 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] [ 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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/135] 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)