8000 Rename recently introduced parameters in SpanSelector · matplotlib/matplotlib@8bb01f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bb01f4

Browse files
committed
Rename recently introduced parameters in SpanSelector
1 parent 070e093 commit 8bb01f4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/matplotlib/widgets.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,19 +1948,19 @@ class SpanSelector(_SelectorWidget):
19481948
Whether to draw a set of handles that allow interaction with the
19491949
widget after it is drawn.
19501950
1951-
button : `.MouseButton` or list of `.MouseButton`
1951+
button : `.MouseButton` or list of `.MouseButton`, default: all buttons
19521952
The mouse buttons which activate the span selector.
19531953
1954-
line_props : dict, default: None
1955-
Line properties with which the interactive line are drawn. Only used
1956-
when *interactive* is True. See `matplotlib.lines.Line2D` for details
1957-
on valid properties.
1954+
handle_props : dict, default: None
1955+
Properties of the handle lines at the edges of the span. Only used
1956+
when *interactive* is True. See `~matplotlib.lines.Line2D` for valid
1957+
properties.
19581958
1959-
maxdist : float, default: 10
1959+
handle_grab_distance : float, default: 10
19601960
Distance in pixels within which the interactive tool handles can be
19611961
activated.
19621962
1963-
drag_from_anywhere : bool, optional
1963+
drag_from_anywhere : bool, default: False
19641964
If `True`, the widget can be moved by clicking anywhere within
19651965
its bounds.
19661966
@@ -1983,7 +1983,7 @@ class SpanSelector(_SelectorWidget):
19831983
@_api.rename_parameter("3.5", "span_stays", "interactive")
19841984
def __init__(self, ax, onselect, direction, minspan=0, useblit=False,
19851985
rectprops=None, onmove_callback=None, interactive=False,
1986-
button=None, line_props=None, maxdist=10,
1986+
button=None, handle_props=None, handle_grab_distance=10,
19871987
drag_from_anywhere=False):
19881988

19891989
super().__init__(ax, onselect, useblit=useblit, button=button)
@@ -2007,7 +2007,7 @@ def __init__(self, ax, onselect, direction, minspan=0, useblit=False,
20072007
self.onmove_callback = onmove_callback
20082008
self.minspan = minspan
20092009

2010-
self.maxdist = maxdist
2010+
self.handle_grab_distance = handle_grab_distance
20112011
self._interactive = interactive
20122012
self.drag_from_anywhere = drag_from_anywhere
20132013

@@ -2018,7 +2018,7 @@ def __init__(self, ax, onselect, direction, minspan=0, useblit=False,
20182018

20192019
# Setup handles
20202020
props = dict(color=rectprops.get('facecolor', 'r'))
2021-
props.update(cbook.normalize_kwargs(line_props, Line2D._alias_map))
2021+
props.update(cbook.normalize_kwargs(handle_props, Line2D._alias_map))
20222022

20232023
if self._interactive:
20242024
self._edge_order = ['min', 'max']
@@ -2211,7 +2211,7 @@ def _set_active_handle(self, event):
22112211
# Use 'C' to match the notation used in the RectangleSelector
22122212
if 'move' in self.state:
22132213
self._active_handle = 'C'
2214-
elif e_dist > self.maxdist:
2214+
elif e_dist > self.handle_grab_distance:
22152215
# Not close to any handles
22162216
self._active_handle = None
22172217
if self.drag_from_anywhere and self._contains(event):

0 commit comments

Comments
 (0)
0