Skip to content

Commit db98e70

Browse files
committed
[Doc] Improve documentation types
1 parent 060992a commit db98e70

27 files changed

+92
-91
lines changed

lib/matplotlib/artist.py

Lines changed: 5 additions & 5 deletions
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

Lines changed: 9 additions & 8 deletions
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
"""
@@ -1609,7 +1609,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
16091609
data limits. The values are passed on to
16101610
`~.axes.Axes.autoscale_view`.
16111611
1612-
**kwargs : `.Line2D` properties, optional
1612+
**kwargs : `~matplotlib.lines.Line2D` properties, optional
16131613
*kwargs* are used to specify properties like a line label (for
16141614
auto legends), linewidth, antialiasing, marker face color.
16151615
Example::
@@ -2001,13 +2001,13 @@ def acorr(self, x, **kwargs):
20012001
20022002
- `.LineCollection` if *usevlines* is True.
20032003
- `.Line2D` if *usevlines* is False.
2004-
b : `.Line2D` or None
2004+
b : `~matplotlib.lines.Line2D` or None
20052005
Horizontal line at 0 if *usevlines* is True
20062006
None *usevlines* is False.
20072007
20082008
Other Parameters
20092009
----------------
2010-
linestyle : `.Line2D` property, optional
2010+
linestyle : `~matplotlib.lines.Line2D` property, optional
20112011
The linestyle for plotting the data points.
20122012
Only used if *usevlines* is ``False``.
20132013
@@ -2078,13 +2078,13 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
20782078
20792079
- `.LineCollection` if *usevlines* is True.
20802080
- `.Line2D` if *usevlines* is False.
2081-
b : `.Line2D` or None
2081+
b : `~matplotlib.lines.Line2D` or None
20822082
Horizontal line at 0 if *usevlines* is True
20832083
None *usevlines* is False.
20842084
20852085
Other Parameters
20862086
----------------
2087-
linestyle : `.Line2D` property, optional
2087+
linestyle : `~matplotlib.lines.Line2D` property, optional
20882088
The linestyle for plotting the data points.
20892089
Only used if *usevlines* is ``False``.
20902090
@@ -3465,7 +3465,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
34653465
`.ErrorbarContainer`
34663466
The container contains:
34673467
3468-
- plotline: `.Line2D` instance of x, y plot markers and/or line.
3468+
- plotline : `~matplotlib.lines.Line2D` instance of x, y plot markers
3469+
and/or line.
34693470
- caplines: A tuple of `.Line2D` instances of the error bar caps.
34703471
- barlinecols: A tuple of `.LineCollection` with the horizontal and
34713472
vertical error ranges.
@@ -7051,7 +7052,7 @@ def stairs(self, values, edges=None, *,
70517052
70527053
Returns
70537054
-------
7054-
StepPatch : `matplotlib.patches.StepPatch`
7055+
StepPatch : `~matplotlib.patches.StepPatch`
70557056
70567057
Other Parameters
70577058
----------------

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 4 deletions
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
@@ -3165,7 +3165,7 @@ def grid(self, visible=None, which='major', axis='both', **kwargs):
31653165
axis : {'both', 'x', 'y'}, optional
31663166
The axis to apply the changes on.
31673167
3168-
**kwargs : `.Line2D` properties
3168+
**kwargs : `~matplotlib.lines.Line2D` properties
31693169
Define the line properties of the grid, e.g.::
31703170
31713171
grid(color='r', linestyle='-', linewidth=2)
@@ -3433,7 +3433,7 @@ def set_xlabel(self, xlabel, fontdict=None, labelpad=None, *,
34333433
34343434
Other Parameters
34353435
----------------
3436-
**kwargs : `.Text` properties
3436+
**kwargs : `~matplotlib.text.Text` properties
34373437
`.Text` properties control the appearance of the label.
34383438
34393439
See Also
@@ -3681,7 +3681,7 @@ def set_ylabel(self, ylabel, fontdict=None, labelpad=None, *,
36813681
36823682
Other Parameters
36833683
----------------
3684-
**kwargs : `.Text` properties
3684+
**kwargs : `~matplotlib.text.Text` properties
36853685
`.Text` properties control the appearance of the label.
36863686
36873687
See Also

lib/matplotlib/axis.py

Lines changed: 15 additions & 15 deletions
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

Lines changed: 9 additions & 9 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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)