8000 Improve indentation and referring of Line2D properties in docstrings. · matplotlib/matplotlib@a243188 · GitHub
[go: up one dir, main page]

Skip to content

Commit a243188

Browse files
committed
Improve indentation and referring of Line2D properties in docstrings.
1 parent a9ca0f5 commit a243188

File tree

8 files changed

+80
-93
lines changed

8 files changed

+80
-93
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 51 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def inset_axes(self, bounds, *, transform=None, zorder=5,
424424
parent axes.
425425
426426
**kwargs
427-
Other *kwargs* are passed on to the `~.axes.Axes` child axes.
427+
Other keyword arguments are passed on to the `.Axes` child axes.
428428
429429
Returns
430430
-------
@@ -506,7 +506,7 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
506506
(just below the default level of inset axes).
507507
508508
**kwargs
509-
Other *kwargs* are passed on to the rectangle patch.
509+
Other keyword arguments are passed on to the rectangle patch.
510510
511511
Returns
512512
-------
@@ -593,7 +593,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):
593593
chosen so as to not overlap with the indicator box.
594594
595595
**kwargs
596-
Other *kwargs* are passed on to `.Axes.indicate_inset`
596+
Other keyword arguments are passed on to `.Axes.indicate_inset`
597597
598598
Returns
599599
-------
@@ -804,15 +804,15 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
804804
805805
Returns
806806
-------
807-
line : :class:`~matplotlib.lines.Line2D`
807+
line : a `.Line2D` instance
808808
809809
Other Parameters
810810
----------------
811811
**kwargs
812-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
813-
with the exception of 'transform':
812+
Valid keyword arguments are `.Line2D` properties, with the
813+
exception of 'transform':
814814
815-
%(_Line2D_docstr)s
815+
%(_Line2D_docstr)s
816816
817817
See also
818818
--------
@@ -872,15 +872,15 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
872872
873873
Returns
874874
-------
875-
line : :class:`~matplotlib.lines.Line2D`
875+
line : a `.Line2D` instance
876876
877877
Other Parameters
878878
----------------
879879
**kwargs
880-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
881-
with the exception of 'transform':
880+
Valid keyword arguments are `.Line2D` properties, with the
881+
exception of 'transform':
882882
883-
%(_Line2D_docstr)s
883+
%(_Line2D_docstr)s
884884
885885
Examples
886886
--------
@@ -1545,7 +1545,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
15451545
15461546
Here is a list of available `.Line2D` properties:
15471547
1548-
%(_Line2D_docstr)s
1548+
%(_Line2D_docstr)s
15491549
15501550
Returns
15511551
-------
@@ -1686,16 +1686,15 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
16861686
Returns
16871687
-------
16881688
lines
1689-
A list of `~.Line2D` objects representing the plotted data.
1689+
A list of `.Line2D` objects representing the plotted data.
16901690
16911691
16921692
Other Parameters
16931693
----------------
16941694
**kwargs
1695-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
1696-
properties:
1695+
Keyword arguments control the `.Line2D` properties:
16971696
1698-
%(_Line2D_docstr)s
1697+
%(_Line2D_docstr)s
16991698
17001699
See Also
17011700
--------
@@ -1762,7 +1761,7 @@ def loglog(self, *args, **kwargs):
17621761
Returns
17631762
-------
17641763
lines
1765-
A list of `~.Line2D` objects representing the plotted data.
1764+
A list of `.Line2D` objects representing the plotted data.
17661765
17671766
Other Parameters
17681767
----------------
@@ -1815,7 +1814,7 @@ def semilogx(self, *args, **kwargs):
18151814
Returns
18161815
-------
18171816
lines
1818-
A list of `~.Line2D` objects representing the plotted data.
1817+
A list of `.Line2D` objects representing the plotted data.
18191818
18201819
Other Parameters
18211820
----------------
@@ -1864,7 +1863,7 @@ def semilogy(self, *args, **kwargs):
18641863
Returns
18651864
-------
18661865
lines
1867-
A list of `~.Line2D` objects representing the plotted data.
1866+
A list of `.Line2D` objects representing the plotted data.
18681867
18691868
Other Parameters
18701869
----------------
@@ -3149,10 +3148,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31493148
container : :class:`~.container.ErrorbarContainer`
31503149
The container contains:
31513150
3152-
- plotline: :class:`~matplotlib.lines.Line2D` instance of
3153-
x, y plot markers and/or line.
3154-
- caplines: A tuple of :class:`~matplotlib.lines.Line2D` instances
3155-
of the error bar caps.
3151+
- plotline: `.Line2D` instance of x, y plot markers and/or line.
3152+
- caplines: A tuple of `.Line2D` instances of the error bar caps.
31563153
- barlinecols: A tuple of
31573154
:class:`~matplotlib.collections.LineCollection` with the
31583155
horizontal and vertical error ranges.
@@ -3174,7 +3171,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31743171
31753172
Valid kwargs for the marker properties are `.Lines2D` properties:
31763173
3177-
%(_Line2D_docstr)s
3174+
%(_Line2D_docstr)s
31783175
"""
31793176
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
31803177
# anything that comes in as 'None', drop so the default thing
@@ -3622,9 +3619,8 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
36223619
-------
36233620
result : dict
36243621
A dictionary mapping each component of the boxplot to a list
3625-
of the :class:`matplotlib.lines.Line2D` instances
3626-
created. That dictionary has the following keys (assuming
3627-
vertical boxplots):
3622+
of the `.Line2D` instances created. That dictionary has the
3623+
following keys (assuming vertical boxplots):
36283624
36293625
- ``boxes``: the main body of the boxplot showing the
36303626
quartiles and the median's confidence intervals if
@@ -3822,9 +3818,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38223818
makes horizontal boxes.
38233819
38243820
patch_artist : bool, default = False
3825-
If `False` produces boxes with the
3826-
`~matplotlib.lines.Line2D` artist. If `True` produces boxes
3827-
with the `~matplotlib.patches.Patch` artist.
3821+
If `False` produces boxes with the `.Line2D` artist.
3822+
If `True` produces boxes with the `~matplotlib.patches.Patch` artist.
38283823
38293824
shownotches : bool, default = False
38303825
If `False` (default), produces a rectangular box plot.
@@ -3877,9 +3872,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38773872
-------
38783873
result : dict
38793874
A dictionary mapping each component of the boxplot to a list
3880-
of the :class:`matplotlib.lines.Line2D` instances
3881-
created. That dictionary has the following keys (assuming
3882-
vertical boxplots):
3875+
of the `.Line2D` instances created. That dictionary has the
3876+
following keys (assuming vertical boxplots):
38833877
38843878
- ``boxes``: the main body of the boxplot showing the
38853879
quartiles and the median's confidence intervals if
@@ -7008,17 +7002,16 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
70087002
freqs : 1-D array
70097003
The frequencies corresponding to the elements in *Pxx*.
70107004
7011-
line : a :class:`~matplotlib.lines.Line2D` instance
7005+
line : a `.Line2D` instance
70127006
The line created by this function.
70137007
Only returned if *return_line* is True.
70147008
70157009
Other Parameters
70167010
----------------
70177011
**kwargs
7018-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7019-
properties:
7012+
Keyword arguments control the `.Line2D` properties:
70207013
7021-
%(_Line2D_docstr)s
7014+
%(_Line2D_docstr)s
70227015
70237016
See Also
70247017
--------
@@ -7127,17 +7120,16 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
71277120
freqs : 1-D array
71287121
The frequencies corresponding to the elements in *Pxy*.
71297122
7130-
line : a :class:`~matplotlib.lines.Line2D` instance
7123+
line : a `.Line2D` instance
71317124
The line created by this function.
71327125
Only returned if *return_line* is True.
71337126
71347127
Other Parameters
71357128
----------------
71367129
**kwargs
7137-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7138-
properties:
7130+
Keyword arguments control the `.Line2D` properties:
71397131
7140-
%(_Line2D_docstr)s
7132+
%(_Line2D_docstr)s
71417133
71427134
See Also
71437135
--------
@@ -7221,16 +7213,15 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
72217213
freqs : 1-D array
72227214
The frequencies corresponding to the elements in *spectrum*.
72237215
7224-
line : a :class:`~matplotlib.lines.Line2D` instance
7216+
line : a `.Line2D` instance
72257217
The line created by this function.
72267218
72277219
Other Parameters
72287220
----------------
72297221
**kwargs
7230-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7231-
properties:
7222+
Keyword arguments control the `.Line2D` properties:
72327223
7233-
%(_Line2D_docstr)s
7224+
%(_Line2D_docstr)s
72347225
72357226
See Also
72367227
--------
@@ -7309,16 +7300,15 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
73097300
freqs : 1-D array
73107301
The frequencies corresponding to the elements in *spectrum*.
73117302
7312-
line : a :class:`~matplotlib.lines.Line2D` instance
7303+
line : a `.Line2D` instance
73137304
The line created by this function.
73147305
73157306
Other Parameters
73167307
----------------
73177308
**kwargs
7318-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7319-
properties:
7309+
Keyword arguments control the `.Line2D` properties:
73207310
7321-
%(_Line2D_docstr)s
7311+
%(_Line2D_docstr)s
73227312
73237313
See Also
73247314
--------
@@ -7382,16 +7372,15 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
73827372
freqs : 1-D array
73837373
The frequencies corresponding to the elements in *spectrum*.
73847374
7385-
line : a :class:`~matplotlib.lines.Line2D` instance
7375+
line : a `.Line2D` instance
73867376
The line created by this function.
73877377
73887378
Other Parameters
73897379
----------------
73907380
**kwargs
7391-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7392-
properties:
7381+
Keyword arguments control the `.Line2D` properties:
73937382
7394-
%(_Line2D_docstr)s
7383+
%(_Line2D_docstr)s
73957384
73967385
See Also
73977386
--------
@@ -7463,10 +7452,9 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
74637452
Other Parameters
74647453
----------------
74657454
**kwargs
7466-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7467-
properties:
7455+
Keyword arguments control the `.Line2D` properties:
74687456
7469-
%(_Line2D_docstr)s
7457+
%(_Line2D_docstr)s
74707458
74717459
References
74727460
----------
@@ -7546,8 +7534,8 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
75467534
of the bins is smaller than those of the segments.
75477535
75487536
**kwargs
7549-
Additional kwargs are passed on to imshow which makes the
7550-
specgram image.
7537+
Additional keyword arguments are passed on to imshow which makes
7538+
the specgram image.
75517539
75527540
Returns
75537541
-------
@@ -7653,14 +7641,14 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
76537641
**Image style**
76547642
76557643
If *marker* and *markersize* are *None*, `~.Axes.imshow` is used. Any
7656-
extra remaining kwargs are passed to this method.
7644+
extra remaining keyword arguments are passed to this method.
76577645
76587646
**Marker style**
76597647
76607648
If *Z* is a `scipy.sparse.spmatrix` or *marker* or *markersize* are
7661-
*None*, a `~matplotlib.lines.Line2D` object will be returned with
7662-
the value of marker determining the marker type, and any
7663-
remaining kwargs passed to `~.Axes.plot`.
7649+
*None*, a `.Line2D` object will be returned with the value of marker
7650+
determining the marker type, and any remaining keyword arguments
7651+
passed to `~.Axes.plot`.
76647652
76657653
Parameters
76667654
----------
@@ -7719,7 +7707,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
77197707
For the marker style, you can pass any `.Line2D` property except
77207708
for *linestyle*:
77217709
7722-
%(_Line2D_docstr)s
7710+
%(_Line2D_docstr)s
77237711
"""
77247712
if marker is None and markersize is None and hasattr(Z, 'tocoo'):
77257713
marker = 's'

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ def _update_image_limits(self, image):
18381838

18391839
def add_line(self, line):
18401840
"""
1841-
Add a `~.Line2D` to the axes' lines; return the line.
1841+
Add a `.Line2D` to the axes' lines; return the line.
18421842
"""
18431843
self._set_artist_props(line)
18441844
if line.get_clip_path() is None:
@@ -2739,9 +2739,9 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
27392739
27402740
grid(color='r', linestyle='-', linewidth=2)
27412741
2742-
Valid *kwargs* are
2742+
Valid keyword arguments are:
27432743
2744-
%(_Line2D_docstr)s
2744+
%(_Line2D_docstr)s
27452745
27462746
Notes
27472747
-----
@@ -2925,7 +2925,7 @@ def tick_params(self, axis='both', **kwargs):
29252925
grid_linewidth : float
29262926
Width of gridlines in points.
29272927
grid_linestyle : string
2928-
Any valid `~matplotlib.lines.Line2D` line style spec.
2928+
Any valid `.Line2D` line style spec.
29292929
29302930
Examples
29312931
--------

lib/matplotlib/collections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -919,12 +919,12 @@ def legend_elements(self, prop="colors", num="auto",
919919
the legend labels have the correct values;
920920
e.g. *func = np.exp(x, 10)*.
921921
kwargs : further parameters
922-
Allowed kwargs are *color* and *size*. E.g. it may be useful to
923-
set the color of the markers if *prop="sizes"* is used; similarly
924-
to set the size of the markers if *prop="colors"* is used.
925-
Any further parameters are passed onto the `.Line2D` instance.
926-
This may be useful to e.g. specify a different *markeredgecolor* or
927-
*alpha* for the legend handles.
922+
Allowed keyword arguments are *color* and *size*. E.g. it may be
923+
useful to set the color of the markers if *prop="sizes"* is used;
924+
similarly to set the size of the markers if *prop="colors"* is
925+
used. Any further parameters are passed onto the `.Line2D`
926+
instance. This may be useful to e.g. specify a different
927+
*markeredgecolor* or *alpha* for the legend handles.
928928
929929
Returns
930930
-------

0 commit comments

Comments
 (0)
0