Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4507d65

Browse files
committed
Re-add the xy attribute to the Rectangle class (disappeared during the transforms refactor).
svn path=/trunk/matplotlib/; revision=6366
1 parent 21a9392 commit 4507d65

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

lib/matplotlib/patches.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ def get_y(self):
478478
"Return the bottom coord of the rectangle"
479479
return self._y
480480

481+
def get_xy(self):
482+
"Return the left and bottom coords of the rectangle"
483+
return self._x, self._y
484+
481485
def get_width(self):
482486
"Return the width of the rectangle"
483487
return self._width
@@ -502,6 +506,14 @@ def set_y(self, y):
502506
"""
503507
self._y = y
504508

509+
def set_xy(self, xy):
510+
"""
511+
Set the left and bottom coords of the rectangle
512+
513+
ACCEPTS: 2-item sequence
514+
"""
515+
self._x, self._y = xy
516+
505517
def set_width(self, w):
506518
"""
507519
Set the width rectangle
@@ -536,6 +548,8 @@ def set_bounds(self, *args):
536548
def get_bbox(self):
537549
return transforms.Bbox.from_bounds(self._x, self._y, self._width, self._height)
538550

551+
xy = property(get_xy, set_xy)
552+
539553
class RegularPolygon(Patch):
540554
"""
541555
A regular polygon patch.

0 commit comments

Comments
 (0)