@@ -722,13 +722,6 @@ def __init__(self, xy, width, height, *,
722
722
self ._height = height
723
723
self .angle = float (angle )
724
724
self .rotation_point = rotation_point
725
- # Required for RectangleSelector with axes aspect ratio != 1
726
- # The patch is defined in data coordinates and when changing the
727
- # selector with square modifier and not in data coordinates, we need
728
- # to correct for the aspect ratio difference between the data and
729
- # display coordinate systems. Its value is typically provide by
730
- # Axes._get_aspect_ratio()
731
- self ._aspect_ratio_correction = 1.0
732
725
self ._convert_units () # Validate the inputs.
733
726
734
727
def get_path (self ):
@@ -756,13 +749,11 @@ def get_patch_transform(self):
756
749
rotation_point = bbox .x0 , bbox .y0
757
750
else :
758
751
rotation_point = self .rotation_point
759
- return transforms .BboxTransformTo (bbox ) \
760
- + transforms .Affine2D () \
761
- .translate (- rotation_point [0 ], - rotation_point [1 ]) \
762
- .scale (1 , self ._aspect_ratio_correction ) \
763
- .rotate_deg (self .angle ) \
764
- .scale (1 , 1 / self ._aspect_ratio_correction ) \
765
- .translate (* rotation_point )
752
+ return (transforms .BboxTransformTo (bbox ) +
753
+ transforms .Affine2D ()
754
+ .translate (- rotation_point [0 ], - rotation_point [1 ])
755
+ .rotate_deg (self .angle )
756
+ .translate (* rotation_point ))
766
757
767
758
@property
768
759
def rotation_point (self ):
@@ -1553,12 +1544,6 @@ def __init__(self, xy, width, height, *, angle=0, **kwargs):
1553
1544
self ._width , self ._height = width , height
1554
1545
self ._angle = angle
1555
1546
self ._path = Path .unit_circle ()
1556
- # Required for EllipseSelector with axes aspect ratio != 1
1557
- # The patch is defined in data coordinates and when changing the
1558
- # selector with square modifier and not in data coordinates, we need
1559
- # to correct for the aspect ratio difference between the data and
1560
- # display coordinate systems.
1561
- self ._aspect_ratio_correction = 1.0
1562
1547
# Note: This cannot be calculated until this is added to an Axes
1563
1548
self ._patch_transform = transforms .IdentityTransform ()
1564
1549
@@ -1576,9 +1561,8 @@ def _recompute_transform(self):
1576
1561
width = self .convert_xunits (self ._width )
1577
1562
height = self .convert_yunits (self ._height )
1578
1563
self ._patch_transform = transforms .Affine2D () \
1579
- .scale (width * 0.5 , height * 0.5 * self . _aspect_ratio_correction ) \
1564
+ .scale (width * 0.5 , height * 0.5 ) \
1580
1565
.rotate_deg (self .angle ) \
1581
- .scale (1 , 1 / self ._aspect_ratio_correction ) \
1582
1566
.translate (* center )
1583
1567
1584
1568
def get_path (self ):
0 commit comments