8000 Write more descriptive docstrings for kwargs for several Axes methods. · matplotlib/matplotlib@6cda8d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6cda8d0

Browse files
authored
Write more descriptive docstrings for kwargs for several Axes methods.
1 parent 25cb0b0 commit 6cda8d0

File tree

2 files changed

+45
-7
lines changed

2 files changed

+45
-7
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
from matplotlib.axes._secondary_axes import SecondaryAxis
3535
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
3636

37-
3837
_log = logging.getLogger(__name__)
3938

4039

@@ -1979,6 +1978,11 @@ def acorr(self, x, **kwargs):
19791978
The marker for plotting the data points.
19801979
Only used if *usevlines* is ``False``.
19811980
1981+
**kwargs
1982+
Additional parameters are passed to `.Axes.vlines` and
1983+
`.Axes.axhline` if *usevlines* is ``True``; otherwise they are
1984+
passed to `.Axes.plot`.
1985+
19821986
Notes
19831987
-----
19841988
The cross correlation is performed with `numpy.correlate` with
@@ -2048,6 +2052,11 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
20482052
The marker for plotting the data points.
20492053
Only used if *usevlines* is ``False``.
20502054
2055+
**kwargs
2056+
Additional parameters are passed to `.Axes.vlines` and
2057+
`.Axes.axhline` if *usevlines* is ``True``; otherwise they are
2058+
passed to `.Axes.plot`.
2059+
20512060
Notes
20522061
-----
20532062
The cross correlation is performed with `numpy.correlate` with
@@ -6315,6 +6324,12 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
63156324
- `.PcolorImage` for a non-regular rectangular grid.
63166325
- `.QuadMesh` for a non-rectangular grid.
63176326
6327+
Other Parameters
6328+
----------------
6329+
**kwargs
6330+
Supported additional parameters depend on the type of grid.
6331+
See return types of *image* for further description.
6332+
63186333
Notes
63196334
-----
63206335
.. [notes section required to get data note injection right]
@@ -6410,9 +6425,25 @@ def contourf(self, *args, **kwargs):
64106425
return contours
64116426
contourf.__doc__ = mcontour.QuadContourSet._contour_doc
64126427

6413-
def clabel(self, CS, *args, **kwargs):
6414-
return CS.clabel(*args, **kwargs)
6415-
clabel.__doc__ = mcontour.ContourSet.clabel.__doc__
6428+
def clabel(self, CS, levels=None, **kwargs):
6429+
"""
6430+
Label a contour plot.
6431+
6432+
Adds labels to line contours in given `.ContourSet`.
6433+
6434+
Parameters
6435+
----------
6436+
CS : `~.ContourSet` instance
6437+
Line contours to label.
6438+
6439+
levels : array-like, optional
6440+
A list of level values, that should be labeled. The list must be
6441+
a subset of ``CS.levels``. If not given, all levels are labeled.
6442+
6443+
**kwargs
6444+
All other parameters are documented in `~.ContourLabeler.clabel`.
6445+
"""
6446+
return CS.clabel(levels, **kwargs)
64166447

64176448
#### Data analysis
64186449

@@ -6590,7 +6621,8 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
65906621
65916622
Other Parameters
65926623
----------------
6593-
**kwargs : `~matplotlib.patches.Patch` properties
6624+
**kwargs
6625+
`~matplotlib.patches.Patch` properties
65946626
65956627
See also
65966628
--------
@@ -6883,6 +6915,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
68836915
return tops, bins, cbook.silent_list('Lists of Patches', patches)
68846916

68856917
@_preprocess_data(replace_names=["x", "y", "weights"])
6918+
@docstring.dedent_interpd
68866919
def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
68876920
cmin=None, cmax=None, **kwargs):
68886921
"""
@@ -6959,6 +6992,11 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
69596992
alpha : ``0 <= scalar <= 1`` or ``None``, optional
69606993
The alpha blending value.
69616994
6995+
**kwargs
6996+
Additional parameters are passed along to the
6997+
`~.Axes.pcolormesh` method and `~matplotlib.collections.QuadMesh`
6998+
constructor.
6999+
69627000
See also
69637001
--------
69647002
hist : 1D histogram plotting

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,8 +2331,8 @@ def cla():
23312331

23322332
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
23332333
@docstring.copy(Axes.clabel)
2334-
def clabel(CS, *args, **kwargs):
2335-
return gca().clabel(CS, *args, **kwargs)
2334+
def clabel(CS, levels=None, **kwargs):
2335+
return gca().clabel(CS, levels=levels, **kwargs)
23362336

23372337

23382338
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.

0 commit comments

Comments
 (0)
0