Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Fix inconsistent spacing in some docstrings in _axes.py #28037

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 1 commit into from
Apr 7, 2024
Merged
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
264 changes: 132 additions & 132 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4176,62 +4176,62 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
Parameters
----------
bxpstats : list of dicts
A list of dictionaries containing stats for each boxplot.
Required keys are:
A list of dictionaries containing stats for each boxplot.
Required keys are:

- ``med``: Median (scalar).
- ``q1``, ``q3``: First & third quartiles (scalars).
- ``whislo``, ``whishi``: Lower & upper whisker positions (scalars).
- ``med``: Median (scalar).
- ``q1``, ``q3``: First & third quartiles (scalars).
- ``whislo``, ``whishi``: Lower & upper whisker positions (scalars).

Optional keys are:
Optional keys are:

- ``mean``: Mean (scalar). Needed if ``showmeans=True``.
- ``fliers``: Data beyond the whiskers (array-like).
Needed if ``showfliers=True``.
- ``cilo``, ``cihi``: Lower & upper confidence intervals
about the median. Needed if ``shownotches=True``.
- ``label``: Name of the dataset (str). If available,
this will be used a tick label for the boxplot
- ``mean``: Mean (scalar). Needed if ``showmeans=True``.
- ``fliers``: Data beyond the whiskers (array-like).
Needed if ``showfliers=True``.
- ``cilo``, ``cihi``: Lower & upper confidence intervals
about the median. Needed if ``shownotches=True``.
- ``label``: Name of the dataset (str). If available,
this will be used a tick label for the boxplot

positions : array-like, default: [1, 2, ..., n]
The positions of the boxes. The ticks and limits
are automatically set to match the positions.
The positions of the boxes. The ticks and limits
are automatically set to match the positions.

widths : float or array-like, default: None
The widths of the boxes. The default is
``clip(0.15*(distance between extreme positions), 0.15, 0.5)``.
The widths of the boxes. The default is
``clip(0.15*(distance between extreme positions), 0.15, 0.5)``.

capwidths : float or array-like, default: None
Either a scalar or a vector and sets the width of each cap.
The default is ``0.5*(width of the box)``, see *widths*.
Either a scalar or a vector and sets the width of each cap.
The default is ``0.5*(width of the box)``, see *widths*.

vert : bool, default: True
If `True` (default), makes the boxes vertical.
If `False`, makes horizontal boxes.
If `True` (default), makes the boxes vertical.
If `False`, makes horizontal boxes.

patch_artist : bool, default: False
If `False` produces boxes with the `.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, showmeans, showcaps, showbox, showfliers : bool
Whether to draw the CI notches, the mean value (both default to
False), the caps, the box, and the fliers (all three default to
True).
Whether to draw the CI notches, the mean value (both default to
False), the caps, the box, and the fliers (all three default to
True).

boxprops, whiskerprops, capprops, flierprops, medianprops, meanprops :\
dict, optional
Artist properties for the boxes, whiskers, caps, fliers, medians, and
means.
Artist properties for the boxes, whiskers, caps, fliers, medians, and
means.

meanline : bool, default: False
If `True` (and *showmeans* is `True`), will try to render the mean
as a line spanning the full width of the box according to
*meanprops*. Not recommended if *shownotches* is also True.
Otherwise, means will be shown as points.
If `True` (and *showmeans* is `True`), will try to render the mean
as a line spanning the full width of the box according to
*meanprops*. Not recommended if *shownotches* is also True.
Otherwise, means will be shown as points.

manage_ticks : bool, default: True
If True, the tick locations and labels will be adjusted to match the
boxplot positions.
If True, the tick locations and labels will be adjusted to match the
boxplot positions.

label : str or list of str, optional
Legend labels. Use a single string when all boxes have the same style and
Expand All @@ -4248,22 +4248,22 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
.. versionadded:: 3.9

zorder : float, default: ``Line2D.zorder = 2``
The zorder of the resulting boxplot.
The zorder of the resulting boxplot.

Returns
-------
dict
A dictionary mapping each component of the boxplot to a list
of the `.Line2D` instances created. That dictionary has the
following keys (assuming vertical boxplots):

- ``boxes``: main bodies of the boxplot showing the quartiles, and
the median's confidence intervals if enabled.
- ``medians``: horizontal lines at the median of each box.
- ``whiskers``: vertical lines up to the last non-outlier data.
- ``caps``: horizontal lines at the ends of the whiskers.
- ``fliers``: points representing data beyond the whiskers (fliers).
- ``means``: points or lines representing the means.
A dictionary mapping each component of the boxplot to a list
of the `.Line2D` instances created. That dictionary has the
following keys (assuming vertical boxplots):

- ``boxes``: main bodies of the boxplot showing the quartiles, and
the median's confidence intervals if enabled.
- ``medians``: horizontal lines at the median of each box.
- ``whiskers``: vertical lines up to the last non-outlier data.
- ``caps``: horizontal lines at the ends of the whiskers.
- ``fliers``: points representing data beyond the whiskers (fliers).
- ``means``: points or lines representing the means.

See Also
--------
Expand Down Expand Up @@ -6468,7 +6468,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,

Call signature::

ax.pcolorfast([X, Y], C, /, **kwargs)
ax.pcolorfast([X, Y], C, /, **kwargs)

This method is similar to `~.Axes.pcolor` and `~.Axes.pcolormesh`.
It's designed to provide the fastest pcolor-type plotting with the
Expand All @@ -6478,12 +6478,12 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,

.. warning::

This method is experimental. Compared to `~.Axes.pcolor` or
`~.Axes.pcolormesh` it has some limitations:
This method is experimental. Compared to `~.Axes.pcolor` or
`~.Axes.pcolormesh` it has some limitations:

- It supports only flat shading (no outlines)
- It lacks support for log scaling of the axes.
- It does not have a pyplot wrapper.
- It supports only flat shading (no outlines)
- It lacks support for log scaling of the axes.
- It does not have a pyplot wrapper.

Parameters
----------
Expand Down Expand Up @@ -8316,44 +8316,44 @@ def violinplot(self, dataset, positions=None, vert=True, widths=0.5,
Parameters
----------
dataset : Array or a sequence of vectors.
The input data.
The input data.

positions : array-like, default: [1, 2, ..., n]
The positions of the violins; i.e. coordinates on the x-axis for
vertical violins (or y-axis for horizontal violins).
The positions of the violins; i.e. coordinates on the x-axis for
vertical violins (or y-axis for horizontal violins).

vert : bool, default: True.
If true, creates a vertical violin plot.
Otherwise, creates a horizontal violin plot.
If true, creates a vertical violin plot.
Otherwise, creates a horizontal violin plot.

widths : float or array-like, default: 0.5
The maximum width of each violin in units of the *positions* axis.
The default is 0.5, which is half the available space when using default
*positions*.
The maximum width of each violin in units of the *positions* axis.
The default is 0.5, which is half the available space when using default
*positions*.

showmeans : bool, default: False
Whether to show the mean with a line.
Whether to show the mean with a line.

showextrema : bool, default: True
Whether to show extrema with a line.
Whether to show extrema with a line.

showmedians : bool, default: False
Whether to show the median with a line.
Whether to show the median with a line.

quantiles : array-like, default: None
If not None, set a list of floats in interval [0, 1] for each violin,
which stands for the quantiles that will be rendered for that
violin.
If not None, set a list of floats in interval [0, 1] for each violin,
which stands for the quantiles that will be rendered for that
violin.

points : int, default: 100
The number of points to evaluate each of the gaussian kernel density
estimations at.
The number of points to evaluate each of the gaussian kernel density
estimations at.

bw_method : {'scott', 'silverman'} or float or callable, default: 'scott'
The method used to calculate the estimator bandwidth. If a
float, this will be used directly as `kde.factor`. If a
callable, it should take a `matplotlib.mlab.GaussianKDE` instance as
its only parameter and return a float.
The method used to calculate the estimator bandwidth. If a
float, this will be used directly as `kde.factor`. If a
callable, it should take a `matplotlib.mlab.GaussianKDE` instance as
its only parameter and return a float.

side : {'both', 'low', 'high'}, default: 'both'
'both' plots standard violins. 'low'/'high' only
Expand All @@ -8365,31 +8365,31 @@ def violinplot(self, dataset, positions=None, vert=True, widths=0.5,
Returns
-------
dict
A dictionary mapping each component of the violinplot to a
list of the corresponding collection instances created. The
dictionary has the following keys:
A dictionary mapping each component of the violinplot to a
list of the corresponding collection instances created. The
dictionary has the following keys:

- ``bodies``: A list of the `~.collections.PolyCollection`
instances containing the filled area of each violin.
- ``bodies``: A list of the `~.collections.PolyCollection`
instances containing the filled area of each violin.

- ``cmeans``: A `~.collections.LineCollection` instance that marks
the mean values of each of the violin's distribution.
- ``cmeans``: A `~.collections.LineCollection` instance that marks
the mean values of each of the violin's distribution.

- ``cmins``: A `~.collections.LineCollection` instance that marks
the bottom of each violin's distribution.
- ``cmins``: A `~.collections.LineCollection` instance that marks
the bottom of each violin's distribution.

- ``cmaxes``: A `~.collections.LineCollection` instance that marks
the top of each violin's distribution.
- ``cmaxes``: A `~.collections.LineCollection` instance that marks
the top of each violin's distribution.

- ``cbars``: A `~.collections.LineCollection` instance that marks
the centers of each violin's distribution.
- ``cbars``: A `~.collections.LineCollection` instance that marks
the centers of each violin's distribution.

- ``cmedians``: A `~.collections.LineCollection` instance that
marks the median values of each of the violin's distribution.
- ``cmedians``: A `~.collections.LineCollection` instance that
marks the median values of each of the violin's distribution.

- ``cquantiles``: A `~.collections.LineCollection` instance created
to identify the quantile values of each of the violin's
distribution.
- ``cquantiles``: A `~.collections.LineCollection` instance created
to identify the quantile values of each of the violin's
distribution.

See Also
--------
Expand Down Expand Up @@ -8424,50 +8424,50 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
Parameters
----------
vpstats : list of dicts
A list of dictionaries containing stats for each violin plot.
Required keys are:
A list of dictionaries containing stats for each violin plot.
Required keys are:

- ``coords``: A list of scalars containing the coordinates that
the violin's kernel density estimate were evaluated at.
- ``coords``: A list of scalars containing the coordinates that
the violin's kernel density estimate were evaluated at.

- ``vals``: A list of scalars containing the values of the
kernel density estimate at each of the coordinates given
in *coords*.
- ``vals``: A list of scalars containing the values of the
kernel density estimate at each of the coordinates given
in *coords*.

- ``mean``: The mean value for this violin's dataset.
- ``mean``: The mean value for this violin's dataset.

- ``median``: The median value for this violin's dataset.
- ``median``: The median value for this violin's dataset.

- ``min``: The minimum value for this violin's dataset.
- ``min``: The minimum value for this violin's dataset.

- ``max``: The maximum value for this violin's dataset.
- ``max``: The maximum value for this violin's dataset.

Optional keys are:
Optional keys are:

- ``quantiles``: A list of scalars containing the quantile values
for this violin's dataset.
- ``quantiles``: A list of scalars containing the quantile values
for this violin's dataset.

positions : array-like, default: [1, 2, ..., n]
The positions of the violins; i.e. coordinates on the x-axis for
vertical violins (or y-axis for horizontal violins).
The positions of the violins; i.e. coordinates on the x-axis for
vertical violins (or y-axis for horizontal violins).

vert : bool, default: True.
If true, plots the violins vertically.
Otherwise, plots the violins horizontally.
If true, plots the violins vertically.
Otherwise, plots the violins horizontally.

widths : float or array-like, default: 0.5
The maximum width of each violin in units of the *positions* axis.
The default is 0.5, which is half available space when using default
*positions*.
The maximum width of each violin in units of the *positions* axis.
The default is 0.5, which is half available space when using default
*positions*.

showmeans : bool, default: False
Whether to show the mean with a line.
Whether to show the mean with a line.

showextrema : bool, default: True
Whether to show extrema with a line.
Whether to show extrema with a line.

showmedians : bool, default: False
Whether to show the median with a line.
Whether to show the median with a line.

side : {'both', 'low', 'high'}, default: 'both'
'both' plots standard violins. 'low'/'high' only
Expand All @@ -8476,31 +8476,31 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
Returns
-------
dict
A dictionary mapping each component of the violinplot to a
list of the corresponding collection instances created. The
dictionary has the following keys:
A dictionary mapping each component of the violinplot to a
list of the corresponding collection instances created. The
dictionary has the following keys:

- ``bodies``: A list of the `~.collections.PolyCollection`
instances containing the filled area of each violin.
- ``bodies``: A list of the `~.collections.PolyCollection`
instances containing the filled area of each violin.

- ``cmeans``: A `~.collections.LineCollection` instance that marks
the mean values of each of the violin's distribution.
- ``cmeans``: A `~.collections.LineCollection` instance that marks
the mean values of each of the violin's distribution.

- ``cmins``: A `~.collections.LineCollection` instance that marks
the bottom of each violin's distribution.
- ``cmins``: A `~.collections.LineCollection` instance that marks
the bottom of each violin's distribution.

- ``cmaxes``: A `~.collections.LineCollection` instance that marks
the top of each violin's distribution.
- ``cmaxes``: A `~.collections.LineCollection` instance that marks
the top of each violin's distribution.

- ``cbars``: A `~.collections.LineCollection` instance that marks
the centers of each violin's distribution.
- ``cbars``: A `~.collections.LineCollection` instance that marks
the centers of each violin's distribution.

- ``cmedians``: A `~.collections.LineCollection` instance that
marks the median values of each of the violin's distribution.
- ``cmedians``: A `~.collections.LineCollection` instance that
marks the median values of each of the violin's distribution.

- ``cquantiles``: A `~.collections.LineCollection` instance created
to identify the quantiles values of each of the violin's
distribution.
- ``cquantiles``: A `~.collections.LineCollection` instance created
to identify the quantiles values of each of the violin's
distribution.

See Also
--------
Expand Down