Skip to content

Commit 7e212f9

Browse files
committed
Improve indentation and referring of Line2D properties in docstrings.
1 parent c7ab2be commit 7e212f9

File tree

7 files changed

+79
-92
lines changed

7 files changed

+79
-92
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
-------
@@ -592,7 +592,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):
592592
chosen so as to not overlap with the indicator box.
593593
594594
**kwargs
595-
Other *kwargs* are passed on to `.Axes.indicate_inset`
595+
Other keyword arguments are passed on to `.Axes.indicate_inset`
596596
597597
Returns
598598
-------
@@ -798,15 +798,15 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
798798
799799
Returns
800800
-------
801-
line : :class:`~matplotlib.lines.Line2D`
801+
line : a `.Line2D` instance
802802
803803
Other Parameters
804804
----------------
805805
**kwargs
806-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
807-
with the exception of 'transform':
806+
Valid keyword arguments are `.Line2D` properties, with the
807+
exception of 'transform':
808808
809-
%(_Line2D_docstr)s
809+
%(_Line2D_docstr)s
810810
811811
See also
812812
--------
@@ -866,15 +866,15 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
866866
867867
Returns
868868
-------
869-
line : :class:`~matplotlib.lines.Line2D`
869+
line : a `.Line2D` instance
870870
871871
Other Parameters
872872
----------------
873873
**kwargs
874-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
875-
with the exception of 'transform':
874+
Valid keyword arguments are `.Line2D` properties, with the
875+
exception of 'transform':
876876
877-
%(_Line2D_docstr)s
877+
%(_Line2D_docstr)s
878878
879879
Examples
880880
--------
@@ -1539,7 +1539,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
15391539
15401540
Here is a list of available `.Line2D` properties:
15411541
1542-
%(_Line2D_docstr)s
1542+
%(_Line2D_docstr)s
15431543
15441544
Returns
15451545
-------
@@ -1680,16 +1680,15 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
16801680
Returns
16811681
-------
16821682
lines
1683-
A list of `~.Line2D` objects representing the plotted data.
1683+
A list of `.Line2D` objects representing the plotted data.
16841684
16851685
16861686
Other Parameters
16871687
----------------
16881688
**kwargs
1689-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
1690-
properties:
1689+
Keyword arguments control the `.Line2D` properties:
16911690
1692-
%(_Line2D_docstr)s
1691+
%(_Line2D_docstr)s
16931692
16941693
See Also
16951694
--------
@@ -1756,7 +1755,7 @@ def loglog(self, *args, **kwargs):
17561755
Returns
17571756
-------
17581757
lines
1759-
A list of `~.Line2D` objects representing the plotted data.
1758+
A list of `.Line2D` objects representing the plotted data.
17601759
17611760
Other Parameters
17621761
----------------
@@ -1809,7 +1808,7 @@ def semilogx(self, *args, **kwargs):
18091808
Returns
18101809
-------
18111810
lines
1812-
A list of `~.Line2D` objects representing the plotted data.
1811+
A list of `.Line2D` objects representing the plotted data.
18131812
18141813
Other Parameters
18151814
----------------
@@ -1858,7 +1857,7 @@ def semilogy(self, *args, **kwargs):
18581857
Returns
18591858
-------
18601859
lines
1861-
A list of `~.Line2D` objects representing the plotted data.
1860+
A list of `.Line2D` objects representing the plotted data.
18621861
18631862
Other Parameters
18641863
----------------
@@ -3143,10 +3142,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31433142
container : :class:`~.container.ErrorbarContainer`
31443143
The container contains:
31453144
3146-
- plotline: :class:`~matplotlib.lines.Line2D` instance of
3147-
x, y plot markers and/or line.
3148-
- caplines: A tuple of :class:`~matplotlib.lines.Line2D` instances
3149-
of the error bar caps.
3145+
- plotline: `.Line2D` instance of x, y plot markers and/or line.
3146+
- caplines: A tuple of `.Line2D` instances of the error bar caps.
31503147
- barlinecols: A tuple of
31513148
:class:`~matplotlib.collections.LineCollection` with the
31523149
horizontal and vertical error ranges.
@@ -3168,7 +3165,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31683165
31693166
Valid kwargs for the marker properties are `.Lines2D` properties:
31703167
3171-
%(_Line2D_docstr)s
3168+
%(_Line2D_docstr)s
31723169
"""
31733170
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
31743171
# anything that comes in as 'None', drop so the default thing
@@ -3616,9 +3613,8 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
36163613
-------
36173614
result : dict
36183615
A dictionary mapping each component of the boxplot to a list
3619-
of the :class:`matplotlib.lines.Line2D` instances
3620-
created. That dictionary has the following keys (assuming
3621-
vertical boxplots):
3616+
of the `.Line2D` instances created. That dictionary has the
3617+
following keys (assuming vertical boxplots):
36223618
36233619
- ``boxes``: the main body of the boxplot showing the
36243620
quartiles and the median's confidence intervals if
@@ -3816,9 +3812,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38163812
makes horizontal boxes.
38173813
38183814
patch_artist : bool, default = False
3819-
If `False` produces boxes with the
3820-
`~matplotlib.lines.Line2D` artist. If `True` produces boxes
3821-
with the `~matplotlib.patches.Patch` artist.
3815+
If `False` produces boxes with the `.Line2D` artist.
3816+
If `True` produces boxes with the `~matplotlib.patches.Patch` artist.
38223817
38233818
shownotches : bool, default = False
38243819
If `False` (default), produces a rectangular box plot.
@@ -3871,9 +3866,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38713866
-------
38723867
result : dict
38733868
A dictionary mapping each component of the boxplot to a list
3874-
of the :class:`matplotlib.lines.Line2D` instances
3875-
created. That dictionary has the following keys (assuming
3876-
vertical boxplots):
3869+
of the `.Line2D` instances created. That dictionary has the
3870+
following keys (assuming vertical boxplots):
38773871
38783872
- ``boxes``: the main body of the boxplot showing the
38793873
quartiles and the median's confidence intervals if
@@ -7002,17 +6996,16 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
70026996
freqs : 1-D array
70036997
The frequencies corresponding to the elements in *Pxx*.
70046998
7005-
line : a :class:`~matplotlib.lines.Line2D` instance
6999+
line : a `.Line2D` instance
70067000
The line created by this function.
70077001
Only returned if *return_line* is True.
70087002
70097003
Other Parameters
70107004
----------------
70117005
**kwargs
7012-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7013-
properties:
7006+
Keyword arguments control the `.Line2D` properties:
70147007
7015-
%(_Line2D_docstr)s
7008+
%(_Line2D_docstr)s
70167009
70177010
See Also
70187011
--------
@@ -7121,17 +7114,16 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
71217114
freqs : 1-D array
71227115
The frequencies corresponding to the elements in *Pxy*.
71237116
7124-
line : a :class:`~matplotlib.lines.Line2D` instance
7117+
line : a `.Line2D` instance
71257118
The line created by this function.
71267119
Only returned if *return_line* is True.
71277120
71287121
Other Parameters
71297122
----------------
71307123
**kwargs
7131-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7132-
properties:
7124+
Keyword arguments control the `.Line2D` properties:
71337125
7134-
%(_Line2D_docstr)s
7126+
%(_Line2D_docstr)s
71357127
71367128
See Also
71377129
--------
@@ -7215,16 +7207,15 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
72157207
freqs : 1-D array
72167208
The frequencies corresponding to the elements in *spectrum*.
72177209
7218-
line : a :class:`~matplotlib.lines.Line2D` instance
7210+
line : a `.Line2D` instance
72197211
The line created by this function.
72207212
72217213
Other Parameters
72227214
----------------
72237215
**kwargs
7224-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7225-
properties:
7216+
Keyword arguments control the `.Line2D` properties:
72267217
7227-
%(_Line2D_docstr)s
7218+
%(_Line2D_docstr)s
72287219
72297220
See Also
72307221
--------
@@ -7303,16 +7294,15 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
73037294
freqs : 1-D array
73047295
The frequencies corresponding to the elements in *spectrum*.
73057296
7306-
line : a :class:`~matplotlib.lines.Line2D` instance
7297+
line : a `.Line2D` instance
73077298
The line created by this function.
73087299
73097300
Other Parameters
73107301
----------------
73117302
**kwargs
7312-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7313-
properties:
7303+
Keyword arguments control the `.Line2D` properties:
73147304
7315-
%(_Line2D_docstr)s
7305+
%(_Line2D_docstr)s
73167306
73177307
See Also
73187308
--------
@@ -7376,16 +7366,15 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
73767366
freqs : 1-D array
73777367
The frequencies corresponding to the elements in *spectrum*.
73787368
7379-
line : a :class:`~matplotlib.lines.Line2D` instance
7369+
line : a `.Line2D` instance
73807370
The line created by this function.
73817371
73827372
Other Parameters
73837373
----------------
73847374
**kwargs
7385-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7386-
properties:
7375+
Keyword arguments control the `.Line2D` properties:
73877376
7388-
%(_Line2D_docstr)s
7377+
%(_Line2D_docstr)s
73897378
73907379
See Also
73917380
--------
@@ -7457,10 +7446,9 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
74577446
Other Parameters
74587447
----------------
74597448
**kwargs
7460-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
7461-
properties:
7449+
Keyword arguments control the `.Line2D` properties:
74627450
7463-
%(_Line2D_docstr)s
7451+
%(_Line2D_docstr)s
74647452
74657453
References
74667454
----------
@@ -7540,8 +7528,8 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
75407528
of the bins is smaller than those of the segments.
75417529
75427530
**kwargs
7543-
Additional kwargs are passed on to imshow which makes the
7544-
specgram image.
7531+
Additional keyword arguments are passed on to imshow which makes
7532+
the specgram image.
75457533
75467534
Returns
75477535
-------
@@ -7647,14 +7635,14 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
76477635
**Image style**
76487636
76497637
If *marker* and *markersize* are *None*, `~.Axes.imshow` is used. Any
7650-
extra remaining kwargs are passed to this method.
7638+
extra remaining keyword arguments are passed to this method.
76517639
76527640
**Marker style**
76537641
76547642
If *Z* is a `scipy.sparse.spmatrix` or *marker* or *markersize* are
7655-
*None*, a `~matplotlib.lines.Line2D` object will be returned with
7656-
the value of marker determining the marker type, and any
7657-
remaining kwargs passed to `~.Axes.plot`.
7643+
*None*, a `.Line2D` object will be returned with the value of marker
7644+
determining the marker type, and any remaining keyword arguments
7645+
passed to `~.Axes.plot`.
76587646
76597647
Parameters
76607648
----------
@@ -7713,7 +7701,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
77137701
For the marker style, you can pass any `.Line2D` property except
77147702
for *linestyle*:
77157703
7716-
%(_Line2D_docstr)s
7704+
%(_Line2D_docstr)s
77177705
"""
77187706
if marker is None and markersize is None and hasattr(Z, 'tocoo'):
77197707
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 : str
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)