8000 Backport PR #25327: Fix doc-string issues identified by velin · matthewfeickert/matplotlib@b6a779e · GitHub
[go: up one dir, main page]

65EE
Skip to content

Commit b6a779e

Browse files
timhoffmoscargus
authored andcommitted
Backport PR matplotlib#25327: Fix doc-string issues identified by velin
1 parent 9e599a4 commit b6a779e

File tree

10 files changed

+36
-16
lines changed

10 files changed

+36
-16
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,11 @@ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,
311311
312312
Parameters
313313
----------
314-
points : (N, 3, 2) array-like
314+
gc : `.GraphicsContextBase`
315+
The graphics context.
316+
triangles_array : (N, 3, 2) array-like
315317
Array of *N* (x, y) points for the triangles.
316-
colors : (N, 3, 4) array-like
318+
colors_array : (N, 3, 4) array-like
317319
Array of *N* RGBA colors for each point of the triangles.
318320
transform : `matplotlib.transforms.Transform`
319321
An affine transform to apply to the points.
@@ -609,6 +611,8 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
609611
610612
Parameters
611613
----------
614+
gc : `.GraphicsContextBase`
615+
The graphics context.
612616
x : float
613617
The x location of the text in display coords.
614618
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
@@ -1321,7 +1321,7 @@ def __call__(self, value, clip=None):
13211321
----------
13221322
value
13231323
Data to normalize.
1324-
clip : bool
1324+
clip : bool, optional
13251325
If ``None``, defaults to ``self.clip`` (which defaults to
13261326
``False``).
13271327
@@ -1456,7 +1456,7 @@ def autoscale_None(self, A):
14561456

14571457
def __call__(self, value, clip=None):
14581458
"""
1459-
Map value to the interval [0, 1]. The clip argument is unused.
1459+
Map value to the interval [0, 1]. The *clip* argument is unused.
14601460
"""
14611461
result, is_scalar = self.process_value(value)
14621462
self.autoscale_None(result) # sets self.vmin, self.vmax if None
@@ -1505,6 +1505,10 @@ def __init__(self, vcenter=0, halfrange=None, clip=False):
15051505
*vcenter* + *halfrange* is ``1.0`` in the normalization.
15061506
Defaults to the largest absolute difference to *vcenter* for
15071507
the values in the dataset.
1508+
clip : bool, default: False
1509+
If ``True`` values falling outside the range ``[vmin, vmax]``,
1510+
are mapped to 0 or 1, whichever is closer, and masked values are
1511+
set to 1. If ``False`` masked values remain masked.
15081512
15091513
Examples
15101514
--------
@@ -2405,7 +2409,8 @@ def shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None,
24052409
full illumination or shadow (and clipping any values that move
24062410
beyond 0 or 1). Note that this is not visually or mathematically
24072411
the same as vertical exaggeration.
2408-
Additional kwargs are passed on to the *blend_mode* function.
2412+
**kwargs
2413+
Additional kwargs are passed on to the *blend_mode* function.
24092414
24102415
Returns
24112416
-------
@@ -2466,7 +2471,8 @@ def shade_rgb(self, rgb, elevation, fraction=1., blend_mode='hsv',
24662471
The x-spacing (columns) of the input *elevation* grid.
24672472
dy : number, optional
24682473
The y-spacing (rows) of the input *elevation* grid.
2469-
Additional kwargs are passed on to the *blend_mode* function.
2474+
**kwargs
2475+
Additional kwargs are passed on to the *blend_mode* function.
24702476
24712477
Returns
24722478
-------

lib/matplotlib/figure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ def clear(self, keep_observers=False):
936936
937937
Parameters
938938
----------
939-
keep_observers: bool, default: False
939+
keep_observers : bool, default: False
940940
Set *keep_observers* to True if, for example,
941941
a gui widget is tracking the Axes in the figure.
942942
"""
@@ -976,7 +976,7 @@ def clf(self, keep_observers=False):
976976
977977
Parameters
978978
----------
979-
keep_observers: bool, default: False
979+
keep_observers : bool, default: False
980980
Set *keep_observers* to True if, for example,
981981
a gui widget is tracking the Axes in the figure.
982982
"""

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
@@ -1048,8 +1048,10 @@ def __init__(self, ax, *, interpolation='nearest', **kwargs):
10481048
"""
10491049
Parameters
10501050
----------
1051+
ax : `~.axes.Axes`
1052+
The axes the image will belong to.
10511053
interpolation : {'nearest', 'bilinear'}, default: 'nearest'
1052-
1054+
The interpolation scheme used in the resampling.
10531055
**kwargs
10541056
All other keyword arguments are identical to those of `.AxesImage`.
10551057
"""

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/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)
0