66import inspect
77import itertools
88import re
9+ import sys
910from numbers import Integral
1011
1112import matplotlib .axes as maxes
@@ -3252,7 +3253,7 @@ def _convert_bar_width(x, width=1):
32523253 return width * x_step
32533254
32543255 def _apply_bar (
3255- self , xs , hs , ws , bs , * , absolute_width = False ,
3256+ self , xs , hs , ws , bs , * , absolute_width = None ,
32563257 stack = None , stacked = None , negpos = False , orientation = 'vertical' , ** kwargs
32573258 ):
32583259 """
@@ -3266,6 +3267,18 @@ def _apply_bar(
32663267 xs , hs , kw = self ._parse_plot1d (xs , hs , orientation = orientation , ** kw )
32673268 edgefix_kw = _pop_params (kw , self ._apply_edgefix )
32683269
3270+ # Default absolute width with horrible kludge
3271+ # (the faint of heart should look away now).
3272+ if absolute_width is None :
3273+ frame = sys ._getframe ()
3274+ absolute_width = False
3275+ absolute_names = ('seaborn.distributions' , 'seaborn.categorical' )
3276+ while frame is not None :
3277+ if frame .f_globals .get ('__name__' , '' ) in absolute_names :
3278+ absolute_width = True
3279+ break
3280+ frame = frame .f_back
3281+
32693282 # Call func after converting bar width
32703283 b0 = 0
32713284 objs = []
0 commit comments