Skip to content

Commit d780621

Browse files
authored
Merge pull request #26186 from oscargus/docabrv
[Doc] Improve documentation types
2 parents 36334de + c85551c commit d780621

28 files changed

+101
-99
lines changed

lib/matplotlib/artist.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def contains(self, mouseevent):
483483
484484
Parameters
485485
----------
486-
mouseevent : `matplotlib.backend_bases.MouseEvent`
486+
mouseevent : `~matplotlib.backend_bases.MouseEvent`
487487
488488
Returns
489489
-------
@@ -774,7 +774,7 @@ def set_clip_path(self, path, transform=None):
774774
775775
Parameters
776776
----------
777-
path : `.Patch` or `.Path` or `.TransformedPath` or None
777+
path : `~matplotlib.patches.Patch` or `.Path` or `.TransformedPath` or None
778778
The clip path. If given a `.Path`, *transform* must be provided as
779779
well. If *None*, a previously set clip path is removed.
780780
transform : `~matplotlib.transforms.Transform`, optional
@@ -1300,7 +1300,7 @@ def get_cursor_data(self, event):
13001300
13011301
Parameters
13021302
----------
1303-
event : `matplotlib.backend_bases.MouseEvent`
1303+
event : `~matplotlib.backend_bases.MouseEvent`
13041304
13051305
See Also
13061306
--------
@@ -1714,7 +1714,7 @@ def getp(obj, property=None):
17141714
17151715
Parameters
17161716
----------
1717-
obj : `.Artist`
1717+
obj : `~matplotlib.artist.Artist`
17181718
The queried artist; e.g., a `.Line2D`, a `.Text`, or an `~.axes.Axes`.
17191719
17201720
property : str or None, default: None
@@ -1753,7 +1753,7 @@ def setp(obj, *args, file=None, **kwargs):
17531753
17541754
Parameters
17551755
----------
1756-
obj : `.Artist` or list of `.Artist`
1756+
obj : `~matplotlib.artist.Artist` or list of `.Artist`
17571757
The artist(s) whose properties are being set or queried. When setting
17581758
properties, all artists are affected; when querying the allowed values,
17591759
only the first instance in the sequence is queried.

lib/matplotlib/axes/_axes.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def set_title(self, label, fontdict=None, loc=None, pad=None, *, y=None,
150150
151151
Other Parameters
152152
----------------
153-
**kwargs : `.Text` properties
153+
**kwargs : `~matplotlib.text.Text` properties
154154
Other keyword arguments are text properties, see `.Text` for a list
155155
of valid text properties.
156156
"""
@@ -1604,7 +1604,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
16041604
data limits. The values are passed on to
16051605
`~.axes.Axes.autoscale_view`.
16061606
1607-
**kwargs : `.Line2D` properties, optional
1607+
**kwargs : `~matplotlib.lines.Line2D` properties, optional
16081608
*kwargs* are used to specify properties like a line label (for
16091609
auto legends), linewidth, antialiasing, marker face color.
16101610
Example::
@@ -1996,13 +1996,13 @@ def acorr(self, x, **kwargs):
19961996
19971997
- `.LineCollection` if *usevlines* is True.
19981998
- `.Line2D` if *usevlines* is False.
1999-
b : `.Line2D` or None
1999+
b : `~matplotlib.lines.Line2D` or None
20002000
Horizontal line at 0 if *usevlines* is True
20012001
None *usevlines* is False.
20022002
20032003
Other Parameters
20042004
----------------
2005-
linestyle : `.Line2D` property, optional
2005+
linestyle : `~matplotlib.lines.Line2D` property, optional
20062006
The linestyle for plotting the data points.
20072007
Only used if *usevlines* is ``False``.
20082008
@@ -2073,13 +2073,13 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
20732073
20742074
- `.LineCollection` if *usevlines* is True.
20752075
- `.Line2D` if *usevlines* is False.
2076-
b : `.Line2D` or None
2076+
b : `~matplotlib.lines.Line2D` or None
20772077
Horizontal line at 0 if *usevlines* is True
20782078
None *usevlines* is False.
20792079
20802080
Other Parameters
20812081
----------------
2082-
linestyle : `.Line2D` property, optional
2082+
linestyle : `~matplotlib.lines.Line2D` property, optional
20832083
The linestyle for plotting the data points.
20842084
Only used if *usevlines* is ``False``.
20852085
@@ -3460,8 +3460,10 @@ def errorbar(self, x, y, yerr=None, xerr=None,
34603460
`.ErrorbarContainer`
34613461
The container contains:
34623462
3463-
- plotline: `.Line2D` instance of x, y plot markers and/or line.
3464-
- caplines: A tuple of `.Line2D` instances of the error bar caps.
3463+
- plotline: `~matplotlib.lines.Line2D` instance of x, y plot markers
3464+
and/or line.
3465+
- caplines: A tuple of `~matplotlib.lines.Line2D` instances of the error
3466+
bar caps.
34653467
- barlinecols: A tuple of `.LineCollection` with the horizontal and
34663468
vertical error ranges.
34673469
@@ -7046,7 +7048,7 @@ def stairs(self, values, edges=None, *,
70467048
70477049
Returns
70487050
-------
7049-
StepPatch : `matplotlib.patches.StepPatch`
7051+
StepPatch : `~matplotlib.patches.StepPatch`
70507052
70517053
Other Parameters
70527054
----------------

lib/matplotlib/axes/_base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def __init__(self, fig,
604604
being created. Finally, ``*args`` can also directly be a
605605
`.SubplotSpec` instance.
606606
607-
sharex, sharey : `~.axes.Axes`, optional
607+
sharex, sharey : `~matplotlib.axes.Axes`, optional
608608
The x- or y-`~.matplotlib.axis` is shared with the x- or y-axis in
609609
the input `~.axes.Axes`.
610610
@@ -3159,7 +3159,7 @@ def grid(self, visible=None, which='major', axis='both', **kwargs):
31593159
axis : {'both', 'x', 'y'}, optional
31603160
The axis to apply the changes on.
31613161
3162-
**kwargs : `.Line2D` properties
3162+
**kwargs : `~matplotlib.lines.Line2D` properties
31633163
Define the line properties of the grid, e.g.::
31643164
31653165
grid(color='r', linestyle='-', linewidth=2)
@@ -3427,7 +3427,7 @@ def set_xlabel(self, xlabel, fontdict=None, labelpad=None, *,
34273427
34283428
Other Parameters
34293429
----------------
3430-
**kwargs : `.Text` properties
3430+
**kwargs : `~matplotlib.text.Text` properties
34313431
`.Text` properties control the appearance of the label.
34323432
34333433
See Also
@@ -3675,7 +3675,7 @@ def set_ylabel(self, ylabel, fontdict=None, labelpad=None, *,
36753675
36763676
Other Parameters
36773677
----------------
3678-
**kwargs : `.Text` properties
3678+
**kwargs : `~matplotlib.text.Text` properties
36793679
`.Text` properties control the appearance of the label.
36803680
36813681
See Also

lib/matplotlib/axis.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ class Tick(martist.Artist):
4343
4444
Attributes
4545
----------
46-
tick1line : `.Line2D`
46+
tick1line : `~matplotlib.lines.Line2D`
4747
The left/bottom tick marker.
48-
tick2line : `.Line2D`
48+
tick2line : `~matplotlib.lines.Line2D`
4949
The right/top tick marker.
50-
gridline : `.Line2D`
50+
gridline : `~matplotlib.lines.Line2D`
5151
The grid line associated with the label position.
52-
label1 : `.Text`
52+
label1 : `~matplotlib.text.Text`
5353
The left/bottom tick label.
54-
label2 : `.Text`
54+
label2 : `~matplotlib.text.Text`
5555
The right/top tick label.
5656
5757
"""
@@ -526,9 +526,9 @@ class Ticker:
526526
527527
Attributes
528528
----------
529-
locator : `matplotlib.ticker.Locator` subclass
529+
locator : `~matplotlib.ticker.Locator` subclass
530530
Determines the positions of the ticks.
531-
formatter : `matplotlib.ticker.Formatter` subclass
531+
formatter : `~matplotlib.ticker.Formatter` subclass
532532
Determines the format of the tick labels.
533533
"""
534534

@@ -601,20 +601,20 @@ class Axis(martist.Artist):
601601
----------
602602
isDefault_label : bool
603603
604-
axes : `matplotlib.axes.Axes`
604+
axes : `~matplotlib.axes.Axes`
605605
The `~.axes.Axes` to which the Axis belongs.
606-
major : `matplotlib.axis.Ticker`
606+
major : `~matplotlib.axis.Ticker`
607607
Determines the major tick positions and their label format.
608-
minor : `matplotlib.axis.Ticker`
608+
minor : `~matplotlib.axis.Ticker`
609609
Determines the minor tick positions and their label format.
610-
callbacks : `matplotlib.cbook.CallbackRegistry`
610+
callbacks : `~matplotlib.cbook.CallbackRegistry`
611611
612-
label : `.Text`
612+
label : `~matplotlib.text.Text`
613613
The axis label.
614614
labelpad : float
615615
The distance between the axis label and the tick labels.
616616
Defaults to :rc:`axes.labelpad` = 4.
617-
offsetText : `.Text`
617+
offsetText : `~matplotlib.text.Text`
618618
A `.Text` object containing the data offset of the ticks (if any).
619619
pickradius : float
620620
The acceptance radius for containment tests. See also `.Axis.contains`.
@@ -636,7 +636,7 @@ def __init__(self, axes, *, pickradius=15):
636636
"""
637637
Parameters
638638
----------
639-
axes : `matplotlib.axes.Axes`
639+
axes : `~matplotlib.axes.Axes`
640640
The `~.axes.Axes` to which the created Axis belongs.
641641
pickradius : float
642642
The acceptance radius for containment tests. See also
@@ -1621,7 +1621,7 @@ def grid(self, visible=None, which='major', **kwargs):
16211621
which : {'major', 'minor', 'both'}
16221622
The grid lines to apply the changes on.
16231623
1624-
**kwargs : `.Line2D` properties
1624+
**kwargs : `~matplotlib.lines.Line2D` properties
16251625
Define the line properties of the grid, e.g.::
16261626
16271627
grid(color='r', linestyle='-', linewidth=2)

lib/matplotlib/backend_bases.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ def draw_markers(self, gc, marker_path, marker_trans, path,
209209
----------
210210
gc : `.GraphicsContextBase`
211211
The graphics context.
212-
marker_trans : `matplotlib.transforms.Transform`
212+
marker_trans : `~matplotlib.transforms.Transform`
213213
An affine transform applied to the marker.
214-
trans : `matplotlib.transforms.Transform`
214+
trans : `~matplotlib.transforms.Transform`
215215
An affine transform applied to the path.
216216
"""
217217
for vertices, codes in path.iter_segments(trans, simplify=False):
@@ -301,7 +301,7 @@ def draw_gouraud_triangle(self, gc, points, colors, transform):
301301
Array of (x, y) points for the triangle.
302302
colors : (3, 4) array-like
303303
RGBA colors for each point of the triangle.
304-
transform : `matplotlib.transforms.Transform`
304+
transform : `~matplotlib.transforms.Transform`
305305
An affine transform to apply to the points.
306306
"""
307307
raise NotImplementedError
@@ -319,7 +319,7 @@ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,
319319
Array of *N* (x, y) points for the triangles.
320320
colors_array : (N, 3, 4) array-like
321321
Array of *N* RGBA colors for each point of the triangles.
322-
transform : `matplotlib.transforms.Transform`
322+
transform : `~matplotlib.transforms.Transform`
323323
An affine transform to apply to the points.
324324
"""
325325
raise NotImplementedError
@@ -523,7 +523,7 @@ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
523523
The font properties.
524524
angle : float
525525
The rotation angle in degrees anti-clockwise.
526-
mtext : `matplotlib.text.Text`
526+
mtext : `~matplotlib.text.Text`
527527
The original text object to be rendered.
528528
"""
529529
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
@@ -548,7 +548,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
548548
The rotation angle in degrees anti-clockwise.
549549
ismath : bool or "TeX"
550550
If True, use mathtext parser. If "TeX", use tex for rendering.
551-
mtext : `matplotlib.text.Text`
551+
mtext : `~matplotlib.text.Text`
552552
The original text object to be rendered.
553553
554554
Notes
@@ -1342,7 +1342,7 @@ class LocationEvent(Event):
13421342
----------
13431343
x, y : int or None
13441344
Event location in pixels from bottom left of canvas.
1345-
inaxes : `~.axes.Axes` or None
1345+
inaxes : `~matplotlib.axes.Axes` or None
13461346
The `~.axes.Axes` instance over which the mouse is, if any.
13471347
xdata, ydata : float or None
13481348
Data coordinates of the mouse within *inaxes*, or *None* if the mouse
@@ -1491,7 +1491,7 @@ class PickEvent(Event):
14911491
----------
14921492
mouseevent : `MouseEvent`
14931493
The mouse event that generated the pick.
1494-
artist : `matplotlib.artist.Artist`
1494+
artist : `~matplotlib.artist.Artist`
14951495
The picked artist. Note that artists are not pickable by default
14961496
(see `.Artist.set_picker`).
14971497
other
@@ -1669,7 +1669,7 @@ class FigureCanvasBase:
16691669
16701670
Attributes
16711671
----------
1672-
figure : `matplotlib.figure.Figure`
1672+
figure : `~matplotlib.figure.Figure`
16731673
A high-level figure instance.
16741674
"""
16751675

lib/matplotlib/backends/backend_mixed.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ def __init__(self, figure, width, height, dpi, vector_renderer,
1919
"""
2020
Parameters
2121
----------
22-
figure : `matplotlib.figure.Figure`
22+
figure : `~matplotlib.figure.Figure`
2323
The figure instance.
2424
width : scalar
2525
The width of the canvas in logical units
2626
height : scalar
2727
The height of the canvas in logical units
2828
dpi : float
2929
The dpi of the canvas
30-
vector_renderer : `matplotlib.backend_bases.RendererBase`
30+
vector_renderer : `~matplotlib.backend_bases.RendererBase`
3131
An instance of a subclass of
3232
`~matplotlib.backend_bases.RendererBase` that will be used for the
3333
vector drawing.
34-
raster_renderer_class : `matplotlib.backend_bases.RendererBase`
34+
raster_renderer_class : `~matplotlib.backend_bases.RendererBase`
3535
The renderer class to use for the raster drawing. If not provided,
3636
this will use the Agg backend (which is currently the only viable
3737
option anyway.)

lib/matplotlib/backends/backend_pgf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def __init__(self, figure, fh):
349349
350350
Attributes
351351
----------
352-
figure : `matplotlib.figure.Figure`
352+
figure : `~matplotlib.figure.Figure`
353353
Matplotlib figure to initialize height, width and dpi from.
354354
fh : file-like
355355
File handle for the output of the drawing commands.

lib/matplotlib/backends/backend_template.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class methods button_press_event, button_release_event,
159159
160160
Attributes
161161
----------
162-
figure : `matplotlib.figure.Figure`
162+
figure : `~matplotlib.figure.Figure`
163163
A high-level Figure instance
164164
"""
165165

lib/matplotlib/cm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def _get_cmap(name=None, lut=None):
281281
282282
Parameters
283283
----------
284-
name : `matplotlib.colors.Colormap` or str or None, default: None
284+
name : `~matplotlib.colors.Colormap` or str or None, default: None
285285
If a `.Colormap` instance, it will be returned. Otherwise, the name of
286286
a colormap known to Matplotlib, which will be resampled by *lut*. The
287287
default, None, means :rc:`image.cmap`.

lib/matplotlib/colorbar.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1380,13 +1380,13 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
13801380
13811381
Parameters
13821382
----------
1383-
parents : `~.axes.Axes` or iterable or `numpy.ndarray` of `~.axes.Axes`
1383+
parents : `~matplotlib.axes.Axes` or iterable or `numpy.ndarray` of `~.axes.Axes`
13841384
The Axes to use as parents for placing the colorbar.
13851385
%(_make_axes_kw_doc)s
13861386
13871387
Returns
13881388
-------
1389-
cax : `~.axes.Axes`
1389+
cax : `~matplotlib.axes.Axes`
13901390
The child axes.
13911391
kwargs : dict
13921392
The reduced keyword dictionary to be passed when creating the colorbar
@@ -1494,13 +1494,13 @@ def make_axes_gridspec(parent, *, location=None, orientation=None,
14941494
14951495
Parameters
14961496
----------
1497-
parent : `~.axes.Axes`
1497+
parent : `~matplotlib.axes.Axes`
14981498
The Axes to use as parent for placing the colorbar.
14991499
%(_make_axes_kw_doc)s
15001500
15011501
Returns
15021502
-------
1503-
cax : `~.axes.Axes`
1503+
cax : `~matplotlib.axes.Axes`
15041504
The child axes.
15051505
kwargs : dict
15061506
The reduced keyword dictionary to be passed when creating the colorbar

0 commit comments

Comments
 (0)