Skip to content

add explanations and examples to the docstring of violinplot #12585

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

Closed
wants to merge 3 commits into from
Closed
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
9 changes: 5 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7811,14 +7811,15 @@ def violinplot(self, dataset, positions=None, vert=True, widths=0.5,
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,
sequence *dataset*. Each filled area extends to represent the entire data range, with optional lines at the mean, the median,
the minimum, and the maximum.

Parameters
----------
dataset : Array or a sequence of vectors.
The input data.
dataset : 2D Array/Matrix or a sequence of vectors.
The input data.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need "the input data". Notes about data haven't been moved to notes section"

If passing a 2D Array/Matrix, such as *np.array([[1,2,3], [4,5,6]])*, it will plot (1,4), (2,5), and (3,6)
If passing a sequence of vectors such as *list([[1,2,3], [4,5,6]])*, it will plot (1,2,3), (4,5,6)

positions : array-like, default = [1, 2, ..., n]
Sets the positions of the violins. The ticks and limits are
Expand Down