File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1845,6 +1845,13 @@ def draw_shape(self, extents):
1845
1845
x0 , x1 , y0 , y1 = extents
1846
1846
xmin , xmax = sorted ([x0 , x1 ])
1847
1847
ymin , ymax = sorted ([y0 , y1 ])
1848
+ xlim = self .ax .get_xlim ()
1849
+ ylim = self .ax .get_ylim ()
1850
+
1851
+ xmin = max (xlim [0 ], xmin )
1852
+ ymin = max (ylim [0 ], ymin )
1853
+ xmax = min (xmax , xlim [1 ])
1854
+ ymax = min (ymax , ylim [1 ])
1848
1855
1849
1856
if self .drawtype == 'patch' :
1850
1857
self .to_draw .set_x (xmin )
@@ -1887,6 +1894,10 @@ def _set_active_handle(self, event):
1887
1894
y1 , y2 = y2 , event .ydata
1888
1895
self ._extents_on_press = x1 , x2 , y1 , y2
1889
1896
1897
+ @property
1898
+ def path (self ):
1899
+ return self .to_draw .get_path ()
1900
+
1890
1901
1891
1902
class EllipseSelector (RectangleSelector ):
1892
1903
You can’t perform that action at this time.
0 commit comments