10000 DOC: Update violinplot() docs · matplotlib/matplotlib@1d3769c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1d3769c

Browse files
committed
DOC: Update violinplot() docs
Some corrections and small rewrites.
1 parent 810a43b commit 1d3769c

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8206,43 +8206,42 @@ def violinplot(self, dataset, positions=None, vert=True, widths=0.5,
82068206
The input data.
82078207
82088208
positions : array-like, default: [1, 2, ..., n]
8209-
The positions of the violins. The ticks and limits are
8210-
automatically set to match the positions.
8209+
The positions of the violins; i.e. coordinates on the x-axis for
8210+
vertical violins (or y-axis for horizontal violins).
82118211
82128212
vert : bool, default: True.
82138213
If true, creates a vertical violin plot.
82148214
Otherwise, creates a horizontal violin plot.
82158215
8216-
widths : array-like, default: 0.5
8217-
Either a scalar or a vector that sets the maximal width of
8218-
each violin. The default is 0.5, which uses about half of the
8219-
available horizontal space.
8216+
widths : float or array-like, default: 0.5
8217+
The maximal width of each violin in units of the *positions* axis.
8218+
The default is 0.5, which is half available space when using default
8219+
*positions*.
82208220
82218221
showmeans : bool, default: False
8222-
If `True`, will toggle rendering of the means.
8222+
Whether to indicate the mean with a line.
82238223
82248224
showextrema : bool, default: True
8225-
If `True`, will toggle rendering of the extrema.
8225+
Whether to indicate the extrema with a line.
82268226
82278227
showmedians : bool, default: False
8228-
If `True`, will toggle rendering of the medians.
8228+
Whether to indicate the median with a line.
82298229
82308230
quantiles : array-like, default: None
82318231
If not None, set a list of floats in interval [0, 1] for each violin,
82328232
which stands for the quantiles that will be rendered for that
82338233
violin.
82348234
82358235
points : int, default: 100
8236-
Defines the number of points to evaluate each of the
8237-
gaussian kernel density estimations at.
8236+
The number of points to evaluate each of the gaussian kernel density
8237+
estimations at.
82388238
8239-
bw_method : str, scalar or callable, optional
8239+
bw_method : {'scott', 'silverman'} or float or callable, default: 'scott'
82408240
The method used to calculate the estimator bandwidth. This can be
82418241
'scott', 'silverman', a scalar constant or a callable. If a
8242-
scalar, this will be used directly as `kde.factor`. If a
8242+
float, this will be used directly as `kde.factor`. If a
82438243
callable, it should take a `matplotlib.mlab.GaussianKDE` instance as
8244-
its only parameter and return a scalar. If None (default), 'scott'
8245-
is used.
8244+
its only parameter and return a float.
82468245
82478246
data : indexable object, optional
82488247
DATA_PARAMETER_PLACEHOLDER
@@ -8329,26 +8328,26 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
83298328
for this violin's dataset.
83308329
83318330
positions : array-like, default: [1, 2, ..., n]
8332-
The positions of the violins. The ticks and limits are
8333-
automatically set to match the positions.
8331+
The positions of the violins; i.e. coordinates on the x-axis for
8332+
vertical violins (or y-axis for horizontal violins).
83348333
83358334
vert : bool, default: True.
83368335
If true, plots the violins vertically.
83378336
Otherwise, plots the violins horizontally.
83388337
8339-
widths : array-like, default: 0.5
8340-
Either a scalar or a vector that sets the maximal width of
8341-
each violin. The default is 0.5, which uses about half of the
8342-
available horizontal space.
8338+
widths : float or array-like, default: 0.5
8339+
The maximal width of each violin in units of the *positions* axis.
8340+
The default is 0.5, which is half available space when using default
8341+
*positions*.
83438342
83448343
showmeans : bool, default: False
8345-
If true, will toggle rendering of the means.
8344+
Whether to indicate the mean with a line.
83468345
83478346
showextrema : bool, default: True
8348-
If true, will toggle rendering of the extrema.
8347+
Whether to indicate the extrema with a line.
83498348
83508349
showmedians : bool, default: False
8351-
If true, will toggle rendering of the medians.
8350+
Whether to indicate the median with a line.
83528351
83538352
Returns
83548353
-------

lib/matplotlib/mlab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,12 +776,12 @@ class GaussianKDE:
776776
dataset : array-like
777777
Datapoints to estimate from. In case of univariate data this is a 1-D
778778
array, otherwise a 2D array with shape (# of dims, # of data).
779-
bw_method : str, scalar or callable, optional
779+
bw_method : {'scott', 'silverman'} or float or callable, optional
780780
The method used to calculate the estimator bandwidth. This can be
781781
'scott', 'silverman', a scalar constant or a callable. If a
782-
scalar, this will be used directly as `kde.factor`. If a
782+
float, this will be used directly as `kde.factor`. If a
783783
callable, it should take a `GaussianKDE` instance as only
784-
parameter and return a scalar. If None (default), 'scott' is used.
784+
parameter and return a float. If None (default), 'scott' is used.
785785
786786
Attributes
787787
----------

0 commit comments

Comments
 (0)
0