2121from . import (_api , _docstring , backend_tools , cbook , collections , colors ,
2222 text as mtext , ticker , transforms )
2323from .lines import Line2D
24- from .patches import Circle , Rectangle , Ellipse , Polygon
24+ from .patches import Rectangle , Ellipse , Polygon
2525from .transforms import TransformedPatchPath , Affine2D
2626
2727
@@ -355,11 +355,10 @@ class Slider(SliderBase):
355355 Slider value.
356356 """
357357
358- @_api .make_keyword_only ("3.7" , name = "valinit" )
359- def __init__ (self , ax , label , valmin , valmax , valinit = 0.5 , valfmt = None ,
358+ def __init__ (self , ax , label , valmin , valmax , * , valinit = 0.5 , valfmt = None ,
360359 closedmin = True , closedmax = True , slidermin = None ,
361360 slidermax = None , dragging = True , valstep = None ,
362- orientation = 'horizontal' , * , initcolor = 'r' ,
361+ orientation = 'horizontal' , initcolor = 'r' ,
363362 track_color = 'lightgrey' , handle_style = None , ** kwargs ):
364363 """
365364 Parameters
@@ -627,13 +626,13 @@ class RangeSlider(SliderBase):
627626 Slider value.
628627 """
629628
630- @_api .make_keyword_only ("3.7" , name = "valinit" )
631629 def __init__ (
632630 self ,
633631 ax ,
634632 label ,
635633 valmin ,
636634 valmax ,
635+ * ,
637636 valinit = None ,
638637 valfmt = None ,
639638 closedmin = True ,
@@ -1283,60 +1282,6 @@ def disconnect(self, cid):
12831282 """Remove the observer with connection id *cid*."""
12841283 self ._observers .disconnect (cid )
12851284
1286- @_api .deprecated ("3.7" ,
1287- addendum = "Any custom property styling may be lost." )
1288- @property
1289- def rectangles (self ):
1290- if not hasattr (self , "_rectangles" ):
1291- ys = np .linspace (1 , 0 , len (self .labels )+ 2 )[1 :- 1 ]
1292- dy = 1. / (len (self .labels ) + 1 )
1293- w , h = dy / 2 , dy / 2
1294- rectangles = self ._rectangles = [
1295- Rectangle (xy = (0.05 , ys [i ] - h / 2 ), width = w , height = h ,
1296- edgecolor = "black" ,
1297- facecolor = "none" ,
1298- transform = self .ax .transAxes
1299- )
1300- for i , y in enumerate (ys )
1301- ]
1302- self ._frames .set_visible (False )
1303- for rectangle in rectangles :
1304- self .ax .add_patch (rectangle )
1305- if not hasattr (self , "_lines" ):
1306- with _api .suppress_matplotlib_deprecation_warning ():
1307- _ = self .lines
1308- return self ._rectangles
1309-
1310- @_api .deprecated ("3.7" ,
1311- addendum = "Any custom property styling may be lost." )
1312- @property
1313- def lines (self ):
1314- if not hasattr (self , "_lines" ):
1315- ys = np .linspace (1 , 0 , len (self .labels )+ 2 )[1 :- 1 ]
1316- self ._checks .set_visible (False )
1317- dy = 1. / (len (self .labels ) + 1 )
1318- w , h = dy / 2 , dy / 2
1319- self ._lines = []
1320- current_status = self .get_status ()
1321- lineparams = {'color' : 'k' , 'linewidth' : 1.25 ,
1322- 'transform' : self .ax .transAxes ,
1323- 'solid_capstyle' : 'butt' ,
1324- 'animated' : self ._useblit }
1325- for i , y in enumerate (ys ):
1326- x , y = 0.05 , y - h / 2
1327- l1 = Line2D ([x , x + w ], [y + h , y ], ** lineparams )
1328- l2 = Line2D ([x , x + w ], [y , y + h ], ** lineparams )
1329-
1330- l1 .set_visible (current_status [i ])
1331- l2 .set_visible (current_status [i ])
1332- self ._lines .append ((l1 , l2 ))
1333- self .ax .add_line (l1 )
1334- self .ax .add_line (l2 )
1335- if not hasattr (self , "_rectangles" ):
1336- with _api .suppress_matplotlib_deprecation_warning ():
1337- _ = self .rectangles
1338- return self ._lines
1339-
13401285
13411286class TextBox (AxesWidget ):
13421287 """
@@ -1361,8 +1306,7 @@ class TextBox(AxesWidget):
13611306 The color of the text box when hovering.
13621307 """
13631308
1364- @_api .make_keyword_only ("3.7" , name = "color" )
1365- def __init__ (self , ax , label , initial = '' ,
1309+ def __init__ (self , ax , label , initial = '' , * ,
13661310 color = '.95' , hovercolor = '1' , label_pad = .01 ,
13671311 textalignment = "left" ):
13681312 """
@@ -1513,8 +1457,7 @@ def set_val(self, val):
15131457 self ._observers .process ('change' , self .text )
15141458 self ._observers .process ('submit' , self .text )
15151459
1516- @_api .delete_parameter ("3.7" , "x" )
1517- def begin_typing (self , x = None ):
1460+ def begin_typing (self ):
15181461 self .capturekeystrokes = True
15191462 # Disable keypress shortcuts, which may otherwise cause the figure to
15201463 # be saved, closed, etc., until the user stops typing. The way to
@@ -1856,23 +1799,6 @@ def disconnect(self, cid):
18561799 """Remove the observer with connection id *cid*."""
18571800 self ._observers .disconnect (cid )
18581801
1859- @_api .deprecated ("3.7" ,
1860- addendum = "Any custom property styling may be lost." )
1861- @property
1862- def circles (self ):
1863- if not hasattr (self , "_circles" ):
1864- radius = min (.5 / (len (self .labels ) + 1 ) - .01 , .05 )
1865- circles = self ._circles = [
1866- Circle (xy = self ._buttons .get_offsets ()[i ], edgecolor = "black" ,
1867- facecolor = self ._buttons .get_facecolor ()[i ],
1868- radius = radius , transform = self .ax .transAxes ,
1869- animated = self ._useblit )
1870- for i in range (len (self .labels ))]
1871- self ._buttons .set_visible (False )
1872- for circle in circles :
1873- self .ax .add_patch (circle )
1874- return self ._circles
1875-
18761802
18771803class SubplotTool (Widget ):
18781804 """
@@ -1974,8 +1900,7 @@ class Cursor(AxesWidget):
19741900 --------
19751901 See :doc:`/gallery/widgets/cursor`.
19761902 """
1977- @_api .make_keyword_only ("3.7" , "horizOn" )
1978- def __init__ (self , ax , horizOn = True , vertOn = True , useblit = False ,
1903+ def __init__ (self , ax , * , horizOn = True , vertOn = True , useblit = False ,
19791904 ** lineprops ):
19801905 super ().__init__ (ax )
19811906
@@ -2109,8 +2034,6 @@ def __init__(self, canvas, axes, *, useblit=True, horizOn=False, vertOn=True,
21092034
21102035 self .connect ()
21112036
2112- needclear = _api .deprecated ("3.7" )(lambda self : False )
2113-
21142037 def connect (self ):
21152038 """Connect events."""
21162039 for canvas , info in self ._canvas_infos .items ():
@@ -2613,8 +2536,7 @@ class SpanSelector(_SelectorWidget):
26132536 See also: :doc:`/gallery/widgets/span_selector`
26142537 """
26152538
2616- @_api .make_keyword_only ("3.7" , name = "minspan" )
2617- def __init__ (self , ax , onselect , direction , minspan = 0 , useblit = False ,
2539+ def __init__ (self , ax , onselect , direction , * , minspan = 0 , useblit = False ,
26182540 props = None , onmove_callback = None , interactive = False ,
26192541 button = None , handle_props = None , grab_range = 10 ,
26202542 state_modifier_keys = None , drag_from_anywhere = False ,
@@ -2957,8 +2879,7 @@ class ToolLineHandles:
29572879 for details.
29582880 """
29592881
2960- @_api .make_keyword_only ("3.7" , "line_props" )
2961- def __init__ (self , ax , positions , direction , line_props = None ,
2882+ def __init__ (self , ax , positions , direction , * , line_props = None ,
29622883 useblit = True ):
29632884 self .ax = ax
29642885
@@ -3068,8 +2989,7 @@ class ToolHandles:
30682989 for details.
30692990 """
30702991
3071- @_api .make_keyword_only ("3.7" , "marker" )
3072- def __init__ (self , ax , x , y , marker = 'o' , marker_props = None , useblit = True ):
2992+ def __init__ (self , ax , x , y , * , marker = 'o' , marker_props = None , useblit = True ):
30732993 self .ax = ax
30742994 props = {'marker' : marker , 'markersize' : 7 , 'markerfacecolor' : 'w' ,
30752995 'linestyle' : 'none' , 'alpha' : 0.5 , 'visible' : False ,
@@ -3771,8 +3691,7 @@ def onselect(verts):
37713691 which corresponds to all buttons.
37723692 """
37733693
3774- @_api .make_keyword_only ("3.7" , name = "useblit" )
3775- def __init__ (self , ax , onselect , useblit = True , props = None , button = None ):
3694+ def __init__ (self , ax , onselect , * , useblit = True , props = None , button = None ):
37763695 super ().__init__ (ax , onselect , useblit = useblit , button = button )
37773696 self .verts = None
37783697 props = {
@@ -3882,9 +3801,8 @@ class PolygonSelector(_SelectorWidget):
38823801 point.
38833802 """
38843803
3885- @_api .make_keyword_only ("3.7" , name = "useblit" )
3886- def __init__ (self , ax , onselect , useblit = False ,
3887- props = None , handle_props = None , grab_range = 10 , * ,
3804+ def __init__ (self , ax , onselect , * , useblit = False ,
3805+ props = None , handle_props = None , grab_range = 10 ,
38883806 draw_bounding_box = False , box_handle_props = None ,
38893807 box_props = None ):
38903808 # The state modifiers 'move', 'square', and 'center' are expected by
@@ -4199,8 +4117,7 @@ class Lasso(AxesWidget):
41994117 for details.
42004118 """
42014119
4202- @_api .make_keyword_only ("3.7" , name = "useblit" )
4203- def __init__ (self , ax , xy , callback , useblit = True ):
4120+ def __init__ (self , ax , xy , callback , * , useblit = True ):
42044121 super ().__init__ (ax )
42054122
42064123 self .useblit = useblit and self .canvas .supports_blit
0 commit comments