@@ -1449,7 +1449,7 @@ class Cursor(AxesWidget):
1449
1449
1450
1450
Other Parameters
1451
1451
----------------
1452
- **props
1452
+ **lineprops
1453
1453
`.Line2D` properties that control the appearance of the lines.
1454
1454
See also `~.Axes.axhline`.
1455
1455
@@ -1458,9 +1458,8 @@ class Cursor(AxesWidget):
1458
1458
See :doc:`/gallery/widgets/cursor`.
1459
1459
"""
1460
1460
1461
- @_api .rename_parameter ("3.5" , "lineprops" , "props" )
1462
1461
def __init__ (self , ax , horizOn = True , vertOn = True , useblit = False ,
1463
- ** props ):
1462
+ ** lineprops ):
1464
1463
super ().__init__ (ax )
1465
1464
1466
1465
self .connect_event ('motion_notify_event' , self .onmove )
@@ -1472,9 +1471,9 @@ def __init__(self, ax, horizOn=True, vertOn=True, useblit=False,
1472
1471
self .useblit = useblit and self .canvas .supports_blit
1473
1472
1474
1473
if self .useblit :
1475
- props ['animated' ] = True
1476
- self .lineh = ax .axhline (ax .get_ybound ()[0 ], visible = False , ** props )
1477
- self .linev = ax .axvline (ax .get_xbound ()[0 ], visible = False , ** props )
1474
+ lineprops ['animated' ] = True
1475
+ self .lineh = ax .axhline (ax .get_ybound ()[0 ], visible = False , ** lineprops )
1476
+ self .linev = ax .axvline (ax .get_xbound ()[0 ], visible = False , ** lineprops )
1478
1477
1479
1478
self .background = None
1480
1479
self .needclear = False
@@ -1548,9 +1547,8 @@ class MultiCursor(Widget):
1548
1547
plt.show()
1549
1548
1550
1549
"""
1551
- @_api .rename_parameter ("3.5" , "lineprops" , "props" )
1552
1550
def __init__ (self , canvas , axes , useblit = True , horizOn = False , vertOn = True ,
1553
- ** props ):
1551
+ ** lineprops ):
1554
1552
1555
1553
self .canvas = canvas
1556
1554
self .axes = axes
@@ -1568,16 +1566,16 @@ def __init__(self, canvas, axes, useblit=True, horizOn=False, vertOn=True,
1568
1566
self .needclear = False
1569
1567
1570
1568
if self .useblit :
1571
- props ['animated' ] = True
1569
+ lineprops ['animated' ] = True
1572
1570
1573
1571
if vertOn :
1574
- self .vlines = [ax .axvline (xmid , visible = False , ** props )
1572
+ self .vlines = [ax .axvline (xmid , visible = False , ** lineprops )
1575
1573
for ax in axes ]
1576
1574
else :
1577
1575
self .vlines = []
1578
1576
1579
1577
if horizOn :
1580
- self .hlines = [ax .axhline (ymid , visible = False , ** props )
1578
+ self .hlines = [ax .axhline (ymid , visible = False , ** lineprops )
1581
1579
for ax in axes ]
1582
1580
else :
1583
1581
self .hlines = []
@@ -1976,13 +1974,13 @@ def __init__(self, ax, onselect, direction, minspan=0, useblit=False,
1976
1974
self .new_axes (ax )
1977
1975
1978
1976
# Setup handles
1979
- _handle_props = dict ( color = props . get ( 'facecolor' , 'r' ))
1980
- _handle_props . update ( cbook . normalize_kwargs ( handle_props ,
1981
- Line2D ._alias_map ))
1977
+ handle_props = {
1978
+ 'color' : ( props or {}). get ( 'facecolor' , 'r' ) ,
1979
+ ** cbook . normalize_kwargs ( handle_props , Line2D ._alias_map )}
1982
1980
1983
1981
if self ._interactive :
1984
1982
self ._edge_order = ['min' , 'max' ]
1985
- self ._setup_edge_handle (_handle_props )
1983
+ self ._setup_edge_handle (handle_props )
1986
1984
1987
1985
self ._active_handle = None
1988
1986
@@ -2544,29 +2542,25 @@ def __init__(self, ax, onselect, drawtype='box',
2544
2542
2545
2543
self .grab_range = grab_range
2546
2544
2547
- if props is None :
2548
- _handle_props = dict (markeredgecolor = 'black' )
2549
- else :
2550
- _handle_props = dict (
2551
- markeredgecolor = props .get ('edgecolor' , 'black' )
2552
- )
2553
- _handle_props .update (cbook .normalize_kwargs (handle_props ,
2554
- Line2D ._alias_map ))
2545
+ handle_props = {
2546
+ 'markeredgecolor' : (props or {}).get ('edgecolor' , 'black' ),
2547
+ ** cbook .normalize_kwargs (handle_props , Line2D ._alias_map )}
2548
+
2555
2549
self ._corner_order = ['NW' , 'NE' , 'SE' , 'SW' ]
2556
2550
xc , yc = self .corners
2557
2551
self ._corner_handles = ToolHandles (self .ax , xc , yc ,
2558
- marker_props = _handle_props ,
2552
+ marker_props = handle_props ,
2559
2553
useblit = self .useblit )
2560
2554
2561
2555
self ._edge_order = ['W' , 'N' , 'E' , 'S' ]
2562
2556
xe , ye = self .edge_centers
2563
2557
self ._edge_handles = ToolHandles (self .ax , xe , ye , marker = 's' ,
2564
- marker_props = _handle_props ,
2558
+ marker_props = handle_props ,
2565
2559
useblit = self .useblit )
2566
2560
2567
2561
xc , yc = self .center
2568
2562
self ._center_handle = ToolHandles (self .ax , [xc ], [yc ], marker = 's' ,
2569
- marker_props = _handle_props ,
2563
+ marker_props = handle_props ,
2570
2564
useblit = self .useblit )
2571
2565
2572
2566
self ._active_handle = None
0 commit comments