Skip to content

Commit 00444e4

Browse files
committed
Fix indentation docstring, update API changes and update SpanSelector example
1 parent 4d3abfc commit 00444e4

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed
Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1+
Unification of Selector API
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
The API for Selector widgets has been unified to use
4+
5+
- *props* for the properties of the Artist representing the selection.
6+
- *handle_props* for the Artists representing handles for modifying the selection.
7+
- *grab_range* for the maximal tolerance to grab a handle with the mouse.
8+
9+
This affects the following parameters and attributes:
10+
11+
112
RectangleSelector and EllipseSelector
2-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
314
The *maxdist* argument is deprecated, use *grab_range* instead.
15+
The *rectprops* argument is deprecated, use *props* instead.
416
The *marker_props* argument is deprecated, use *handle_props* instead.
517

618
PolygonSelector
7-
~~~~~~~~~~~~~~~
8-
The *vertex_select_radius* argument is deprecated, use *grab_range* instead.
19+
^^^^^^^^^^^^^^^
20+
The *vertex_select_radius* argument and attribute is deprecated, use *grab_range* instead.
21+
The *lineprops* argument is deprecated, use *props* instead.
922
The *markerprops* argument is deprecated, use *handle_props* instead.
23+
The *maxdist* argument and attribute is deprecated, use *grab_range* instead.
24+
25+
SpanSelector
26+
^^^^^^^^^^^^
27+
The *rectprops* argument is deprecated, use *props* instead.
28+
The *maxdist* argument and attribute is deprecated, use *grab_range* instead.
29+
30+
LassoSelector
31+
^^^^^^^^^^^^^
32+
The *lineprops* argument is deprecated, use *props* instead.

examples/widgets/span_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def onselect(xmin, xmax):
5353
onselect,
5454
"horizontal",
5555
useblit=True,
56-
rectprops=dict(alpha=0.5, facecolor="tab:blue"),
56+
props=dict(alpha=0.5, facecolor="tab:blue"),
5757
interactive=True,
5858
drag_from_anywhere=True
5959
)

lib/matplotlib/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ def onselect(eclick: MouseEvent, erelease: MouseEvent)
25422542
`matplotlib.patches.Patch` for valid properties.
25432543
Default:
25442544
2545-
``dict(facecolor='red', edgecolor='black', alpha=0.2, fill=True)``
2545+
``dict(facecolor='red', edgecolor='black', alpha=0.2, fill=True)``
25462546
25472547
spancoords : {"data", "pixels"}, default: "data"
25482548
Whether to interpret *minspanx* and *minspany* in data or in pixel

0 commit comments

Comments
 (0)