8000 Improve indentation of Line2D properties in docstrings. by bingyao · Pull Request #14739 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Improve indentation of Line2D properties in docstrings. #14739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 51 additions & 63 deletions lib/matplotlib/axes/_axes.py
8000 6DAF
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def inset_axes(self, bounds, *, transform=None, zorder=5,
parent axes.

**kwargs
Other *kwargs* are passed on to the `~.axes.Axes` child axes.
Other keyword arguments are passed on to the `.Axes` child axes.

Returns
-------
Expand Down Expand Up @@ -510,7 +510,7 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
(just below the default level of inset axes).

**kwargs
Other *kwargs* are passed on to the rectangle patch.
Other keyword arguments are passed on to the rectangle patch.

Returns
-------
Expand Down Expand Up @@ -596,7 +596,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):
chosen so as to not overlap with the indicator box.

**kwargs
Other *kwargs* are passed on to `.Axes.indicate_inset`
Other keyword arguments are passed on to `.Axes.indicate_inset`

Returns
-------
Expand Down Expand Up @@ -802,15 +802,15 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):

Returns
-------
line : :class:`~matplotlib.lines.Line2D`
line : `~matplotlib.lines.Line2D`

Other Parameters
----------------
**kwargs
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
with the exception of 'transform':
Valid keyword arguments are `.Line2D` properties, with the
exception of 'transform':

%(_Line2D_docstr)s
%(_Line2D_docstr)s

See also
--------
Expand Down Expand Up @@ -870,15 +870,15 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):

Returns
-------
line : :class:`~matplotlib.lines.Line2D`
line : `~matplotlib.lines.Line2D`

Other Parameters
----------------
**kwargs
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,
with the exception of 'transform':
Valid keyword arguments are `.Line2D` properties, with the
exception of 'transform':

%(_Line2D_docstr)s
%(_Line2D_docstr)s

Examples
--------
Expand Down Expand Up @@ -1543,7 +1543,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):

Here is a list of available `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

Returns
-------
Expand Down Expand Up @@ -1684,16 +1684,15 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
Returns
-------
lines
A list of `~.Line2D` objects representing the plotted data.
A list of `.Line2D` objects representing the plotted data.


Other Parameters
----------------
**kwargs
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
properties:
Keyword arguments control the `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

See Also
--------
Expand Down Expand Up @@ -1760,7 +1759,7 @@ def loglog(self, *args, **kwargs):
Returns
-------
lines
A list of `~.Line2D` objects representing the plotted data.
A list of `.Line2D` objects representing the plotted data.

Other Parameters
----------------
Expand Down Expand Up @@ -1813,7 +1812,7 @@ def semilogx(self, *args, **kwargs):
Returns
-------
lines
A list of `~.Line2D` objects representing the plotted data.
A list of `.Line2D` objects representing the plotted data.

Other Parameters
----------------
Expand Down Expand Up @@ -1862,7 +1861,7 @@ def semilogy(self, *args, **kwargs):
Returns
-------
lines
A list of `~.Line2D` objects representing the plotted data.
A list of `.Line2D` objects representing the plotted data.

Other Parameters
----------------
Expand Down Expand Up @@ -3147,10 +3146,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
container : :class:`~.container.ErrorbarContainer`
The container contains:

- plotline: :class:`~matplotlib.lines.Line2D` instance of
x, y plot markers and/or line.
- caplines: A tuple of :class:`~matplotlib.lines.Line2D` instances
of the error bar caps.
- plotline: `.Line2D` instance of x, y plot markers and/or line.
- caplines: A tuple of `.Line2D` instances of the error bar caps.
- barlinecols: A tuple of
:class:`~matplotlib.collections.LineCollection` with the
horizontal and vertical error ranges.
Expand All @@ -3172,7 +3169,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,

Valid kwargs for the marker properties are `.Lines2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s
"""
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
# anything that comes in as 'None', drop so the default thing
Expand Down Expand Up @@ -3620,9 +3617,8 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
-------
result : dict
A dictionary mapping each component of the boxplot to a list
of the :class:`matplotlib.lines.Line2D` instances
created. That dictionary has the following keys (assuming
vertical boxplots):
of the `.Line2D` instances created. That dictionary has the
following keys (assuming vertical boxplots):

- ``boxes``: the main body of the boxplot showing the
quartiles and the median's confidence intervals if
Expand Down Expand Up @@ -3820,9 +3816,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
makes horizontal boxes.

patch_artist : bool, default = False
If `False` produces boxes with the
`~matplotlib.lines.Line2D` artist. If `True` produces boxes
with the `~matplotlib.patches.Patch` artist.
If `False` produces boxes with the `.Line2D` artist.
If `True` produces boxes with the `~matplotlib.patches.Patch` artist.

shownotches : bool, default = False
If `False` (default), produces a rectangular box plot.
Expand Down Expand Up @@ -3875,9 +3870,8 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
-------
result : dict
A dictionary mapping each component of the boxplot to a list
of the :class:`matplotlib.lines.Line2D` instances
created. That dictionary has the following keys (assuming
vertical boxplots):
of the `.Line2D` instances created. That dictionary has the
following keys (assuming vertical boxplots):

- ``boxes``: the main body of the boxplot showing the
quartiles and the median's confidence intervals if
Expand Down Expand Up @@ -7008,17 +7002,16 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
freqs : 1-D array
The frequencies corresponding to the elements in *Pxx*.

line : a :class:`~matplotlib.lines.Line2D` instance
line : `~matplotlib.lines.Line2D`
The line created by this function.
Only returned if *return_line* is True.

Other Parameters
----------------
**kwargs
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
properties:
Keyword arguments control the `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

See Also
--------
Expand Down Expand Up @@ -7127,17 +7120,16 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
freqs : 1-D array
The frequencies corresponding to the elements in *Pxy*.

line : a :class:`~matplotlib.lines.Line2D` instance
line : `~matplotlib.lines.Line2D`
The line created by this function.
Only returned if *return_line* is True.

Other Parameters
----------------
**kwargs
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
properties:
Keyword arguments control the `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

See Also
--------
Expand Down Expand Up @@ -7221,16 +7213,15 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
freqs : 1-D array
The frequencies corresponding to the elements in *spectrum*.

line : a :class:`~matplotlib.lines.Line2D` instance
line : `~matplotlib.lines.Line2D`
The line created by this function.

Other Parameters
----------------
**kwargs
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
properties:
Keyword arguments control the `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

See Also
--------
Expand Down Expand Up @@ -7309,16 +7300,15 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
freqs : 1-D array
The frequencies corresponding to the elements in *spectrum*.

line : a :class:`~matplotlib.lines.Line2D` instance
line : `~matplotlib.lines.Line2D`
The line created by this function.

Other Parameters
----------------
**kwargs
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
properties:
Keyword arguments control the `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

See Also
--------
Expand Down Expand Up @@ -7382,16 +7372,15 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
freqs : 1-D array
The frequencies corresponding to the elements in *spectrum*.

line : a :class:`~matplotlib.lines.Line2D` instance
line : `~matplotlib.lines.Line2D`
The line created by this function.

Other Parameters
----------------
**kwargs
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
properties:
Keyword arguments control the `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

See Also
--------
Expand Down Expand Up @@ -7463,10 +7452,9 @@ def cohere F438 (self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
Other Parameters
----------------
**kwargs
Keyword arguments control the :class:`~matplotlib.lines.Line2D`
properties:
Keyword arguments control the `.Line2D` properties:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

References
----------
Expand Down Expand Up @@ -7546,8 +7534,8 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
of the bins is smaller than those of the segments.

**kwargs
Additional kwargs are passed on to imshow which makes the
specgram image.
Additional keyword arguments are passed on to imshow which makes
the specgram image.

Returns
-------
Expand Down Expand Up @@ -7653,14 +7641,14 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
**Image style**

If *marker* and *markersize* are *None*, `~.Axes.imshow` is used. Any
extra remaining kwargs are passed to this method.
extra remaining keyword arguments are passed to this method.

**Marker style**

If *Z* is a `scipy.sparse.spmatrix` or *marker* or *markersize* are
*None*, a `~matplotlib.lines.Line2D` object will be returned with
the value of marker determining the marker type, and any
remaining kwargs passed to `~.Axes.plot`.
*None*, a `.Line2D` object will be returned with the value of marker
determining the marker type, and any remaining keyword arguments
passed to `~.Axes.plot`.

Parameters
----------
Expand Down Expand Up @@ -7719,7 +7707,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
For the marker style, you can pass any `.Line2D` property except
for *linestyle*:

%(_Line2D_docstr)s
%(_Line2D_docstr)s
"""
if marker is None and markersize is None and hasattr(Z, 'tocoo'):
marker = 's'
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ def _update_image_limits(self, image):

def add_line(self, line):
"""
Add a `~.Line2D` to the axes' lines; return the line.
Add a `.Line2D` to the axes' lines; return the line.
"""
self._set_artist_props(line)
if line.get_clip_path() is None:
Expand Down Expand Up @@ -2741,9 +2741,9 @@ def grid(self, b=None, which='major', axis='both', **kwargs):

grid(color='r', linestyle='-', linewidth=2)

Valid *kwargs* are
Valid keyword arguments are:

%(_Line2D_docstr)s
%(_Line2D_docstr)s

Notes
-----
Expand Down Expand Up @@ -2921,7 +2921,7 @@ def tick_params(self, axis='both', **kwargs):
grid_linewidth : float
Width of gridlines in points.
grid_linestyle : str
Any valid `~matplotlib.lines.Line2D` line style spec.
Any valid `.Line2D` line style spec.

Examples
--------
Expand Down
12 changes: 6 additions & 6 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,12 +960,12 @@ def legend_elements(self, prop="colors", num="auto",
the legend labels have the correct values;
e.g. *func = np.exp(x, 10)*.
kwargs : further parameters
Allowed kwargs are *color* and *size*. E.g. it may be useful to
set the color of the markers if *prop="sizes"* is used; similarly
to set the size of the markers if *prop="colors"* is used.
Any further parameters are passed onto the `.Line2D` instance.
This may be useful to e.g. specify a different *markeredgecolor* or
*alpha* for the legend handles.
Allowed keyword arguments are *color* and *size*. E.g. it may be
useful to set the color of the markers if *prop="sizes"* is used;
similarly to set the size of the markers if *prop="colors"* is
used. Any further parameters are passed onto the `.Line2D`
instance. This may be useful to e.g. specify a different
*markeredgecolor* or *alpha* for the legend handles.

Returns
-------
Expand Down
Loading
0