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

Skip to content

Commit 500153e

Browse files
committed
Improve indentation and referring of Line2D properties in docstrings.
1 parent 8d3e817 commit 500153e

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
@@ -428,7 +428,7 @@ def inset_axes(self, bounds, *, transform=None, zorder=5,
428428
parent axes.
429429
430430
**kwargs
431-
Other *kwargs* are passed on to the `~.axes.Axes` child axes.
431+
Other keyword arguments are passed on to the `.Axes` child axes.
432432
433433
Returns
434434
-------
@@ -510,7 +510,7 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
510510
(just below the default level of inset axes).
511511
512512
**kwargs
513-
Other *kwargs* are passed on to the rectangle patch.
513+
Other keyword arguments are passed on to the rectangle patch.
514514
515515
Returns
516516
-------
@@ -596,7 +596,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):
596596
chosen so as to not overlap with the indicator box.
597597
598598
**kwargs
599-
Other *kwargs* are passed on to `.Axes.indicate_inset`
599+
Other keyword arguments are passed on to `.Axes.indicate_inset`
600600
601601
Returns
602602
-------
@@ -802,15 +802,15 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
802802
803803
Returns
804804
-------
805-
line : :class:`~matplotlib.lines.Line2D`
805+
line : `~matplotlib.lines.Line2D`
806806
807807
Other Parameters
808808
----------------
809809
**kwargs
810-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
811-
with the exception of 'transform':
810+
Valid keyword arguments are `.Line2D` properties, with the
811+
exception of 'transform':
812812
813-
%(_Line2D_docstr)s
813+
%(_Line2D_docstr)s
814814
815815
See also
816816
--------
@@ -870,15 +870,15 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
870870
871871
Returns
872872
-------
873-
line : :class:`~matplotlib.lines.Line2D`
873+
line : `~matplotlib.lines.Line2D`
874874
875875
Other Parameters
876876
----------------
877877
**kwargs
878-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
879-
with the exception of 'transform':
878+
Valid keyword arguments are `.Line2D` properties, with the
879+
exception of 'transform':
880880
881-
%(_Line2D_docstr)s
881+
%(_Line2D_docstr)s
882882
883883
Examples
884884
--------
@@ -1543,7 +1543,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
15431543
15441544
Here is a list of available `.Line2D` properties:
15451545
1546-
%(_Line2D_docstr)s
1546+
%(_Line2D_docstr)s
15471547
15481548
Returns
15491549
-------
@@ -1684,16 +1684,15 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
16841684
Returns
16851685
-------
16861686
lines
1687-
A list of `~.Line2D` objects representing the plotted data.
1687+
A list of `.Line2D` objects representing the plotted data.
16881688
16891689
16901690
Other Parameters
16911691
----------------
16921692
**kwargs
1693-
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
1694-
properties:
1693+
Keyword arguments control the `.Line2D` properties:
16951694
1696-
%(_Line2D_docstr)s
1695+
%(_Line2D_docstr)s
16971696
16981697
See Also
16991698
--------
@@ -1760,7 +1759,7 @@ def loglog(self, *args, **kwargs):
17601759
Returns
17611760
-------
17621761
lines
1763-
A list of `~.Line2D` objects representing the plotted data.
1762+
A list of `.Line2D` objects representing the plotted data.
17641763
17651764
Other Parameters
17661765
----------------
@@ -1813,7 +1812,7 @@ def semilogx(self, *args, **kwargs):
18131812
Returns
18141813
-------
18151814
lines
1816-
A list of `~.Line2D` objects representing the plotted data.
1815+
A list of `.Line2D` objects representing the plotted data.
18171816
18181817
Other Parameters
18191818
----------------
@@ -1862,7 +1861,7 @@ def semilogy(self, *args, **kwargs):
18621861
Returns
18631862
-------
18641863
lines
1865-
A list of `~.Line2D` objects representing the plotted data.
1864+
A list of `.Line2D` objects representing the plotted data.
18661865
18671866
Other Parameters
18681867
----------------
@@ -3147,10 +3146,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31473146
container : :class:`~.container.ErrorbarContainer`
31483147
The container contains:
31493148
3150-
- plotline: :class:`~matplotlib.lines.Line2D` instance of
3151-
x, y plot markers and/or line.
3152-
- caplines: A tuple of :class:`~matplotlib.lines.Line2D` instances
3153-
of the error bar caps.
3149+
- plotline: `.Line2D` instance of x, y plot markers and/or line.
3150+
- caplines: A tuple of `.Line2D` instances of the error bar caps.
31543151
- barlinecols: A tuple of
31553152
:class:`~matplotlib.collections.LineCollection` with the
31563153
horizontal and vertical error ranges.
@@ -3172,7 +3169,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31723169
31733170
Valid kwargs for the marker properties are `.Lines2D` properties:
31743171
3175-
%(_Line2D_docstr)s
3172+
%(_Line2D_docstr)s
31763173
"""
31773174
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
31783175
# anything that comes in as 'None', drop so the default thing
@@ -3620,9 +3617,8 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
36203617
-------
36213618
result : dict
36223619
A dictionary mapping each component of the boxplot to a list
3623-
of the :class:`matplotlib.lines.Line2D` instances
3624-
created. That dictionary has the following keys (assuming
3625-
vertical boxplots):
3620+
of the `.Line2D` instances created. That dictionary has the
3621+
following keys (assuming vertical boxplots):
36263622
36273623
- ``boxes``: the main body of the boxplot showing the
36283624
quartiles and the median's confidence intervals if
@@ -3820,9 +3816,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38203816
makes horizontal boxes.
38213817
38223818
patch_artist : bool, default = False
3823-
If `False` produces boxes with the
3824-
`~matplotlib.lines.Line2D` artist. If `True` produces boxes
3825-
with the `~matplotlib.patches.Patch` artist.
3819+
If `False` produces boxes with the `.Line2D` artist.
3820+
If `True` produces boxes with the `~matplotlib.patches.Patch` artist.
38263821
38273822
shownotches : bool, default = False
38283823
If `False` (default), produces a rectangular box plot.
@@ -3875,9 +3870,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38753870
-------
38763871
result : dict
38773872
A dictionary mapping each component of the boxplot to a list
3878-
of the :class:`matplotlib.lines.Line2D` instances
3879-
created. That dictionary has the following keys (assuming
3880-
vertical boxplots):
3873+
of the `.Line2D` instances created. That dictionary has the
3874+
following keys (assuming vertical boxplots):
38813875
38823876
- ``boxes``: the main body of the boxplot showing the
38833877
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 : `~matplotlib.lines.Line2D`
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 : `~matplotlib.lines.Line2D`
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 : `~matplotlib.lines.Line2D`
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 : `~matplotlib.lines.Line2D`
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 : `~matplotlib.lines.Line2D`
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
@@ -1840,7 +1840,7 @@ def _update_image_limits(self, image):
18401840

18411841
def add_line(self, line):
18421842
"""
1843-
Add a `~.Line2D` to the axes' lines; return the line.
1843+
Add a `.Line2D` to the axes' lines; return the line.
18441844
"""
18451845
self._set_artist_props(line)
18461846
if line.get_clip_path() is None:
@@ -2741,9 +2741,9 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
27412741
27422742
grid(color='r', linestyle='-', linewidth=2)
27432743
2744-
Valid *kwargs* are
2744+
Valid keyword arguments are:
27452745
2746-
%(_Line2D_docstr)s
2746+
%(_Line2D_docstr)s
27472747
27482748
Notes
27492749
-----
@@ -2921,7 +2921,7 @@ def tick_params(self, axis='both', **kwargs):
29212921
grid_linewidth : float
29222922
Width of gridlines in points.
29232923
grid_linestyle : str
2924-
Any valid `~matplotlib.lines.Line2D` line style spec.
2924+
Any valid `.Line2D` line style spec.
29252925
29262926
Examples
29272927
--------

lib/matplotlib/collections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -960,12 +960,12 @@ def legend_elements(self, prop="colors", num="auto",
960960
the legend labels have the correct values;
961961
e.g. *func = np.exp(x, 10)*.
962962
kwargs : further parameters
963-
Allowed kwargs are *color* and *size*. E.g. it may be useful to
964-
set the color of the markers if *prop="sizes"* is used; similarly
965-
to set the size of the markers if *prop="colors"* is used.
966-
Any further parameters are passed onto the `.Line2D` instance.
967-
This may be useful to e.g. specify a different *markeredgecolor* or
968-
*alpha* for the legend handles.
963+
Allowed keyword arguments are *color* and *size*. E.g. it may be
964+
useful to set the color of the markers if *prop="sizes"* is used;
965+
similarly to set the size of the markers if *prop="colors"* is
966+
used. Any further parameters are passed onto the `.Line2D`
967+
instance. This may be useful to e.g. specify a different
968+
*markeredgecolor* or *alpha* for the legend handles.
969969
970970
Returns
971971
-------

0 commit comments

Comments
 (0)
0