Skip to content

More fully qualified argument types #26334

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 1 addition & 4 deletions lib/matplotlib/_constrained_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ def do_constrained_layout(fig, h_pad, w_pad,
fig : Figure
``Figure`` instance to do the layout in.

renderer : Renderer
Renderer to use.

h_pad, w_pad : float
Padding around the axes elements in figure-normalized units.

Expand Down Expand Up @@ -675,7 +672,7 @@ def reposition_colorbar(layoutgrids, cbax, renderer, *, offset=None):
cbax : Axes
Axes for the colorbar

renderer :
renderer : `~matplotlib.backend_bases.RendererBase` subclass
w_pad, h_pad : float
width and height padding (in fraction of figure)
hspace, wspace : float
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/_tight_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
axes_list : list of Axes
subplotspec_list : list of `.SubplotSpec`
The subplotspecs of each axes.
renderer : renderer
renderer : `~matplotlib.backend_bases.RendererBase` subclass
pad : float
Padding between the figure edge and the edges of subplots, as a
fraction of the font size.
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def set_path_effects(self, path_effects):

Parameters
----------
path_effects : `.AbstractPathEffect`
path_effects : `~matplotlib.patheffects.AbstractPathEffect`
"""
self._path_effects = path_effects
self.stale = True
Expand Down
22 changes: 11 additions & 11 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class Axes(_AxesBase):

Attributes
----------
dataLim : `.Bbox`
dataLim : `~matplotlib.transforms.Bbox`
The bounding box enclosing all data displayed in the Axes.
viewLim : `.Bbox`
viewLim : `~matplotlib.transforms.Bbox`
The view limits in data coordinates.

"""
Expand Down Expand Up @@ -337,7 +337,7 @@ def inset_axes(self, bounds, *, transform=None, zorder=5, **kwargs):
bounds : [x0, y0, width, height]
Lower-left corner of inset Axes, and its width and height.

transform : `.Transform`
transform : `~matplotlib.transforms.Transform`
Defaults to `ax.transAxes`, i.e. the units of *rect* are in
Axes-relative coordinates.

Expand Down Expand Up @@ -422,7 +422,7 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
drawn connecting the indicator box to the inset Axes on corners
chosen so as to not overlap with the indicator box.

transform : `.Transform`
transform : `~matplotlib.transforms.Transform`
Transform for the rectangle coordinates. Defaults to
`ax.transAxes`, i.e. the units of *rect* are in Axes-relative
coordinates.
Expand All @@ -447,7 +447,7 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,

Returns
-------
rectangle_patch : `.patches.Rectangle`
rectangle_patch : `~matplotlib.patches.Rectangle`
The indicator frame.

connector_lines : 4-tuple of `.patches.ConnectionPatch`
Expand Down Expand Up @@ -533,7 +533,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):

Returns
-------
rectangle_patch : `.patches.Rectangle`
rectangle_patch : `~matplotlib.patches.Rectangle`
Rectangle artist.

connector_lines : 4-tuple of `.patches.ConnectionPatch`
Expand Down Expand Up @@ -1991,7 +1991,7 @@ def acorr(self, x, **kwargs):
The lag vector.
c : array (length ``2*maxlags+1``)
The auto correlation vector.
line : `.LineCollection` or `.Line2D`
line : `~matplotlib.collections.LineCollection` or `~matplotlib.lines.Line2D`
`.Artist` added to the Axes of the correlation:

- `.LineCollection` if *usevlines* is True.
Expand Down Expand Up @@ -2068,7 +2068,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
The lag vector.
c : array (length ``2*maxlags+1``)
The auto correlation vector.
line : `.LineCollection` or `.Line2D`
line : `~matplotlib.collections.LineCollection` or `~matplotlib.lines.Line2D`
`.Artist` added to the Axes of the correlation:

- `.LineCollection` if *usevlines* is True.
Expand Down Expand Up @@ -2706,7 +2706,7 @@ def bar_label(self, container, labels=None, *, fmt="%g", label_type="edge",

Parameters
----------
container : `.BarContainer`
container : `~matplotlib.container.BarContainer`
Container with all the bars and optionally errorbars, likely
returned from `.bar` or `.barh`.

Expand Down Expand Up @@ -6703,8 +6703,8 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
edge of last bin). Always a single array even when multiple data
sets are passed in.

patches : `.BarContainer` or list of a single `.Polygon` or list of \
such objects
patches : `~matplotlib.container.BarContainer` or list of a single \
`~matplotlib.patches.Polygon` or list of such objects
Container of individual artists used to create the histogram
or list of such containers if there are multiple input datasets.

Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4143,7 +4143,7 @@ def start_pan(self, x, y, button):
----------
x, y : float
The mouse coordinates in display coords.
button : `.MouseButton`
button : `~matplotlib.backend_bases.MouseButton`
The pressed mouse button.

Notes
Expand Down Expand Up @@ -4236,7 +4236,7 @@ def drag_pan(self, button, key, x, y):

Parameters
----------
button : `.MouseButton`
button : `~matplotlib.backend_bases.MouseButton`
The pressed mouse button.
key : str or None
The pressed key, if any.
Expand Down Expand Up @@ -4319,7 +4319,7 @@ def get_tightbbox(self, renderer=None, call_axes_locator=True,

Parameters
----------
renderer : `.RendererBase` subclass
renderer : `~matplotlib.backend_bases.RendererBase` subclass, optional
renderer that will be used to draw the figures (i.e.
``fig.canvas.get_renderer()``)

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ class DrawEvent(Event):

Attributes
----------
renderer : `RendererBase`
renderer : `~matplotlib.backend_bases.RendererBase` subclass
The renderer for the draw event.
"""
def __init__(self, name, canvas, renderer):
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/backend_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ToolManager:

Attributes
----------
figure : `.Figure`
figure : `~matplotlib.figure.Figure`
keypresslock : `~matplotlib.widgets.LockDraw`
`.LockDraw` object to know if the `canvas` key_press_event is locked.
messagelock : `~matplotlib.widgets.LockDraw`
Expand Down Expand Up @@ -81,7 +81,7 @@ def set_figure(self, figure, update_tools=True):

Parameters
----------
figure : `.Figure`
figure : `~matplotlib.figure.Figure`
update_tools : bool, default: True
Force tools to update figure.
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2733,7 +2733,7 @@ def savefig(self, figure=None, **kwargs):

Parameters
----------
figure : `.Figure` or int, default: the active figure
figure : `~matplotlib.figure.Figure` or int, default: the active figure
The figure, or index of the figure, that is saved to the file.
"""
if not isinstance(figure, Figure):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def savefig(self, figure=None, **kwargs):

Parameters
----------
figure : `.Figure` or int, default: the active figure
figure : `~matplotlib.figure.Figure` or int, default: the active figure
The figure, or index of the figure, that is saved to the file.
"""
if not isinstance(figure, Figure):
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def __init__(self, norm=None, cmap=None):
"""
Parameters
----------
norm : `.Normalize` (or subclass thereof) or str or None
norm : `~matplotlib.colors.Normalize` (or subclass thereof) or str or None
The normalizing object which scales data, typically into the
interval ``[0, 1]``.
If a `str`, a `.Normalize` subclass is dynamically generated based
Expand Down Expand Up @@ -640,7 +640,7 @@ def set_norm(self, norm):

Parameters
----------
norm : `.Normalize` or str or None
norm : `~matplotlib.colors.Normalize` or str or None

Notes
-----
Expand Down
5 changes: 3 additions & 2 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def __init__(self, *,
A vector by which to translate each patch after rendering (default
is no translation). The translation is performed in screen (pixel)
coordinates (i.e. after the Artist's transform is applied).
offset_transform : `~.Transform`, default: `.IdentityTransform`
offset_transform : `~matplotlib.transforms.Transform`, default: \
`.IdentityTransform`
A single transform which will be applied to each *offsets* vector
before it is used.
cmap, norm
Expand Down Expand Up @@ -228,7 +229,7 @@ def set_offset_transform(self, offset_transform):

Parameters
----------
offset_transform : `.Transform`
offset_transform : `~matplotlib.transforms.Transform`
"""
self._offset_transform = offset_transform

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __new__(cls, *args, **kwargs):
def __init__(self, kl, label=None):
self._callbacks = cbook.CallbackRegistry(signals=["pchanged"])
self._remove_method = None
self.set_label(label)
self._label = label

def remove(self):
for c in cbook.flatten(
Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ def add_label_near(self, x, y, inline=True, inline_spacing=5,
Space in pixels to leave on each side of label when placing
inline. This spacing will be exact for labels at locations where
the contour is straight, less so for labels on curved contours.
transform : `.Transform` or `False`, default: ``self.axes.transData``
transform : `~matplotlib.transforms.Transform` or `False`, default: \
``self.axes.transData``
A transform applied to ``(x, y)`` before labeling. The default
causes ``(x, y)`` to be interpreted as data coordinates. `False`
is a synonym for `.IdentityTransform`; i.e. ``(x, y)`` should be
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ class ConciseDateFormatter(ticker.Formatter):

Parameters
----------
locator : `.ticker.Locator`
locator : `~matplotlib.ticker.Locator`
Locator that this axis is using.

tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Expand Down Expand Up @@ -940,7 +940,7 @@ def __init__(self, locator, tz=None, defaultfmt='%Y-%m-%d', *,

Parameters
----------
locator : `.ticker.Locator`
locator : `~matplotlib.ticker.Locator`
Locator that this axis is using.

tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Expand Down
15 changes: 9 additions & 6 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ def get_tightbbox(self, renderer=None, bbox_extra_artists=None):

Parameters
----------
renderer : `.RendererBase` subclass
renderer : `~matplotlib.backend_bases.RendererBase` subclass, optional
Renderer that will be used to draw the figures (i.e.
``fig.canvas.get_renderer()``)

Expand Down Expand Up @@ -2167,7 +2167,7 @@ def __init__(self, parent, subplotspec, *,
"""
Parameters
----------
parent : `.Figure` or `.SubFigure`
parent : `~matplotlib.figure.Figure` or `.SubFigure`
Figure or subfigure that contains the SubFigure. SubFigures
can be nested.

Expand Down Expand Up @@ -2480,7 +2480,7 @@ def __init__(self,

Other Parameters
----------------
**kwargs : `.Figure` properties, optional
**kwargs : `~matplotlib.figure.Figure` properties, optional

%(Figure:kwdoc)s
"""
Expand Down Expand Up @@ -3420,11 +3420,14 @@ def ginput(self, n=1, timeout=30, show_clicks=True,
will never time out.
show_clicks : bool, default: True
If True, show a red cross at the location of each click.
mouse_add : `.MouseButton` or None, default: `.MouseButton.LEFT`
mouse_add : `~matplotlib.backend_bases.MouseButton` or None, default: \
`.MouseButton.LEFT`
Mouse button used to add points.
mouse_pop : `.MouseButton` or None, default: `.MouseButton.RIGHT`
mouse_pop : `~matplotlib.backend_bases.MouseButton` or None, default: \
`.MouseButton.RIGHT`
Mouse button used to remove the most recently added point.
mouse_stop : `.MouseButton` or None, default: `.MouseButton.MIDDLE`
mouse_stop : `~matplotlib.backend_bases.MouseButton` or None, default: \
`.MouseButton.MIDDLE`
Mouse button used to stop input.

Returns
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/gridspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def __init__(self, nrows, ncols, figure=None,
nrows, ncols : int
The number of rows and columns of the grid.

figure : `.Figure`, optional
figure : `~matplotlib.figure.Figure`, optional
Only used for constrained layout to create a proper layoutgrid.

left, right, top, bottom : float, optional
Expand Down Expand Up @@ -448,9 +448,9 @@ def tight_layout(self, figure, renderer=None,

Parameters
----------
figure : `.Figure`
figure : `~matplotlib.figure.Figure`
The figure.
renderer : `.RendererBase` subclass, optional
renderer : `~matplotlib.backend_bases.RendererBase` subclass, optional
The renderer to be used.
pad : float
Padding between the figure edge and the edges of subplots, as a
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def composite_images(images, renderer, magnification=1.0):
enforced by this function. Each image must have a purely
affine transformation with no shear.

renderer : `.RendererBase`
renderer : `~matplotlib.backend_bases.RendererBase` subclass

magnification : float, default: 1
The additional magnification to apply for the renderer in use.
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/layout_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def execute(self, fig):

Parameters
----------
fig : `.Figure` to perform layout on.
fig : `~matplotlib.figure.Figure` to perform layout on.

See Also
--------
Expand Down Expand Up @@ -263,7 +263,7 @@ def execute(self, fig):

Parameters
----------
fig : `.Figure` to perform layout on.
fig : `~matplotlib.figure.Figure` to perform layout on.
"""
width, height = fig.get_size_inches()
# pads are relative to the current state of the figure...
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _update_bbox_to_anchor(self, loc_in_canvas):


_legend_kw_doc_base = """
bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats
bbox_to_anchor : `~matplotlib.transforms.BboxBase`, 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*.
Defaults to `axes.bbox` (if called as a method to `.Axes.legend`) or
`figure.bbox` (if `.Figure.legend`). This argument allows arbitrary
Expand Down
Loading