Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 134a0b6

Browse filesBrowse files
committed
Changed Ellipse.xy to _center
1 parent 82e09ce commit 134a0b6
Copy full SHA for 134a0b6

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed

‎lib/matplotlib/patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/patches.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ class Ellipse(Patch):
14141414
A scale-free ellipse.
14151415
"""
14161416
def __str__(self):
1417-
pars = (self.xy[0], self.xy[1],
1417+
pars = (self._center[0], self._center[1],
14181418
self.width, self.height, self.angle)
14191419
fmt = "Ellipse(xy=(%s, %s), width=%s, height=%s, angle=%s)"
14201420
return fmt % pars
@@ -1439,7 +1439,7 @@ def __init__(self, xy, width, height, angle=0.0, **kwargs):
14391439
"""
14401440
Patch.__init__(self, **kwargs)
14411441

1442-
self.xy = xy
1442+
self._center = xy
14431443
self.width, self.height = width, height
14441444
self.angle = angle
14451445
self._path = Path.unit_circle()
@@ -1452,8 +1452,8 @@ def _recompute_transform(self):
14521452
makes it very important to call the accessor method and
14531453
not directly access the transformation member variable.
14541454
"""
1455-
center = (self.convert_xunits(self.xy[0]),
1456-
self.convert_yunits(self.xy[1]))
1455+
center = (self.convert_xunits(self._center[0]),
1456+
self.convert_yunits(self._center[1]))
14571457
width = self.convert_xunits(self.width)
14581458
height = self.convert_yunits(self.height)
14591459
self._patch_transform = transforms.Affine2D() \
@@ -1477,14 +1477,14 @@ def set_center(self, xy):
14771477
14781478
ACCEPTS: (x, y)
14791479
"""
1480-
self.xy = xy
1480+
self._center = xy
14811481
self.stale = True
14821482

14831483
def get_center(self):
14841484
"""
14851485
Return the center of the ellipse
14861486
"""
1487-
return self.xy
1487+
return self._center
14881488

14891489
center = property(get_center, set_center)
14901490

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.