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

Skip to content

Fix doc-string issues identified by velin #25327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,11 @@ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,

Parameters
----------
points : (N, 3, 2) array-like
gc : `.GraphicsContextBase`
The graphics context.
triangles_array : (N, 3, 2) array-like
Array of *N* (x, y) points for the triangles.
colors : (N, 3, 4) array-like
colors_array : (N, 3, 4) array-like
Array of *N* RGBA colors for each point of the triangles.
transform : `matplotlib.transforms.Transform`
An affine transform to apply to the points.
Expand Down Expand Up @@ -611,6 +613,8 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):

Parameters
----------
gc : `.GraphicsContextBase`
The graphics context.
x : float
The x location of the text in display coords.
y : float
Expand Down
6 changes: 2 additions & 4 deletions lib/matplotlib/backend_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,8 @@ def add_tool(self, name, tool, *args, **kwargs):
tool : type
Class of the tool to be added. A subclass will be used
instead if one was registered for the current canvas class.

Notes
-----
args and kwargs get passed directly to the tools constructor.
*args, **kwargs
Passed to the *tool*'s constructor.

See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def _set_scale(self, scale, **kwargs):

Parameters
----------
value : {"linear", "log", "symlog", "logit", ...} or `.ScaleBase`
scale : {"linear", "log", "symlog", "logit", ...} or `.ScaleBase`
The axis scale type to apply.

**kwargs
Expand Down
14 changes: 10 additions & 4 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ def __call__(self, value, clip=None):
----------
value
Data to normalize.
clip : bool
clip : bool, optional
If ``None``, defaults to ``self.clip`` (which defaults to
``False``).

Expand Down Expand Up @@ -1450,7 +1450,7 @@ def autoscale_None(self, A):

def __call__(self, value, clip=None):
"""
Map value to the interval [0, 1]. The clip argument is unused.
Map value to the interval [0, 1]. The *clip* argument is unused.
"""
result, is_scalar = self.process_value(value)
self.autoscale_None(result) # sets self.vmin, self.vmax if None
Expand Down Expand Up @@ -1499,6 +1499,10 @@ def __init__(self, vcenter=0, halfrange=None, clip=False):
*vcenter* + *halfrange* is ``1.0`` in the normalization.
Defaults to the largest absolute difference to *vcenter* for
the values in the dataset.
clip : bool, default: False
If ``True`` values falling outside the range ``[vmin, vmax]``,
are mapped to 0 or 1, whichever is closer, and masked values are
set to 1. If ``False`` masked values remain masked.

Examples
--------
Expand Down Expand Up @@ -2423,7 +2427,8 @@ def shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None,
full illumination or shadow (and clipping any values that move
beyond 0 or 1). Note that this is not visually or mathematically
the same as vertical exaggeration.
Additional kwargs are passed on to the *blend_mode* function.
**kwargs
Additional kwargs are passed on to the *blend_mode* function.

Returns
-------
Expand Down Expand Up @@ -2484,7 +2489,8 @@ def shade_rgb(self, rgb, elevation, fraction=1., blend_mode='hsv',
The x-spacing (columns) of the input *elevation* grid.
dy : number, optional
The y-spacing (rows) of the input *elevation* grid.
Additional kwargs are passed on to the *blend_mode* function.
**kwargs
Additional kwargs are passed on to the *blend_mode* function.

Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ def clear(self, keep_observers=False):

Parameters
----------
keep_observers: bool, default: False
keep_observers : bool, default: False
Set *keep_observers* to True if, for example,
a gui widget is tracking the Axes in the figure.
"""
Expand Down Expand Up @@ -989,7 +989,7 @@ def clf(self, keep_observers=False):

Parameters
----------
keep_observers: bool, default: False
keep_observers : bool, default: False
Set *keep_observers* to True if, for example,
a gui widget is tracking the Axes in the figure.
"""
Expand Down
4 changes: 4 additions & 0 deletions lib/matplotlib/gridspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ def tight_layout(self, figure, renderer=None,

Parameters
----------
figure : `.Figure`
The figure.
renderer : `.RendererBase` subclass, optional
The renderer to be used.
pad : float
Padding between the figure edge and the edges of subplots, as a
fraction of the font-size.
Expand Down
4 changes: 3 additions & 1 deletion lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,10 @@ def __init__(self, ax, *, interpolation='nearest', **kwargs):
"""
Parameters
----------
ax : `~.axes.Axes`
The axes the image will belong to.
interpolation : {'nearest', 'bilinear'}, default: 'nearest'

The interpolation scheme used in the resampling.
**kwargs
All other keyword arguments are identical to those of `.AxesImage`.
"""
Expand Down
5 changes: 4 additions & 1 deletion lib/matplotlib/layout_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ def execute(self, fig):
----------
fig : `.Figure` to perform layout on.

See also: `.figure.Figure.tight_layout` and `.pyplot.tight_layout`.
See Also
--------
.figure.Figure.tight_layout
.pyplot.tight_layout
"""
info = self._params
renderer = fig._get_renderer()
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,9 @@ def draggable(self, state=None, use_blit=False):
state : bool or None
- True or False: set the draggability.
- None: toggle the draggability.
use_blit : bool, default: False
Use blitting for faster image composition. For details see
:ref:`func-animation`.

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def padded(self, w_pad, h_pad=None):
----------
w_pad : float
Width pad
h_pad: float, optional
h_pad : float, optional
Height pad. Defaults to *w_pad*.

"""
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,7 @@ def remove_state(self, state):

Parameters
----------
value : str
state : str
Must be a supported state of the selector. See the
`state_modifier_keys` parameters for details.

Expand Down