@@ -766,13 +766,6 @@ def __init__(self, xy, width, height, *,
766
766
self ._height = height
767
767
self .angle = float (angle )
768
768
self .rotation_point = rotation_point
769
- # Required for RectangleSelector with axes aspect ratio != 1
770
- # The patch is defined in data coordinates and when changing the
771
- # selector with square modifier and not in data coordinates, we need
772
- # to correct for the aspect ratio difference between the data and
773
- # display coordinate systems. Its value is typically provide by
774
- # Axes._get_aspect_ratio()
775
- self ._aspect_ratio_correction = 1.0
776
769
self ._convert_units () # Validate the inputs.
777
770
778
771
def get_path (self ):
@@ -800,13 +793,11 @@ def get_patch_transform(self):
800
793
rotation_point = bbox .x0 , bbox .y0
801
794
else :
802
795
rotation_point = self .rotation_point
803
- return transforms .BboxTransformTo (bbox ) \
804
- + transforms .Affine2D () \
805
- .translate (- rotation_point [0 ], - rotation_point [1 ]) \
806
- .scale (1 , self ._aspect_ratio_correction ) \
807
- .rotate_deg (self .angle ) \
808
- .scale (1 , 1 / self ._aspect_ratio_correction ) \
809
- .translate (* rotation_point )
796
+ return (transforms .BboxTransformTo (bbox ) +
797
+ transforms .Affine2D ()
798
+ .translate (- rotation_point [0 ], - rotation_point [1 ])
799
+ .rotate_deg (self .angle )
800
+ .translate (* rotation_point ))
810
801
811
802
@property
812
803
def rotation_point (self ):
@@ -1625,12 +1616,6 @@ def __init__(self, xy, width, height, *, angle=0, **kwargs):
1625
1616
self ._width , self ._height = width , height
1626
1617
self ._angle = angle
1627
1618
self ._path = Path .unit_circle ()
1628
- # Required for EllipseSelector with axes aspect ratio != 1
1629
- # The patch is defined in data coordinates and when changing the
1630
- # selector with square modifier and not in data coordinates, we need
1631
- # to correct for the aspect ratio difference between the data and
1632
- # display coordinate systems.
1633
- self ._aspect_ratio_correction = 1.0
1634
1619
# Note: This cannot be calculated until this is added to an Axes
1635
1620
self ._patch_transform = transforms .IdentityTransform ()
1636
1621
@@ -1648,9 +1633,8 @@ def _recompute_transform(self):
1648
1633
width = self .convert_xunits (self ._width )
1649
1634
height = self .convert_yunits (self ._height )
1650
1635
self ._patch_transform = transforms .Affine2D () \
1651
- .scale (width * 0.5 , height * 0.5 * self . _aspect_ratio_correction ) \
1636
+ .scale (width * 0.5 , height * 0.5 ) \
1652
1637
.rotate_deg (self .angle ) \
1653
- .scale (1 , 1 / self ._aspect_ratio_correction ) \
1654
1638
.translate (* center )
1655
1639
1656
1640
def get_path (self ):
0 commit comments