@@ -2392,7 +2392,14 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
23922392 error_kw .setdefault ('ecolor' , ecolor )
23932393 error_kw .setdefault ('capsize' , capsize )
23942394
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' )
23962403 cbook ._check_in_list (['vertical' , 'horizontal' ],
23972404 orientation = orientation )
23982405 log = kwargs .pop ('log' , False )
@@ -2630,9 +2637,17 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
26302637 :doc:`/gallery/lines_bars_and_markers/horizontal_barchart_distribution`
26312638 .
26322639 """
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'
26342649 patches = self .bar (x = left , height = height , width = width , bottom = y ,
2635- align = align , ** kwargs )
2650+ align = align , _orientation = orientation , ** kwargs )
26362651 return patches
26372652
26382653 @_preprocess_data ()
0 commit comments