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

Commitf9f7d52

Browse files
authored
Merge pull request#10830 from timhoffm/explicit-args-signature
Make function signatures more explicit
2 parents98d05d4 +7433f66 commitf9f7d52

File tree

4 files changed

+27
-43
lines changed

4 files changed

+27
-43
lines changed

‎lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
11471147

11481148
defrc(group,**kwargs):
11491149
"""
1150-
Set the current rc params.Group is the grouping for the rc, e.g.,
1150+
Set the current rc params.*group* is the grouping for the rc, e.g.,
11511151
for ``lines.linewidth`` the group is ``lines``, for
11521152
``axes.facecolor``, the group is ``axes``, and so on. Group may
11531153
also be a list or tuple of group names, e.g., (*xtick*, *ytick*).

‎lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
471471
returnt
472472

473473
@docstring.dedent_interpd
474-
defannotate(self,*args,**kwargs):
475-
a=mtext.Annotation(*args,**kwargs)
474+
defannotate(self,text,xy,*args,**kwargs):
475+
a=mtext.Annotation(text,xy,*args,**kwargs)
476476
a.set_transform(mtransforms.IdentityTransform())
477477
if'clip_on'inkwargs:
478478
a.set_clip_path(self.patch)
@@ -4668,8 +4668,8 @@ def arrow(self, x, y, dx, dy, **kwargs):
46684668
self.add_artist(a)
46694669
returna
46704670

4671-
defquiverkey(self,*args,**kw):
4672-
qk=mquiver.QuiverKey(*args,**kw)
4671+
defquiverkey(self,Q,X,Y,U,label,**kw):
4672+
qk=mquiver.QuiverKey(Q,X,Y,U,label,**kw)
46734673
self.add_artist(qk)
46744674
returnqk
46754675
quiverkey.__doc__=mquiver.QuiverKey.quiverkey_doc

‎lib/matplotlib/figure.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,18 +1939,14 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=True, **kw):
19391939
self.stale=True
19401940
returncb
19411941

1942-
defsubplots_adjust(self,*args,**kwargs):
1942+
defsubplots_adjust(self,left=None,bottom=None,right=None,top=None,
1943+
wspace=None,hspace=None):
19431944
"""
1944-
Call signature::
1945-
1946-
subplots_adjust(left=None, bottom=None, right=None, top=None,
1947-
wspace=None, hspace=None)
1948-
19491945
Update the :class:`SubplotParams` with *kwargs* (defaulting to rc when
19501946
*None*) and update the subplot locations.
19511947
19521948
"""
1953-
self.subplotpars.update(*args,**kwargs)
1949+
self.subplotpars.update(left,bottom,right,top,wspace,hspace)
19541950
foraxinself.axes:
19551951
ifnotisinstance(ax,SubplotBase):
19561952
# Check if sharing a subplots axis

‎lib/matplotlib/pyplot.py

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ def pause(interval):
294294

295295

296296
@docstring.copy_dedent(matplotlib.rc)
297-
defrc(*args,**kwargs):
298-
matplotlib.rc(*args,**kwargs)
297+
defrc(group,**kwargs):
298+
matplotlib.rc(group,**kwargs)
299299

300300

301301
@docstring.copy_dedent(matplotlib.rc_context)
@@ -344,8 +344,8 @@ def sci(im):
344344
## Any Artist ##
345345
# (getp is simply imported)
346346
@docstring.copy(_setp)
347-
defsetp(*args,**kwargs):
348-
return_setp(*args,**kwargs)
347+
defsetp(obj,*args,**kwargs):
348+
return_setp(obj,*args,**kwargs)
349349

350350

351351
defxkcd(scale=1,length=100,randomness=2):
@@ -735,13 +735,13 @@ def waitforbuttonpress(*args, **kwargs):
735735
# Putting things in figures
736736

737737
@docstring.copy_dedent(Figure.text)
738-
deffigtext(*args,**kwargs):
739-
returngcf().text(*args,**kwargs)
738+
deffigtext(x,y,s,*args,**kwargs):
739+
returngcf().text(x,y,s,*args,**kwargs)
740740

741741

742742
@docstring.copy_dedent(Figure.suptitle)
743-
defsuptitle(*args,**kwargs):
744-
returngcf().suptitle(*args,**kwargs)
743+
defsuptitle(t,**kwargs):
744+
returngcf().suptitle(t,**kwargs)
745745

746746

747747
@docstring.copy_dedent(Figure.figimage)
@@ -1289,15 +1289,11 @@ def twiny(ax=None):
12891289
returnax1
12901290

12911291

1292-
defsubplots_adjust(*args,**kwargs):
1292+
defsubplots_adjust(left=None,bottom=None,right=None,top=None,
1293+
wspace=None,hspace=None):
12931294
"""
12941295
Tune the subplot layout.
12951296
1296-
call signature::
1297-
1298-
subplots_adjust(left=None, bottom=None, right=None, top=None,
1299-
wspace=None, hspace=None)
1300-
13011297
The parameter meanings (and suggested defaults) are::
13021298
13031299
left = 0.125 # the left side of the subplots of the figure
@@ -1312,7 +1308,7 @@ def subplots_adjust(*args, **kwargs):
13121308
The actual defaults are controlled by the rc file
13131309
"""
13141310
fig=gcf()
1315-
fig.subplots_adjust(*args,**kwargs)
1311+
fig.subplots_adjust(left,bottom,right,top,wspace,hspace)
13161312

13171313

13181314
defsubplot_tool(targetfig=None):
@@ -1597,14 +1593,10 @@ def ylim(*args, **kwargs):
15971593

15981594

15991595
@docstring.dedent_interpd
1600-
defxscale(*args,**kwargs):
1596+
defxscale(scale,**kwargs):
16011597
"""
16021598
Set the scaling of the x-axis.
16031599
1604-
Call signature::
1605-
1606-
xscale(scale, **kwargs)
1607-
16081600
Parameters
16091601
----------
16101602
scale : [%(scale)s]
@@ -1621,18 +1613,14 @@ def xscale(*args, **kwargs):
16211613
16221614
%(scale_docs)s
16231615
"""
1624-
gca().set_xscale(*args,**kwargs)
1616+
gca().set_xscale(scale,**kwargs)
16251617

16261618

16271619
@docstring.dedent_interpd
1628-
defyscale(*args,**kwargs):
1620+
defyscale(scale,**kwargs):
16291621
"""
16301622
Set the scaling of the y-axis.
16311623
1632-
Call signature::
1633-
1634-
yscale(scale, **kwargs)
1635-
16361624
Parameters
16371625
----------
16381626
scale : [%(scale)s]
@@ -1649,7 +1637,7 @@ def yscale(*args, **kwargs):
16491637
16501638
%(scale_docs)s
16511639
"""
1652-
gca().set_yscale(*args,**kwargs)
1640+
gca().set_yscale(scale,**kwargs)
16531641

16541642

16551643
defxticks(*args,**kwargs):
@@ -2316,13 +2304,13 @@ def set_cmap(cmap):
23162304

23172305

23182306
@docstring.copy_dedent(_imread)
2319-
defimread(*args,**kwargs):
2320-
return_imread(*args,**kwargs)
2307+
defimread(fname,format=None):
2308+
return_imread(fname,format)
23212309

23222310

23232311
@docstring.copy_dedent(_imsave)
2324-
defimsave(*args,**kwargs):
2325-
return_imsave(*args,**kwargs)
2312+
defimsave(fname,arr,**kwargs):
2313+
return_imsave(fname,arr,**kwargs)
23262314

23272315

23282316
defmatshow(A,fignum=None,**kw):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp