@@ -8350,10 +8350,10 @@ def matshow(self, Z, **kwargs):
8350
8350
8351
8351
@_api .make_keyword_only ("3.9" , "vert" )
8352
8352
@_preprocess_data (replace_names = ["dataset" ])
8353
- def violinplot (self , dataset , positions = None , vert = None , widths = 0.5 ,
8354
- showmeans = False , showextrema = True , showmedians = False ,
8355
- quantiles = None , points = 100 , bw_method = None , side = 'both' ,
8356
- orientation = None ):
8353
+ def violinplot (self , dataset , positions = None , vert = None ,
8354
+ orientation = 'vertical' , widths = 0.5 , showmeans = False ,
8355
+ showextrema = True , showmedians = False , quantiles = None ,
8356
+ points = 100 , bw_method = None , side = 'both' , ):
8357
8357
"""
8358
8358
Make a violin plot.
8359
8359
@@ -8381,6 +8381,12 @@ def violinplot(self, dataset, positions=None, vert=None, widths=0.5,
8381
8381
If True, plots the violins vertically.
8382
8382
If False, plots the violins horizontally.
8383
8383
8384
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
8385
+ If 'horizontal', plots the violins horizontally.
8386
+ Otherwise, plots the violins vertically.
8387
+
8388
+ .. versionadded:: 3.10
8389
+
8384
8390
widths : float or array-like, default: 0.5
8385
8391
The maximum width of each violin in units of the *positions* axis.
8386
8392
The default is 0.5, which is half the available space when using default
@@ -8414,12 +8420,6 @@ def violinplot(self, dataset, positions=None, vert=None, widths=0.5,
8414
8420
'both' plots standard violins. 'low'/'high' only
8415
8421
plots the side below/above the positions value.
8416
8422
8417
- orientation : {'vertical', 'horizontal'}, default: 'vertical'
8418
- If 'horizontal', plots the violins horizontally.
8419
- Otherwise, plots the violins vertically.
8420
-
8421
- .. versionadded:: 3.10
8422
-
8423
8423
data : indexable object, optional
8424
8424
DATA_PARAMETER_PLACEHOLDER
8425
8425
@@ -8475,9 +8475,9 @@ def _kde_method(X, coords):
8475
8475
showmedians = showmedians , side = side )
8476
8476
8477
8477
@_api .make_keyword_only ("3.9" , "vert" )
8478
- def violin (self , vpstats , positions = None , vert = None , widths = 0.5 ,
8479
- showmeans = False , showextrema = True , showmedians = False , side = 'both' ,
8480
- orientation = None ):
8478
+ def violin (self , vpstats , positions = None , vert = None ,
8479
+ orientation = None , widths = 0.5 , showmeans = False ,
8480
+ showextrema = True , showmedians = False , side = 'both' ):
8481
8481
"""
8482
8482
Draw a violin plot from pre-computed statistics.
8483
8483
@@ -8525,6 +8525,12 @@ def violin(self, vpstats, positions=None, vert=None, widths=0.5,
8525
8525
If True, plots the violins vertically.
8526
8526
If False, plots the violins horizontally.
8527
8527
8528
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
8529
+ If 'horizontal', plots the violins horizontally.
8530
+ Otherwise, plots the violins vertically.
8531
+
8532
+ .. versionadded:: 3.10
8533
+
8528
8534
widths : float or array-like, default: 0.5
8529
8535
The maximum width of each violin in units of the *positions* axis.
8530
8536
The default is 0.5, which is half available space when using default
@@ -8543,12 +8549,6 @@ def violin(self, vpstats, positions=None, vert=None, widths=0.5,
8543
8549
'both' plots standard violins. 'low'/'high' only
8544
8550
plots the side below/above the positions value.
8545
8551
8546
- orientation : {'vertical', 'horizontal'}, default: 'vertical'
8547
- If 'horizontal', plots the violins horizontally.
8548
- Otherwise, plots the violins vertically.
8549
-
8550
- .. versionadded:: 3.10
8551
-
8552
8552
Returns
8553
8553
-------
8554
8554
dict
@@ -8599,23 +8599,17 @@ def violin(self, vpstats, positions=None, vert=None, widths=0.5,
8599
8599
datashape_message = ("List of violinplot statistics and `{0}` "
8600
8600
"values must have the same length" )
8601
8601
8602
+ # vert and orientation parameters are linked until vert's
8603
+ # deprecation period expires. If both are selected,
8604
+ # vert takes precedence.
8602
8605
if vert is not None :
8603
8606
_api .warn_deprecated (
8604
8607
"3.10" ,
8605
8608
name = "vert: bool" ,
8606
8609
alternative = "orientation: {'vertical', 'horizontal'}"
8607
- )
8608
-
8609
- # vert and orientation parameters are linked until vert's
8610
- # deprecation period expires. If both are selected,
8611
- # vert takes precedence.
8612
- if vert or vert is None and orientation is None :
8613
- orientation = 'vertical'
8614
- elif vert is False :
8615
- orientation = 'horizontal'
8616
-
8617
- if orientation is not None :
8618
- _api .check_in_list (['horizontal' , 'vertical' ], orientation = orientation )
8610
+ )
8611
+ orientation = 'vertical' if vert else 'horizontal'
8612
+ _api .check_in_list (['horizontal' , 'vertical' ], orientation = orientation )
8619
8613
8620
8614
# Validate positions
8621
8615
if positions is None :
0 commit comments