@@ -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 , orientation = 'vertical' ,
8354
+ vert = None , widths = 0.5 , showmeans = False , showextrema = True ,
8355
+ showmedians = False , quantiles = None , points = 100 ,
8356
+ bw_method = None , side = 'both' , ):
8357
8357
"""
8358
8358
Make a violin plot.
8359
8359
@@ -8371,6 +8371,12 @@ def violinplot(self, dataset, positions=None, vert=None, widths=0.5,
8371
8371
The positions of the violins; i.e. coordinates on the x-axis for
8372
8372
vertical violins (or y-axis for horizontal violins).
8373
8373
8374
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
8375
+ If 'horizontal', plots the violins horizontally.
8376
+ Otherwise, plots the violins vertically.
8377
+
8378
+ .. versionadded:: 3.10
8379
+
8374
8380
vert : bool, default: True.
8375
8381
.. deprecated:: 3.10
8376
8382
Use *orientation* instead.
@@ -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 , orientation = None ,
8479
+ vert = None , widths = 0.5 , showmeans = False , showextrema = True ,
8480
+ showmedians = False , side = 'both' ):
8481
8481
"""
8482
8482
Draw a violin plot from pre-computed statistics.
8483
8483
@@ -8515,6 +8515,12 @@ def violin(self, vpstats, positions=None, vert=None, widths=0.5,
8515
8515
The positions of the violins; i.e. coordinates on the x-axis for
8516
8516
vertical violins (or y-axis for horizontal violins).
8517
8517
8518
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
8519
+ If 'horizontal', plots the violins horizontally.
8520
+ Otherwise, plots the violins vertically.
8521
+
8522
+ .. versionadded:: 3.10
8523
+
8518
8524
vert : bool, default: True.
8519
8525
.. deprecated:: 3.10
8520
8526
Use *orientation* instead.
@@ -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