Skip to content

Commit 27da050

Browse files
committed
Simplify and unify Line2D referring in docstrings.
1 parent 6d93302 commit 27da050

File tree

3 files changed

+42
-56
lines changed

3 files changed

+42
-56
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,7 @@ def inset_axes(self, bounds, *, transform=None, zorder=5,
423423
parent axes.
424424
425425
**kwargs
426-
427-
Other *kwargs* are passed on to the `axes.Axes` child axes.
426+
Other keyword arguments are passed on to the `.Axes` child axes.
428427
429428
Returns
430429
-------
@@ -507,7 +506,7 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
507506
(just below the default level of inset axes).
508507
509508
**kwargs
510-
Other *kwargs* are passed on to the rectangle patch.
509+
Other keyword arguments are passed on to the rectangle patch.
511510
512511
Returns
513512
-------
@@ -592,7 +591,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):
592591
chosen so as to not overlap with the indicator box.
593592
594593
**kwargs
595-
Other *kwargs* are passed on to `.Axes.indicate_inset`
594+
Other keyword arguments are passed on to `.Axes.indicate_inset`
596595
597596
Returns
598597
-------
@@ -803,13 +802,13 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
803802
804803
Returns
805804
-------
806-
line : :class:`~matplotlib.lines.Line2D`
805+
line : a `.Line2D` instance
807806
808807
Other Parameters
809808
----------------
810809
**kwargs
811-
Valid keyword arguments are :class:`~matplotlib.lines.Line2D`
812-
properties, with the exception of 'transform':
810+
Valid keyword arguments are `.Line2D` properties, with the
811+
exception of 'transform':
813812
814813
%(_Line2D_docstr)s
815814
@@ -871,13 +870,13 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
871870
872871
Returns
873872
-------
874-
line : :class:`~matplotlib.lines.Line2D`
873+
line : a `.Line2D` instance
875874
876875
Other Parameters
877876
----------------
878877
**kwargs
879-
Valid keyword arguments are :class:`~matplotlib.lines.Line2D`
880-
properties, with the exception of 'transform':
878+
Valid keyword arguments are `.Line2D` properties, with the
879+
exception of 'transform':
881880
882881
%(_Line2D_docstr)s
883882
@@ -1685,14 +1684,13 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
16851684
Returns
16861685
-------
16871686
lines
1688-
A list of `~.Line2D` objects representing the plotted data.
1687+
A list of `.Line2D` objects representing the plotted data.
16891688
16901689
16911690
Other Parameters
16921691
----------------
16931692
**kwargs
1694-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
1695-
properties:
1693+
Keyword arguments control the `.Line2D` properties:
16961694
16971695
%(_Line2D_docstr)s
16981696
@@ -1761,7 +1759,7 @@ def loglog(self, *args, **kwargs):
17611759
Returns
17621760
-------
17631761
lines
1764-
A list of `~.Line2D` objects representing the plotted data.
1762+
A list of `.Line2D` objects representing the plotted data.
17651763
17661764
Other Parameters
17671765
----------------
@@ -1814,7 +1812,7 @@ def semilogx(self, *args, **kwargs):
18141812
Returns
18151813
-------
18161814
lines
1817-
A list of `~.Line2D` objects representing the plotted data.
1815+
A list of `.Line2D` objects representing the plotted data.
18181816
18191817
Other Parameters
18201818
----------------
@@ -1863,7 +1861,7 @@ def semilogy(self, *args, **kwargs):
18631861
Returns
18641862
-------
18651863
lines
1866-
A list of `~.Line2D` objects representing the plotted data.
1864+
A list of `.Line2D` objects representing the plotted data.
18671865
18681866
Other Parameters
18691867
----------------
@@ -3151,10 +3149,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31513149
container : :class:`~.container.ErrorbarContainer`
31523150
The container contains:
31533151
3154-
- plotline: :class:`~matplotlib.lines.Line2D` instance of
3155-
x, y plot markers and/or line.
3156-
- caplines: A tuple of :class:`~matplotlib.lines.Line2D` instances
3157-
of the error bar caps.
3152+
- plotline: `.Line2D` instance of x, y plot markers and/or line.
3153+
- caplines: A tuple of `.Line2D` instances of the error bar caps.
31583154
- barlinecols: A tuple of
31593155
:class:`~matplotlib.collections.LineCollection` with the
31603156
horizontal and vertical error ranges.
@@ -3624,9 +3620,8 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
36243620
-------
36253621
result : dict
36263622
A dictionary mapping each component of the boxplot to a list
3627-
of the :class:`matplotlib.lines.Line2D` instances
3628-
created. That dictionary has the following keys (assuming
3629-
vertical boxplots):
3623+
of the `.Line2D` instances created. That dictionary has the
3624+
following keys (assuming vertical boxplots):
36303625
36313626
- ``boxes``: the main body of the boxplot showing the
36323627
quartiles and the median's confidence intervals if
@@ -3824,9 +3819,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38243819
makes horizontal boxes.
38253820
38263821
patch_artist : bool, default = False
3827-
If `False` produces boxes with the
3828-
`~matplotlib.lines.Line2D` artist. If `True` produces boxes
3829-
with the `~matplotlib.patches.Patch` artist.
3822+
If `False` produces boxes with the `.Line2D` artist.
3823+
If `True` produces boxes with the `~matplotlib.patches.Patch` artist.
38303824
38313825
shownotches : bool, default = False
38323826
If `False` (default), produces a rectangular box plot.
@@ -3879,9 +3873,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38793873
-------
38803874
result : dict
38813875
A dictionary mapping each component of the boxplot to a list
3882-
of the :class:`matplotlib.lines.Line2D` instances
3883-
created. That dictionary has the following keys (assuming
3884-
vertical boxplots):
3876+
of the `.Line2D` instances created. That dictionary has the
3877+
following keys (assuming vertical boxplots):
38853878
38863879
- ``boxes``: the main body of the boxplot showing the
38873880
quartiles and the median's confidence intervals if
@@ -7001,15 +6994,14 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
70016994
freqs : 1-D array
70026995
The frequencies corresponding to the elements in *Pxx*.
70036996
7004-
line : a :class:`~matplotlib.lines.Line2D` instance
6997+
line : a `.Line2D` instance
70056998
The line created by this function.
70066999
Only returned if *return_line* is True.
70077000
70087001
Other Parameters
70097002
----------------
70107003
**kwargs
7011-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7012-
properties:
7004+
Keyword arguments control the `.Line2D` properties:
70137005
70147006
%(_Line2D_docstr)s
70157007
@@ -7120,15 +7112,14 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
71207112
freqs : 1-D array
71217113
The frequencies corresponding to the elements in *Pxy*.
71227114
7123-
line : a :class:`~matplotlib.lines.Line2D` instance
7115+
line : a `.Line2D` instance
71247116
The line created by this function.
71257117
Only returned if *return_line* is True.
71267118
71277119
Other Parameters
71287120
----------------
71297121
**kwargs
7130-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7131-
properties:
7122+
Keyword arguments control the `.Line2D` properties:
71327123
71337124
%(_Line2D_docstr)s
71347125
@@ -7214,14 +7205,13 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
72147205
freqs : 1-D array
72157206
The frequencies corresponding to the elements in *spectrum*.
72167207
7217-
line : a :class:`~matplotlib.lines.Line2D` instance
7208+
line : a `.Line2D` instance
72187209
The line created by this function.
72197210
72207211
Other Parameters
72217212
----------------
72227213
**kwargs
7223-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7224-
properties:
7214+
Keyword arguments control the `.Line2D` properties:
72257215
72267216
%(_Line2D_docstr)s
72277217
@@ -7302,14 +7292,13 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
73027292
freqs : 1-D array
73037293
The frequencies corresponding to the elements in *spectrum*.
73047294
7305-
line : a :class:`~matplotlib.lines.Line2D` instance
7295+
line : a `.Line2D` instance
73067296
The line created by this function.
73077297
73087298
Other Parameters
73097299
----------------
73107300
**kwargs
7311-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7312-
properties:
7301+
Keyword arguments control the `.Line2D` properties:
73137302
73147303
%(_Line2D_docstr)s
73157304
@@ -7375,14 +7364,13 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
73757364
freqs : 1-D array
73767365
The frequencies corresponding to the elements in *spectrum*.
73777366
7378-
line : a :class:`~matplotlib.lines.Line2D` instance
7367+
line : a `.Line2D` instance
73797368
The line created by this function.
73807369
73817370
Other Parameters
73827371
----------------
73837372
**kwargs
7384-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7385-
properties:
7373+
Keyword arguments control the `.Line2D` properties:
73867374
73877375
%(_Line2D_docstr)s
73887376
@@ -7456,8 +7444,7 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
74567444
Other Parameters
74577445
----------------
74587446
**kwargs
7459-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7460-
properties:
7447+
Keyword arguments control the `.Line2D` properties:
74617448
74627449
%(_Line2D_docstr)s
74637450
@@ -7651,9 +7638,9 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
76517638
**Marker style**
76527639
76537640
If *Z* is a `scipy.sparse.spmatrix` or *marker* or *markersize* are
7654-
*None*, a `~matplotlib.lines.Line2D` object will be returned with
7655-
the value of marker determining the marker type, and any
7656-
remaining kwargs passed to `~.Axes.plot`.
7641+
*None*, a `.Line2D` object will be returned with the value of marker
7642+
determining the marker type, and any remaining keyword arguments
7643+
passed to `~.Axes.plot`.
76577644
76587645
Parameters
76597646
----------

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ def _update_image_limits(self, image):
19011901

19021902
def add_line(self, line):
19031903
"""
1904-
Add a `~.Line2D` to the axes' lines; return the line.
1904+
Add a `.Line2D` to the axes' lines; return the line.
19051905
"""
19061906
self._set_artist_props(line)
19071907
if line.get_clip_path() is None:
@@ -2981,7 +2981,7 @@ def tick_params(self, axis='both', **kwargs):
29812981
grid_linewidth : float
29822982
Width of gridlines in points.
29832983
grid_linestyle : string
2984-
Any valid `~matplotlib.lines.Line2D` line style spec.
2984+
Any valid `.Line2D` line style spec.
29852985
29862986
Examples
29872987
--------

lib/matplotlib/lines.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ def is_dashed(self):
14471447
class VertexSelector:
14481448
"""
14491449
Manage the callbacks to maintain a list of selected vertices for
1450-
:class:`matplotlib.lines.Line2D`. Derived classes should override
1450+
`.Line2D`. Derived classes should override
14511451
:meth:`~matplotlib.lines.VertexSelector.process_selected` to do
14521452
something with the picks.
14531453
@@ -1477,10 +1477,9 @@ def process_selected(self, ind, xs, ys):
14771477
"""
14781478
def __init__(self, line):
14791479
"""
1480-
Initialize the class with a :class:`matplotlib.lines.Line2D`
1481-
instance. The line should already be added to some
1482-
:class:`matplotlib.axes.Axes` instance and should have the
1483-
picker property set.
1480+
Initialize the class with a `.Line2D` instance. The line should
1481+
already be added to some :class:`matplotlib.axes.Axes` instance and
1482+
should have the picker property set.
14841483
"""
14851484
if line.axes is None:
14861485
raise RuntimeError('You must first add the line to the Axes')

0 commit comments

Comments
 (0)