Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80a6868

Browse files
authored
Merge pull request #25327 from oscargus/docfixesvelin
Fix doc-string issues identified by velin
2 parents 430fb1d + f835014 commit 80a6868

11 files changed

+37
-17
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,11 @@ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,
313313
314314
Parameters
315315
----------
316-
points : (N, 3, 2) array-like
316+
gc : `.GraphicsContextBase`
317+
The graphics context.
318+
triangles_array : (N, 3, 2) array-like
317319
Array of *N* (x, y) points for the triangles.
318-
colors : (N, 3, 4) array-like
320+
colors_array : (N, 3, 4) array-like
319321
Array of *N* RGBA colors for each point of the triangles.
320322
transform : `matplotlib.transforms.Transform`
321323
An affine transform to apply to the points.
@@ -611,6 +613,8 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
611613
612614
Parameters
613615
----------
616+
gc : `.GraphicsContextBase`
617+
The graphics context.
614618
x : float
615619
The x location of the text in display coords.
616620
y : float

lib/matplotlib/backend_managers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,8 @@ def add_tool(self, name, tool, *args, **kwargs):
238238
tool : type
239239
Class of the tool to be added. A subclass will be used
240240
instead if one was registered for the current canvas class.
241-
242-
Notes
243-
-----
244-
args and kwargs get passed directly to the tools constructor.
241+
*args, **kwargs
242+
Passed to the *tool*'s constructor.
245243
246244
See Also
247245
--------

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ def _set_scale(self, scale, **kwargs):
10031003
10041004
Parameters
10051005
----------
1006-
value : {"linear", "log", "symlog", "logit", ...} or `.ScaleBase`
1006+
scale : {"linear", "log", "symlog", "logit", ...} or `.ScaleBase`
10071007
The axis scale type to apply.
10081008
10091009
**kwargs

lib/matplotlib/colors.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ def __call__(self, value, clip=None):
13111311
----------
13121312
value
13131313
Data to normalize.
1314-
clip : bool
1314+
clip : bool, optional
13151315
If ``None``, defaults to ``self.clip`` (which defaults to
13161316
``False``).
13171317
@@ -1450,7 +1450,7 @@ def autoscale_None(self, A):
14501450

14511451
def __call__(self, value, clip=None):
14521452
"""
1453-
Map value to the interval [0, 1]. The clip argument is unused.
1453+
Map value to the interval [0, 1]. The *clip* argument is unused.
14541454
"""
14551455
result, is_scalar = self.process_value(value)
14561456
self.autoscale_None(result) # sets self.vmin, self.vmax if None
@@ -1499,6 +1499,10 @@ def __init__(self, vcenter=0, halfrange=None, clip=False):
14991499
*vcenter* + *halfrange* is ``1.0`` in the normalization.
15001500
Defaults to the largest absolute difference to *vcenter* for
15011501
the values in the dataset.
1502+
clip : bool, default: False
1503+
If ``True`` values falling outside the range ``[vmin, vmax]``,
1504+
are mapped to 0 or 1, whichever is closer, and masked values are
1505+
set to 1. If ``False`` masked values remain masked.
15021506
15031507
Examples
15041508
--------
@@ -2423,7 +2427,8 @@ def shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None,
24232427
full illumination or shadow (and clipping any values that move
24242428
beyond 0 or 1). Note that this is not visually or mathematically
24252429
the same as vertical exaggeration.
2426-
Additional kwargs are passed on to the *blend_mode* function.
2430+
**kwargs
2431+
Additional kwargs are passed on to the *blend_mode* function.
24272432
24282433
Returns
24292434
-------
@@ -2484,7 +2489,8 @@ def shade_rgb(self, rgb, elevation, fraction=1., blend_mode='hsv',
24842489
The x-spacing (columns) of the input *elevation* grid.
24852490
dy : number, optional
24862491
The y-spacing (rows) of the input *elevation* grid.
2487-
Additional kwargs are passed on to the *blend_mode* function.
2492+
**kwargs
2493+
Additional kwargs are passed on to the *blend_mode* function.
24882494
24892495
Returns
24902496
-------

lib/matplotlib/figure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def clear(self, keep_observers=False):
949949
950950
Parameters
951951
----------
952-
keep_observers: bool, default: False
952+
keep_observers : bool, default: False
953953
Set *keep_observers* to True if, for example,
954954
a gui widget is tracking the Axes in the figure.
955955
"""
@@ -989,7 +989,7 @@ def clf(self, keep_observers=False):
989989
990990
Parameters
991991
----------
992-
keep_observers: bool, default: False
992+
keep_observers : bool, default: False
993993
Set *keep_observers* to True if, for example,
994994
a gui widget is tracking the Axes in the figure.
995995
"""

lib/matplotlib/gridspec.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ def tight_layout(self, figure, renderer=None,
447447
448448
Parameters
449449
----------
450+
figure : `.Figure`
451+
The figure.
452+
renderer : `.RendererBase` subclass, optional
453+
The renderer to be used.
450454
pad : float
451455
Padding between the figure edge and the edges of subplots, as a
452456
fraction of the font-size.

lib/matplotlib/image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,10 @@ def __init__(self, ax, *, interpolation='nearest', **kwargs):
10471047
"""
10481048
Parameters
10491049
----------
1050+
ax : `~.axes.Axes`
1051+
The axes the image will belong to.
10501052
interpolation : {'nearest', 'bilinear'}, default: 'nearest'
1051-
1053+
The interpolation scheme used in the resampling.
10521054
**kwargs
10531055
All other keyword arguments are identical to those of `.AxesImage`.
10541056
"""

lib/matplotlib/layout_engine.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ def execute(self, fig):
167167
----------
168168
fig : `.Figure` to perform layout on.
169169
170-
See also: `.figure.Figure.tight_layout` and `.pyplot.tight_layout`.
170+
See Also
171+
--------
172+
.figure.Figure.tight_layout
173+
.pyplot.tight_layout
171174
"""
172175
info = self._params
173176
renderer = fig._get_renderer()

lib/matplotlib/text.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,9 @@ def draggable(self, state=None, use_blit=False):
16261626
state : bool or None
16271627
- True or False: set the draggability.
16281628
- None: toggle the draggability.
1629+
use_blit : bool, default: False
1630+
Use blitting for faster image composition. For details see
1631+
:ref:`func-animation`.
16291632
16301633
Returns
16311634
-------

lib/matplotlib/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def padded(self, w_pad, h_pad=None):
613613
----------
614614
w_pad : float
615615
Width pad
616-
h_pad: float, optional
616+
h_pad : float, optional
617617
Height pad. Defaults to *w_pad*.
618618
619619
"""

lib/matplotlib/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ def remove_state(self, state):
25122512
25132513
Parameters
25142514
----------
2515-
value : str
2515+
state : str
25162516
Must be a supported state of the selector. See the
25172517
`state_modifier_keys` parameters for details.
25182518

0 commit comments

Comments
 (0)