From: <md...@us...> - 2008-08-28 12:45:40
|
Revision: 6053 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6053&view=rev Author: mdboom Date: 2008-08-28 12:45:37 +0000 (Thu, 28 Aug 2008) Log Message: ----------- Fix clip_on kwarg to work correctly. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py trunk/matplotlib/lib/matplotlib/backends/backend_ps.py trunk/matplotlib/lib/matplotlib/backends/backend_svg.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-08-28 12:42:52 UTC (rev 6052) +++ trunk/matplotlib/CHANGELOG 2008-08-28 12:45:37 UTC (rev 6053) @@ -1,3 +1,5 @@ +2008-08-28 Fix masked arrays with markers in non-Agg backends - MGD + 2008-08-28 Fix clip_on kwarg so it actually works correctly - MGD 2008-08-25 Fix locale problems in SVG backend - MGD Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-08-28 12:42:52 UTC (rev 6052) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-08-28 12:45:37 UTC (rev 6053) @@ -97,10 +97,12 @@ once and reuse it multiple times. """ tpath = trans.transform_path(path) - for x, y in tpath.vertices: - self.draw_path(gc, marker_path, - marker_trans + transforms.Affine2D().translate(x, y), - rgbFace) + for vertices, codes in tpath.iter_segments(): + if len(vertices): + x,y = vertices[-2:] + self.draw_path(gc, marker_path, + marker_trans + transforms.Affine2D().translate(x, y), + rgbFace) def draw_path_collection(self, master_transform, cliprect, clippath, clippath_trans, paths, all_transforms, offsets, Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-08-28 12:42:52 UTC (rev 6052) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-08-28 12:45:37 UTC (rev 6053) @@ -1247,11 +1247,13 @@ output(Op.gsave) lastx, lasty = 0, 0 - for x, y in tpath.vertices: - dx, dy = x - lastx, y - lasty - output(1, 0, 0, 1, dx, dy, Op.concat_matrix, - marker, Op.use_xobject) - lastx, lasty = x, y + for vertices, code in tpath.iter_segments(): + if len(vertices): + x, y = vertices[-2:] + dx, dy = x - lastx, y - lasty + output(1, 0, 0, 1, dx, dy, Op.concat_matrix, + marker, Op.use_xobject) + lastx, lasty = x, y output(Op.grestore) def _setup_textpos(self, x, y, angle, oldx=0, oldy=0, oldangle=0): Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-08-28 12:42:52 UTC (rev 6052) +++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-08-28 12:45:37 UTC (rev 6053) @@ -510,8 +510,10 @@ ps_cmd.extend(['stroke', 'grestore', '} bind def']) tpath = trans.transform_path(path) - for x, y in tpath.vertices: - ps_cmd.append("%g %g o" % (x, y)) + for vertices, code in tpath.iter_segments(): + if len(vertices): + x, y = vertices[-2:] + ps_cmd.append("%g %g o" % (x, y)) ps = '\n'.join(ps_cmd) self._draw_ps(ps, gc, rgbFace, fill=False, stroke=False) Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-08-28 12:42:52 UTC (rev 6052) +++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-08-28 12:45:37 UTC (rev 6053) @@ -209,10 +209,12 @@ write('<g %s>' % clippath) trans_and_flip = self._make_flip_transform(trans) tpath = trans_and_flip.transform_path(path) - for x, y in tpath.vertices: - details = 'xlink:href="#%s" x="%f" y="%f"' % (name, x, y) - style = self._get_style(gc, rgbFace) - self._svgwriter.write ('<use style="%s" %s/>\n' % (style, details)) + for vertices, code in tpath.iter_segments(): + if len(vertices): + x, y = vertices[-2:] + details = 'xlink:href="#%s" x="%f" y="%f"' % (name, x, y) + style = self._get_style(gc, rgbFace) + self._svgwriter.write ('<use style="%s" %s/>\n' % (style, details)) write('</g>') def draw_path_collection(self, master_transform, cliprect, clippath, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |