Skip to content

Commit 6f49939

Browse files
committed
Add angle setters/getters to Rectangle
1 parent d195747 commit 6f49939

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/patches.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,10 @@ def get_height(self):
799799
"""Return the height of the rectangle."""
800800
return self._height
801801

802+
def get_angle(self):
803+
"""Get the rotation angle in degrees."""
804+
return self.angle
805+
802806
def set_x(self, x):
803807
"""Set the left coordinate of the rectangle."""
804808
self._x0 = x
@@ -809,6 +813,15 @@ def set_y(self, y):
809813
self._y0 = y
810814
self.stale = True
811815

816+
def set_angle(self, angle):
817+
"""
818+
Set the rotation angle in degrees.
819+
820+
The rotation is performed anti-clockwise around *xy*.
821+
"""
822+
self.angle = angle
823+
self.stale = True
824+
812825
def set_xy(self, xy):
813826
"""
814827
Set the left and bottom coordinates of the rectangle.

0 commit comments

Comments
 (0)