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

Skip to content

Commit 7c83ecc

Browse files
committed
Rename path property to geometry and return consistent results.
1 parent f52efc1 commit 7c83ecc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/widgets.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,8 +1895,14 @@ def _set_active_handle(self, event):
18951895
self._extents_on_press = x1, x2, y1, y2
18961896

18971897
@property
1898-
def path(self):
1899-
return self.to_draw.get_path()
1898+
def geometry(self):
1899+
if hasattr(self.to_draw, 'get_verts'):
1900+
xfm = self.ax.transData.inverted()
1901+
y, x = xfm.transform(self.to_draw.get_verts()).T
1902+
return np.array([x[:-1], y[:-1]])
1903+
else:
1904+
return np.array(self.to_draw.get_data())
1905+
19001906

19011907

19021908
class EllipseSelector(RectangleSelector):

0 commit comments

Comments
 (0)