@@ -2392,7 +2392,14 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2392
2392
error_kw .setdefault ('ecolor' , ecolor )
2393
2393
error_kw .setdefault ('capsize' , capsize )
2394
2394
2395
- orientation = kwargs .pop ('orientation' , 'vertical' )
2395
+ if 'orientation' in kwargs :
2396
+ orientation = kwargs ['orientation' ]
2397
+ cbook .warn_deprecated (
2398
+ "3.3" , message = "passing 'orientation' to bar() is for "
2399
+ "internal use only. Please use barh() or bar() "
2400
+ "explicitly to define the orientation." )
2401
+ else :
2402
+ orientation = kwargs .pop ('_orientation' , 'vertical' )
2396
2403
cbook ._check_in_list (['vertical' , 'horizontal' ],
2397
2404
orientation = orientation )
2398
2405
log = kwargs .pop ('log' , False )
@@ -2630,9 +2637,17 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2630
2637
:doc:`/gallery/lines_bars_and_markers/horizontal_barchart_distribution`
2631
2638
.
2632
2639
"""
2633
- kwargs .setdefault ('orientation' , 'horizontal' )
2640
+
2641
+ if 'orientation' in kwargs :
2642
+ orientation = kwargs ['orientation' ]
2643
+ cbook .warn_deprecated (
2644
+ "3.3" , message = "passing 'orientation' to barh() is for "
2645
+ "internal use only. Please use bar() or barh() "
2646
+ "explicitly to define the orientation." )
2647
+ else :
2648
+ orientation = 'horizontal'
2634
2649
patches = self .bar (x = left , height = height , width = width , bottom = y ,
2635
- align = align , ** kwargs )
2650
+ align = align , _orientation = orientation , ** kwargs )
2636
2651
return patches
2637
2652
2638
2653
@_preprocess_data ()
0 commit comments