Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf97e5f5

Browse files
committed
Make most arguments to Patch classes keyword only
1 parent072702b commitf97e5f5

File tree

1 file changed

+20
-33
lines changed

1 file changed

+20
-33
lines changed

‎lib/matplotlib/patches.py

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ class Patch(artist.Artist):
4545
# subclass-by-subclass basis.
4646
_edge_default=False
4747

48-
@_api.make_keyword_only("3.6",name="edgecolor")
49-
def__init__(self,
48+
def__init__(self,*,
5049
edgecolor=None,
5150
facecolor=None,
5251
color=None,
@@ -687,9 +686,8 @@ def __str__(self):
687686
returnfmt%pars
688687

689688
@_docstring.dedent_interpd
690-
@_api.make_keyword_only("3.6",name="angle")
691-
def__init__(self,xy,width,height,angle=0.0,*,
692-
rotation_point='xy',**kwargs):
689+
def__init__(self,xy,width,height,*,
690+
angle=0.0,rotation_point='xy',**kwargs):
693691
"""
694692
Parameters
695693
----------
@@ -890,9 +888,8 @@ def __str__(self):
890888
self.orientation)
891889

892890
@_docstring.dedent_interpd
893-
@_api.make_keyword_only("3.6",name="radius")
894-
def__init__(self,xy,numVertices,radius=5,orientation=0,
895-
**kwargs):
891+
def__init__(self,xy,numVertices,*,
892+
radius=5,orientation=0,**kwargs):
896893
"""
897894
Parameters
898895
----------
@@ -1078,8 +1075,7 @@ def __str__(self):
10781075
return"Polygon0()"
10791076

10801077
@_docstring.dedent_interpd
1081-
@_api.make_keyword_only("3.6",name="closed")
1082-
def__init__(self,xy,closed=True,**kwargs):
1078+
def__init__(self,xy,*,closed=True,**kwargs):
10831079
"""
10841080
*xy* is a numpy array with shape Nx2.
10851081
@@ -1175,8 +1171,7 @@ def __str__(self):
11751171
returnfmt%pars
11761172

11771173
@_docstring.dedent_interpd
1178-
@_api.make_keyword_only("3.6",name="width")
1179-
def__init__(self,center,r,theta1,theta2,width=None,**kwargs):
1174+
def__init__(self,center,r,theta1,theta2,*,width=None,**kwargs):
11801175
"""
11811176
A wedge centered at *x*, *y* center with radius *r* that
11821177
sweeps *theta1* to *theta2* (in degrees). If *width* is given,
@@ -1264,8 +1259,7 @@ def __str__(self):
12641259
[0.8,0.3], [0.8,0.1]])
12651260

12661261
@_docstring.dedent_interpd
1267-
@_api.make_keyword_only("3.6",name="width")
1268-
def__init__(self,x,y,dx,dy,width=1.0,**kwargs):
1262+
def__init__(self,x,y,dx,dy,*,width=1.0,**kwargs):
12691263
"""
12701264
Draws an arrow from (*x*, *y*) to (*x* + *dx*, *y* + *dy*).
12711265
The width of the arrow is scaled by *width*.
@@ -1320,9 +1314,9 @@ def __str__(self):
13201314
return"FancyArrow()"
13211315

13221316
@_docstring.dedent_interpd
1323-
@_api.make_keyword_only("3.6",name="width")
1324-
def__init__(self,x,y,dx,dy,width=0.001,length_includes_head=False,
1325-
head_width=None,head_length=None,shape='full',overhang=0,
1317+
def__init__(self,x,y,dx,dy,*,
1318+
width=0.001,length_includes_head=False,head_width=None,
1319+
head_length=None,shape='full',overhang=0,
13261320
head_starts_at_zero=False,**kwargs):
13271321
"""
13281322
Parameters
@@ -1491,8 +1485,7 @@ def __str__(self):
14911485
returns% (self.xy[0],self.xy[1],self.radius,self.numvertices)
14921486

14931487
@_docstring.dedent_interpd
1494-
@_api.make_keyword_only("3.6",name="resolution")
1495-
def__init__(self,xy,radius=5,
1488+
def__init__(self,xy,radius=5,*,
14961489
resolution=20,# the number of vertices
14971490
**kwargs):
14981491
"""
@@ -1519,8 +1512,7 @@ def __str__(self):
15191512
returnfmt%pars
15201513

15211514
@_docstring.dedent_interpd
1522-
@_api.make_keyword_only("3.6",name="angle")
1523-
def__init__(self,xy,width,height,angle=0,**kwargs):
1515+
def__init__(self,xy,width,height,*,angle=0,**kwargs):
15241516
"""
15251517
Parameters
15261518
----------
@@ -1906,9 +1898,8 @@ def __str__(self):
19061898
returnfmt%pars
19071899

19081900
@_docstring.dedent_interpd
1909-
@_api.make_keyword_only("3.6",name="angle")
1910-
def__init__(self,xy,width,height,angle=0.0,
1911-
theta1=0.0,theta2=360.0,**kwargs):
1901+
def__init__(self,xy,width,height,*,
1902+
angle=0.0,theta1=0.0,theta2=360.0,**kwargs):
19121903
"""
19131904
Parameters
19141905
----------
@@ -4053,13 +4044,10 @@ def __str__(self):
40534044
returnf"{type(self).__name__}({self._path_original})"
40544045

40554046
@_docstring.dedent_interpd
4056-
@_api.make_keyword_only("3.6",name="path")
4057-
def__init__(self,posA=None,posB=None,path=None,
4058-
arrowstyle="simple",connectionstyle="arc3",
4059-
patchA=None,patchB=None,
4060-
shrinkA=2,shrinkB=2,
4061-
mutation_scale=1,mutation_aspect=1,
4062-
**kwargs):
4047+
def__init__(self,posA=None,posB=None,*,
4048+
path=None,arrowstyle="simple",connectionstyle="arc3",
4049+
patchA=None,patchB=None,shrinkA=2,shrinkB=2,
4050+
mutation_scale=1,mutation_aspect=1,**kwargs):
40634051
"""
40644052
There are two ways for defining an arrow:
40654053
@@ -4382,8 +4370,7 @@ def __str__(self):
43824370
(self.xy1[0],self.xy1[1],self.xy2[0],self.xy2[1])
43834371

43844372
@_docstring.dedent_interpd
4385-
@_api.make_keyword_only("3.6",name="axesA")
4386-
def__init__(self,xyA,xyB,coordsA,coordsB=None,
4373+
def__init__(self,xyA,xyB,coordsA,coordsB=None,*,
43874374
axesA=None,axesB=None,
43884375
arrowstyle="-",
43894376
connectionstyle="arc3",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp