From: <md...@us...> - 2007-10-16 14:41:37
|
Revision: 3957 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3957&view=rev Author: mdboom Date: 2007-10-16 07:41:29 -0700 (Tue, 16 Oct 2007) Log Message: ----------- Fixing mistake in last merge Modified Paths: -------------- branches/transforms/lib/matplotlib/patches.py Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-10-16 14:35:12 UTC (rev 3956) +++ branches/transforms/lib/matplotlib/patches.py 2007-10-16 14:41:29 UTC (rev 3957) @@ -771,32 +771,6 @@ """ A scale-free ellipse """ - offset = 4.0 * (npy.sqrt(2) - 1) / 3.0 - - circle = npy.array([ - [-1.0, 0.0], - - [-1.0, offset], - [-offset, 1.0], - [0.0, 1.0], - - [offset, 1.0], - [1.0, offset], - [1.0, 0.0], - - [1.0, -offset], - [offset, -1.0], - [0.0, -1.0], - - [-offset, -1.0], - [-1.0, -offset], - [-1.0, 0.0], - - [-1.0, 0.0] - ], - npy.float_) - - def __str__(self): return "Ellipse(%d,%d;%dx%d)"%(self.center[0],self.center[1],self.width,self.height) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-30 15:51:20
|
Revision: 4525 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4525&view=rev Author: mdboom Date: 2007-11-30 07:51:18 -0800 (Fri, 30 Nov 2007) Log Message: ----------- Fix shadows (see pie_demo.py) Modified Paths: -------------- branches/transforms/lib/matplotlib/patches.py Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-11-30 15:50:35 UTC (rev 4524) +++ branches/transforms/lib/matplotlib/patches.py 2007-11-30 15:51:18 UTC (rev 4525) @@ -71,7 +71,7 @@ self._hatch = hatch self._combined_transform = transforms.IdentityTransform() self.fill = fill - + if len(kwargs): artist.setp(self, **kwargs) __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd @@ -105,7 +105,7 @@ def get_extents(self): return self.get_path().get_extents(self.get_transform()) - + def get_transform(self): return self._combined_transform @@ -116,10 +116,10 @@ def get_data_transform(self): return artist.Artist.get_transform(self) - + def get_patch_transform(self): return transforms.IdentityTransform() - + def get_antialiased(self): return self._antialiased @@ -155,7 +155,7 @@ ACCEPTS: any matplotlib color """ self._facecolor = color - + def set_linewidth(self, w): """ Set the patch linewidth in points @@ -212,7 +212,7 @@ if cbook.is_string_like(self._edgecolor) and self._edgecolor.lower()=='none': gc.set_linewidth(0) - else: + else: gc.set_foreground(self._edgecolor) gc.set_linewidth(self._linewidth) @@ -226,7 +226,7 @@ rgbFace = None else: rgbFace = colors.colorConverter.to_rgb(self._facecolor) - + if self._hatch: gc.set_hatch(self._hatch ) @@ -234,7 +234,7 @@ transform = self.get_transform() tpath = transform.transform_path_non_affine(path) affine = transform.get_affine() - + renderer.draw_path(gc, tpath, affine, rgbFace) #renderer.close_group('patch') @@ -322,25 +322,25 @@ def _update_transform(self): self._shadow_transform = transforms.Affine2D().translate(self._ox, self._oy) - + def _get_ox(self): return self._ox def _set_ox(self, ox): self._ox = ox self._update_transform() - + def _get_oy(self): return self._oy def _set_oy(self, oy): self._oy = oy self._update_transform() - + def get_path(self): return self.patch.get_path() def get_patch_transform(self): - return self._shadow_transform - + return self.patch.get_patch_transform() + self._shadow_transform + class Rectangle(Patch): """ Draw a rectangle with lower left at xy=(x,y) with specified @@ -385,7 +385,7 @@ x, y = self.get_transform().inverted().transform_point( (mouseevent.x, mouseevent.y)) return (x >= 0.0 and x <= 1.0 and y >= 0.0 and y <= 1.0), {} - + def get_x(self): "Return the left coord of the rectangle" return self._bbox.x0 @@ -480,9 +480,9 @@ self._path = Path.unit_regular_polygon(numVertices) self._poly_transform = transforms.Affine2D() self._update_transform() - + Patch.__init__(self, **kwargs) - + __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd def _update_transform(self): @@ -504,7 +504,7 @@ self._orientation = xy self._update_transform() orientation = property(_get_orientation, _set_orientation) - + def _get_radius(self): return self._radius def _set_radius(self, xy): @@ -518,13 +518,13 @@ self._numVertices = numVertices self._path = Path.unit_regular_polygon(numVertices) numvertices = property(_get_numvertices, _set_numvertices) - + def get_path(self): return self._path def get_patch_transform(self): return self._poly_transform - + class PathPatch(Patch): """ A general polycurve path patch. @@ -535,7 +535,7 @@ def __init__(self, path, **kwargs): """ path is a Path object - + Valid kwargs are: %(Patch)s See Patch documentation for additional kwargs @@ -574,7 +574,7 @@ def _set_xy(self, vertices): self._path = Path(vertices) xy = property(_get_xy, _set_xy) - + class Wedge(Patch): def __str__(self): return "Wedge(%g,%g)"%self.xy[0] @@ -612,7 +612,7 @@ [ 0.8, -0.1 ], [ 0.8, -0.3], [ 1.0, 0.0 ], [ 0.8, 0.3], [ 0.8, 0.1 ], [ 0.0, 0.1] ] ) - + def __init__( self, x, y, dx, dy, width=1.0, **kwargs ): """Draws an arrow, starting at (x,y), direction and length given by (dx,dy) the width of the arrow is scaled by width @@ -636,7 +636,7 @@ def get_patch_transform(self): return self._patch_transform - + class FancyArrow(Polygon): """Like Arrow, but lets you set head width and head height independently.""" @@ -744,7 +744,7 @@ def get_path(self): # Since this is dpi dependent, we need to recompute the path # every time. - + # the base vertices x1, y1 = self.xytip x2, y2 = self.xybase @@ -767,7 +767,7 @@ def get_patch_transform(self): return transforms.IdentityTransform() - + def getpoints(self, x1,y1,x2,y2, k): """ for line segment defined by x1,y1 and x2,y2, return the points on @@ -845,7 +845,7 @@ .scale(self._width * 0.5, self._height * 0.5) \ .rotate_deg(self._angle) \ .translate(*self._center) - + def get_path(self): """ Return the vertices of the rectangle @@ -854,12 +854,12 @@ def get_patch_transform(self): return self._patch_transform - + def contains(self,ev): if ev.x is None or ev.y is None: return False,{} x, y = self.get_transform().inverted().transform_point((ev.x, ev.y)) return (x*x + y*y) <= 1.0, {} - + def _get_center(self): return self._center def _set_center(self, center): @@ -880,8 +880,8 @@ self._angle = angle self._recompute_transform() angle = property(_get_angle, _set_angle) - - + + class Circle(Ellipse): """ A circle patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-04 20:28:54
|
Revision: 4594 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4594&view=rev Author: mdboom Date: 2007-12-04 12:28:24 -0800 (Tue, 04 Dec 2007) Log Message: ----------- Fix bbox_artist Modified Paths: -------------- branches/transforms/lib/matplotlib/patches.py Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-12-04 20:08:28 UTC (rev 4593) +++ branches/transforms/lib/matplotlib/patches.py 2007-12-04 20:28:24 UTC (rev 4594) @@ -933,6 +933,7 @@ height=h, fill=fill, ) + r.set_transform(transforms.IdentityTransform()) r.set_clip_on( False ) r.update(props) r.draw(renderer) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-12 13:48:32
|
Revision: 4701 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4701&view=rev Author: mdboom Date: 2007-12-12 05:48:09 -0800 (Wed, 12 Dec 2007) Log Message: ----------- Make the arc edge detection algorithm be dynamic based on the size of the ellipse, rather than always on (that was just for debugging). Modified Paths: -------------- branches/transforms/lib/matplotlib/patches.py Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-12-12 00:15:23 UTC (rev 4700) +++ branches/transforms/lib/matplotlib/patches.py 2007-12-12 13:48:09 UTC (rev 4701) @@ -989,7 +989,7 @@ (self._width, self._height)) inv_error = (1.0 / 1.89818e-6) - if width < inv_error and height < inv_error and False: + if width < inv_error and height < inv_error: self._path = Path.arc(self._theta1, self._theta2) return Patch.draw(self, renderer) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-12 19:12:59
|
Revision: 4714 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4714&view=rev Author: mdboom Date: 2007-12-12 11:11:44 -0800 (Wed, 12 Dec 2007) Log Message: ----------- Code cleanup Modified Paths: -------------- branches/transforms/lib/matplotlib/patches.py Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-12-12 19:07:03 UTC (rev 4713) +++ branches/transforms/lib/matplotlib/patches.py 2007-12-12 19:11:44 UTC (rev 4714) @@ -993,15 +993,6 @@ self._path = Path.arc(self._theta1, self._theta2) return Patch.draw(self, renderer) - # Transforms the axes box_path so that it is relative to the unit - # circle in the same way that it is relative to the desired - # ellipse. - box_path = Path.unit_rectangle() - box_path_transform = transforms.BboxTransformTo(self.axes.bbox) + \ - self.get_transform().inverted() - box_path = box_path.transformed(box_path_transform) - vertices = [] - def iter_circle_intersect_on_line(x0, y0, x1, y1): dx = x1 - x0 dy = y1 - y0 @@ -1046,6 +1037,15 @@ if x >= x0e and x <= x1e and y >= y0e and y <= y1e: yield x, y + + # Transforms the axes box_path so that it is relative to the unit + # circle in the same way that it is relative to the desired + # ellipse. + box_path = Path.unit_rectangle() + box_path_transform = transforms.BboxTransformTo(self.axes.bbox) + \ + self.get_transform().inverted() + box_path = box_path.transformed(box_path_transform) + PI = npy.pi TWOPI = PI * 2.0 RAD2DEG = 180.0 / PI This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-13 18:13:46
|
Revision: 4724 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4724&view=rev Author: mdboom Date: 2007-12-13 10:13:04 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Clarify comment. Modified Paths: -------------- branches/transforms/lib/matplotlib/patches.py Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-12-13 18:12:51 UTC (rev 4723) +++ branches/transforms/lib/matplotlib/patches.py 2007-12-13 18:13:04 UTC (rev 4724) @@ -910,8 +910,8 @@ class Arc(Ellipse): """ - An elliptical arc. Because it performs various optimizations, it may not be - filled. + An elliptical arc. Because it performs various optimizations, it + can not be filled. """ def __str__(self): return "Arc(%d,%d;%dx%d)"%(self.center[0],self.center[1],self.width,self.height) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |