Draw a violin plot from pre-computed statistics. Draw a violin plot for each column of *vpstats*. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, the maximum, and the quantiles values. P
(self, vpstats, positions=None, vert=None,
orientation='vertical', widths=0.5, showmeans=False,
showextrema=True, showmedians=False, side='both',
facecolor=None, linecolor=None)
| 8997 | |
| 8998 | @_api.make_keyword_only("3.10", "vert") |
| 8999 | def violin(self, vpstats, positions=None, vert=None, |
| 9000 | orientation='vertical', widths=0.5, showmeans=False, |
| 9001 | showextrema=True, showmedians=False, side='both', |
| 9002 | facecolor=None, linecolor=None): |
| 9003 | """ |
| 9004 | Draw a violin plot from pre-computed statistics. |
| 9005 | |
| 9006 | Draw a violin plot for each column of *vpstats*. Each filled area |
| 9007 | extends to represent the entire data range, with optional lines at the |
| 9008 | mean, the median, the minimum, the maximum, and the quantiles values. |
| 9009 | |
| 9010 | Parameters |
| 9011 | ---------- |
| 9012 | vpstats : list of dicts |
| 9013 | A list of dictionaries containing stats for each violin plot. |
| 9014 | Required keys are: |
| 9015 | |
| 9016 | - ``coords``: A list of scalars containing the coordinates that |
| 9017 | the violin's kernel density estimate were evaluated at. |
| 9018 | |
| 9019 | - ``vals``: A list of scalars containing the values of the |
| 9020 | kernel density estimate at each of the coordinates given |
| 9021 | in *coords*. |
| 9022 | |
| 9023 | - ``mean``: The mean value for this violin's dataset. |
| 9024 | |
| 9025 | - ``median``: The median value for this violin's dataset. |
| 9026 | |
| 9027 | - ``min``: The minimum value for this violin's dataset. |
| 9028 | |
| 9029 | - ``max``: The maximum value for this violin's dataset. |
| 9030 | |
| 9031 | Optional keys are: |
| 9032 | |
| 9033 | - ``quantiles``: A list of scalars containing the quantile values |
| 9034 | for this violin's dataset. |
| 9035 | |
| 9036 | positions : array-like, default: [1, 2, ..., n] |
| 9037 | The positions of the violins; i.e. coordinates on the x-axis for |
| 9038 | vertical violins (or y-axis for horizontal violins). |
| 9039 | |
| 9040 | vert : bool, optional |
| 9041 | .. deprecated:: 3.10 |
| 9042 | Use *orientation* instead. |
| 9043 | |
| 9044 | If this is given during the deprecation period, it overrides |
| 9045 | the *orientation* parameter. |
| 9046 | |
| 9047 | If True, plots the violins vertically. |
| 9048 | If False, plots the violins horizontally. |
| 9049 | |
| 9050 | orientation : {'vertical', 'horizontal'}, default: 'vertical' |
| 9051 | If 'horizontal', plots the violins horizontally. |
| 9052 | Otherwise, plots the violins vertically. |
| 9053 | |
| 9054 | .. versionadded:: 3.10 |
| 9055 | |
| 9056 | widths : float or array-like, default: 0.5 |