Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé
Module « matplotlib.pyplot »

Fonction violinplot - module matplotlib.pyplot

Signature de la fonction violinplot

def violinplot(dataset: 'ArrayLike | Sequence[ArrayLike]', positions: 'ArrayLike | None' = None, *, vert: 'bool | None' = None, orientation: "Literal['vertical', 'horizontal']" = 'vertical', widths: 'float | ArrayLike' = 0.5, showmeans: 'bool' = False, showextrema: 'bool' = True, showmedians: 'bool' = False, quantiles: 'Sequence[float | Sequence[float]] | None' = None, points: 'int' = 100, bw_method: "Literal['scott', 'silverman'] | float | Callable[[GaussianKDE], float] | None" = None, side: "Literal['both', 'low', 'high']" = 'both', data=None) -> 'dict[str, Collection]' 

Description

help(matplotlib.pyplot.violinplot)

Make a violin plot.

Make a violin plot for each column of *dataset* or each vector in
sequence *dataset*.  Each filled area extends to represent the
entire data range, with optional lines at the mean, the median,
the minimum, the maximum, and user-specified quantiles.

Parameters
----------
dataset : Array or a sequence of vectors.
    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).

vert : bool, optional
    .. deprecated:: 3.10
        Use *orientation* instead.

        If this is given during the deprecation period, it overrides
        the *orientation* parameter.

    If True, plots the violins vertically.
    If False, plots the violins horizontally.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    If 'horizontal', plots the violins horizontally.
    Otherwise, plots the violins vertically.

    .. versionadded:: 3.10

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*.

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

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

showmedians : bool, default: False
    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.

points : int, default: 100
    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.

side : {'both', 'low', 'high'}, default: 'both'
    'both' plots standard violins. 'low'/'high' only
    plots the side below/above the positions value.

data : indexable object, optional
    If given, the following parameters also accept a string ``s``, which is
    interpreted as ``data[s]`` if ``s`` is a key in ``data``:

    *dataset*

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:

    - ``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.

    - ``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.

    - ``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.

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

See Also
--------
.Axes.violin : Draw a violin from pre-computed statistics.
boxplot : Draw a box and whisker plot.

Notes
-----

.. note::

    This is the :ref:`pyplot wrapper <pyplot_interface>` for `.axes.Axes.violinplot`.


Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé