From 54870c2f5427c68b8c2ed6e2e54d47c79bd511be Mon Sep 17 00:00:00 2001 From: Wen Yi Wang Date: Sun, 21 Oct 2018 16:56:52 -0400 Subject: [PATCH 1/3] add explanations and examples to the docstring of violinplot to explain the difference between passing an array and passing a sequences of vectors. --- lib/matplotlib/axes/_axes.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 8b737e564f77..f057f6ae6918 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -7811,14 +7811,19 @@ 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*. To illustrate, if passing an 2D array/matrix, + the function will treat each column as data. However, if passing a list of vectors + (i.e. sequence *dataset*), the function will treat each vector as data. + + 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. + 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 From 13942c15267b406925b8a5bbcad73760439acdf2 Mon Sep 17 00:00:00 2001 From: Wen Yi Wang Date: Tue, 13 Nov 2018 21:28:13 -0500 Subject: [PATCH 2/3] remove duplicate explanation --- lib/matplotlib/axes/_axes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index f057f6ae6918..6850a1be6915 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -7811,9 +7811,7 @@ 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*. To illustrate, if passing an 2D array/matrix, - the function will treat each column as data. However, if passing a list of vectors - (i.e. sequence *dataset*), the function will treat each vector as data. + 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. From eb662daf88cee56dc35406dcb0e657c8460014f9 Mon Sep 17 00:00:00 2001 From: Wen Yi Wang Date: Tue, 13 Nov 2018 21:30:28 -0500 Subject: [PATCH 3/3] adjust words space --- lib/matplotlib/axes/_axes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 6850a1be6915..9ab0ad983e4b 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -7811,9 +7811,7 @@ 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