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

Skip to content

Commit cc8c959

Browse files
committed
Change Rectangle._angle to Rectangle.angle
1 parent 45e4a46 commit cc8c959

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/matplotlib/patches.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def draw(self, renderer):
652652
class Rectangle(Patch):
653653
"""
654654
Draw a rectangle with lower left at *xy* = (*x*, *y*) with
655-
specified *width* and *height*.
655+
specified *width*, *height* and rotation *angle*.
656656
"""
657657

658658
def __str__(self):
@@ -678,7 +678,7 @@ def __init__(self, xy, width, height, angle=0.0, **kwargs):
678678
self._y = float(xy[1])
679679
self._width = float(width)
680680
self._height = float(height)
681-
self._angle = float(angle)
681+
self.angle = float(angle)
682682
# Note: This cannot be calculated until this is added to an Axes
683683
self._rect_transform = transforms.IdentityTransform()
684684

@@ -700,7 +700,7 @@ def _update_patch_transform(self):
700700
height = self.convert_yunits(self._height)
701701
bbox = transforms.Bbox.from_bounds(x, y, width, height)
702702
rot_trans = transforms.Affine2D()
703-
rot_trans.rotate_deg_around(x, y, self._angle)
703+
rot_trans.rotate_deg_around(x, y, self.angle)
704704
self._rect_transform = transforms.BboxTransformTo(bbox)
705705
self._rect_transform += rot_trans
706706

0 commit comments

Comments
 (0)