@@ -1745,9 +1745,9 @@ def __init__(self, widths, heights, angles, *, units='points', **kwargs):
17451745 Forwarded to `Collection`.
17461746 """
17471747 super ().__init__ (** kwargs )
1748- self ._widths = 0.5 * np . asarray (widths ). ravel ( )
1749- self ._heights = 0.5 * np . asarray (heights ). ravel ( )
1750- self ._angles = np . deg2rad (angles ). ravel ( )
1748+ self .set_widths (widths )
1749+ self .set_heights (heights )
1750+ self .set_angles (angles )
17511751 self ._units = units
17521752 self .set_transform (transforms .IdentityTransform ())
17531753 self ._transforms = np .empty ((0 , 3 , 3 ))
@@ -1795,6 +1795,33 @@ def _set_transforms(self):
17951795 m [:2 , 2 :] = 0
17961796 self .set_transform (_affine (m ))
17971797
1798+ def set_widths (self , widths ):
1799+ """Set the lengths of the first axes (e.g., major axis)."""
1800+ self ._widths = 0.5 * np .asarray (widths ).ravel ()
1801+ self .stale = True
1802+
1803+ def set_heights (self , heights ):
1804+ """Set the lengths of second axes (e.g., minor axes)."""
1805+ self ._heights = 0.5 * np .asarray (heights ).ravel ()
1806+ self .stale = True
1807+
1808+ def set_angles (self , angles ):
1809+ """Set the angles of the first axes, degrees CCW from the x-axis."""
1810+ self ._angles = np .deg2rad (angles ).ravel ()
1811+ self .stale = True
1812+
1813+ def get_widths (self ):
1814+ """Get the lengths of the first axes (e.g., major axis)."""
1815+ return self ._widths * 2
1816+
1817+ def get_heights (self ):
1818+ """Set the lengths of second axes (e.g., minor axes)."""
1819+ return self ._heights * 2
1820+
1821+ def get_angles (self ):
1822+ """Get the angles of the first axes, degrees CCW from the x-axis."""
1823+ return np .rad2deg (self ._angles )
1824+
17981825 @artist .allow_rasterization
17991826 def draw (self , renderer ):
18001827 self ._set_transforms ()
0 commit comments