8000 Changed Ellipse.xy to _center · matplotlib/matplotlib@134a0b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 134a0b6

Browse files
committed
Changed Ellipse.xy to _center
1 parent 82e09ce commit 134a0b6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/matplotlib/patches.py

Lines 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