@@ -1751,7 +1751,7 @@ def __init__(self, widths, heights, angles, *, units='points', **kwargs):
1751
1751
self ._widths = 0.5 * np .asarray (widths ).ravel ()
1752
1752
self ._heights = 0.5 * np .asarray (heights ).ravel ()
1753
1753
self ._angles = np .deg2rad (angles ).ravel ()
1754
- self ._units = units
1754
+ self ._length_units = units
1755
1755
self .set_transform (transforms .IdentityTransform ())
1756
1756
self ._transforms = np .empty ((0 , 3 , 3 ))
1757
1757
self ._paths = [mpath .Path .unit_circle ()]
@@ -1762,24 +1762,24 @@ def _set_transforms(self):
1762
1762
ax = self .axes
1763
1763
fig = self .figure
1764
1764
1765
- if self ._units == 'xy' :
1765
+ if self ._length_units == 'xy' :
1766
1766
sc = 1
1767
- elif self ._units == 'x' :
1767
+ elif self ._length_units == 'x' :
1768
1768
sc = ax .bbox .width / ax .viewLim .width
1769
- elif self ._units == 'y' :
1769
+ elif self ._length_units == 'y' :
1770
1770
sc = ax .bbox .height / ax .viewLim .height
1771
- elif self ._units == 'inches' :
1771
+ elif self ._length_units == 'inches' :
1772
1772
sc = fig .dpi
1773
- elif self ._units == 'points' :
1773
+ elif self ._length_units == 'points' :
1774
1774
sc = fig .dpi / 72.0
1775
- elif self ._units == 'width' :
1775
+ elif self ._length_units == 'width' :
1776
1776
sc = ax .bbox .width
1777
- elif self ._units == 'height' :
1777
+ elif self ._length_units == 'height' :
1778
1778
sc = ax .bbox .height
1779
- elif self ._units == 'dots' :
1779
+ elif self ._length_units == 'dots' :
1780
1780
sc = 1.0
1781
1781
else :
1782
- raise ValueError (f'Unrecognized units: { self ._units !r} ' )
1782
+ raise ValueError (f'Unrecognized units: { self ._length_units !r} ' )
1783
1783
1784
1784
self ._transforms = np .zeros ((len (self ._widths ), 3 , 3 ))
1785
1785
widths = self ._widths * sc
@@ -1793,7 +1793,7 @@ def _set_transforms(self):
1793
1793
self ._transforms [:, 2 , 2 ] = 1.0
1794
1794
1795
1795
_affine = transforms .Affine2D
1796
- if self ._units == 'xy' :
1796
+ if self ._length_units == 'xy' :
1797
1797
m = ax .transData .get_affine ().get_matrix ().copy ()
1798
1798
m [:2 , 2 :] = 0
1799
1799
self .set_transform (_affine (m ))
0 commit comments