| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.violinplot.html | [Back] [Original] |
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.
The input data. Possible values:
1D array: A single violin is drawn.
sequence of 1D arrays: A violin is drawn for each array in the sequence.
2D array: A violin is drawn for each column in the array.
Non-finite and masked values are ignored.
The positions of the violins; i.e. coordinates on the x-axis for vertical violins (or y-axis for horizontal violins).
Deprecated since version 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.
If 'horizontal', plots the violins horizontally. Otherwise, plots the violins vertically.
Added in version 3.10.
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.
Whether to show the mean with a line.
Whether to show extrema with a line.
Whether to show the median with a line.
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.
The number of points to evaluate each of the gaussian kernel density estimations at.
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.
'both' plots standard violins. 'low'/'high' only plots the side below/above the positions value.
If provided, will set the face color(s) of the violins.
Added in version 3.11.
If provided, will set the line color(s) of the violins (the horizontal and vertical spines and body edges).
Added in version 3.11.
If given, the following parameters also accept a string s, which is
interpreted as data[s] if s is a key in data:
dataset
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 PolyCollection
instances containing the filled area of each violin.
cmeans: A LineCollection instance that marks
the mean values of each of the violin's distribution.
cmins: A LineCollection instance that marks
the bottom of each violin's distribution.
cmaxes: A LineCollection instance that marks
the top of each violin's distribution.
cbars: A LineCollection instance that marks
the centers of each violin's distribution.
cmedians: A LineCollection instance that
marks the median values of each of the violin's distribution.
cquantiles: A LineCollection instance created
to identify the quantile values of each of the violin's
distribution.
See also
Axes.violinDraw a violin from pre-computed statistics.
boxplotDraw a box and whisker plot.
matplotlib.axes.Axes.violinplot#| Web Proxy Viewer | New URL | Original Page |