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

Skip to content

Commit 5bd8289

Browse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #26509: Update/tweak SpanSelector docs.
1 parent 15ab8b8 commit 5bd8289

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

lib/matplotlib/widgets.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,12 +2548,9 @@ class SpanSelector(_SelectorWidget):
25482548
----------
25492549
ax : `~matplotlib.axes.Axes`
25502550
2551-
onselect : callable
2551+
onselect : callable with signature ``func(min: float, max: float)``
25522552
A callback function that is called after a release event and the
25532553
selection is created, changed or removed.
2554-
It must have the signature::
2555-
2556-
def on_select(min: float, max: float) -> Any
25572554
25582555
direction : {"horizontal", "vertical"}
25592556
The direction along which to draw the span selector.
@@ -2564,22 +2561,14 @@ def on_select(min: float, max: float) -> Any
25642561
25652562
useblit : bool, default: False
25662563
If True, use the backend-dependent blitting features for faster
2567-
canvas updates. See the tutorial :ref:`blitting`
2568-
for details.
2564+
canvas updates. See the tutorial :ref:`blitting` for details.
25692565
2570-
props : dict, optional
2566+
props : dict, default: {'facecolor': 'red', 'alpha': 0.5}
25712567
Dictionary of `matplotlib.patches.Patch` properties.
2572-
Default::
2573-
2574-
dict(facecolor='red', alpha=0.5)
25752568
2576-
onmove_callback : func(min, max), min/max are floats, default: None
2569+
onmove_callback : callable with signature ``func(min: float, max: float)``, optional
25772570
Called on mouse move while the span is being selected.
25782571
2579-
span_stays : bool, default: False
2580-
If True, the span stays visible after the mouse is released.
2581-
Deprecated, use *interactive* instead.
2582-
25832572
interactive : bool, default: False
25842573
Whether to draw a set of handles that allow interaction with the
25852574
widget after it is drawn.
@@ -2593,8 +2582,7 @@ def on_select(min: float, max: float) -> Any
25932582
properties.
25942583
25952584
grab_range : float, default: 10
2596-
Distance in pixels within which the interactive tool handles can be
2597-
activated.
2585+
Distance in pixels within which the interactive tool handles can be activated.
25982586
25992587
state_modifier_keys : dict, optional
26002588
Keyboard modifiers which affect the widget's behavior. Values
@@ -2603,12 +2591,10 @@ def on_select(min: float, max: float) -> Any
26032591
- "clear": Clear the current shape, default: "escape".
26042592
26052593
drag_from_anywhere : bool, default: False
2606-
If `True`, the widget can be moved by clicking anywhere within
2607-
its bounds.
2594+
If `True`, the widget can be moved by clicking anywhere within its bounds.
26082595
26092596
ignore_event_outside : bool, default: False
2610-
If `True`, the event triggered outside the span selector will be
2611-
ignored.
2597+
If `True`, the event triggered outside the span selector will be ignored.
26122598
26132599
snap_values : 1D array-like, optional
26142600
Snap the selector edges to the given values.

0 commit comments

Comments
 (0)