Skip to content

Commit 4f25789

Browse files
timhoffmstory645
authored andcommitted
DOC: Improve violin/violin_stats/violinplot docs
Closes #32409. Co-authored-by: hannah <story645@gmail.com>
1 parent b760134 commit 4f25789

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

‎lib/matplotlib/axes/_axes.py‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9101,8 +9101,26 @@ def violinplot(self, dataset, positions=None, vert=None,
91019101
91029102
See Also
91039103
--------
9104+
.cbook.violin_stats : calculate statistical properties of a dataset for violin
9105+
plotting.
91049106
.Axes.violin : Draw a violin from pre-computed statistics.
91059107
boxplot : Draw a box and whisker plot.
9108+
9109+
Notes
9110+
-----
9111+
The following calls are identical ::
9112+
9113+
ax.violinplot()
9114+
9115+
and ::
9116+
9117+
from matplotlib.cbook import violin_stats
9118+
9119+
stats = violin_stats()
9120+
ax.violin(stats)
9121+
9122+
`.violin_stats` gives you more control of the statistical calculations than
9123+
`.violinplot`.
91069124
"""
91079125
vpstats = cbook.violin_stats(dataset, ("GaussianKDE", bw_method),
91089126
points=points, quantiles=quantiles)
@@ -9242,6 +9260,22 @@ def violin(self, vpstats, positions=None, vert=None,
92429260
Draw a violin plot from data instead of pre-computed statistics.
92439261
.cbook.violin_stats:
92449262
Calculate a *vpstats* dictionary from data, suitable for passing to violin.
9263+
9264+
Notes
9265+
-----
9266+
The following calls are identical ::
9267+
9268+
ax.violinplot()
9269+
9270+
and ::
9271+
9272+
from matplotlib.cbook import violin_stats
9273+
9274+
stats = violin_stats()
9275+
ax.violin(stats)
9276+
9277+
`.violin_stats` gives you more control of the statistical calculations than
9278+
`.violinplot`.
92459279
"""
92469280

92479281
# Statistical quantities to be plotted on the violins

0 commit comments

Comments
 (0)