@@ -806,6 +806,25 @@ def get_xy(self):
806806 """Return the left and bottom coords of the rectangle as a tuple."""
807807 return self ._x0 , self ._y0
808808
809+ def get_edge_midpoints (self ):
810+ """
811+ Return midpoints of the edges of the rectangle, moving clockwise from
812+ the center of the left-hand edge.
813+ """
814+ return self .get_patch_transform ().transform (
815+ [(0 , 0.5 ), (0.5 , 1 ), (1 , 0.5 ), (0.5 , 0 )])
816+
817+ def get_corners (self ):
818+ """
819+ Return the corners of the rectangle, moving clockwise from (x0, y0).
820+ """
821+ return self .get_patch_transform ().transform (
822+ [(0 , 0 ), (1 , 0 ), (1 , 1 ), (0 , 1 )])
823+
824+ def get_center (self ):
825+ """Return the centre of the rectangle."""
826+ return self .get_patch_transform ().transform ((0.5 , 0.5 ))
827+
809828 def get_width (self ):
810829 """Return the width of the rectangle."""
811830 return self ._width
@@ -1657,6 +1676,22 @@ def get_angle(self):
16571676
16581677 angle = property (get_angle , set_angle )
16591678
1679+ def get_corners (self ):
1680+ """
1681+ Return the corners of the ellipse bounding box, moving clockwise from
1682+ the lower left.
1683+ """
1684+ return self .get_patch_transform ().transform (
1685+ [(- 1 , - 1 ), (1 , - 1 ), (1 , 1 ), (- 1 , 1 )])
1686+
1687+ def get_edge_midpoints (self ):
1688+ """
1689+ Return the edge midpoints of the ellipse bounding box, moving clockwise
1690+ from the left hand edge.
1691+ """
1692+ return self .get_patch_transform ().transform (
1693+ [(- 1 , 0 ), (0 , 1 ), (1 , 0 ), (0 , - 1 )])
1694+
16601695
16611696class Annulus (Patch ):
16621697 """
0 commit comments