@@ -2295,20 +2295,12 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2295
2295
label = kwargs .pop ('label' , '' )
2296
2296
tick_labels = kwargs .pop ('tick_label' , None )
2297
2297
2298
- adjust_ylim = False
2299
- adjust_xlim = False
2300
-
2301
2298
y = bottom # Matches barh call signature.
2302
2299
if orientation == 'vertical' :
2303
- if bottom is None :
2304
- if self .get_yscale () == 'log' :
2305
- adjust_ylim = True
2300
+ if y is None :
2306
2301
y = 0
2307
-
2308
2302
elif orientation == 'horizontal' :
2309
2303
if x is None :
2310
- if self .get_xscale () == 'log' :
2311
- adjust_xlim = True
2312
2304
x = 0
2313
2305
2314
2306
if orientation == 'vertical' :
@@ -2421,21 +2413,6 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2421
2413
else :
2422
2414
errorbar = None
2423
2415
2424
- if adjust_xlim :
2425
- xmin , xmax = self .dataLim .intervalx
2426
- xmin = min (w for w in width if w > 0 )
2427
- if xerr is not None :
2428
- xmin = xmin - np .max (xerr )
2429
- xmin = max (xmin * 0.9 , 1e-100 )
2430
- self .dataLim .intervalx = (xmin , xmax )
2431
-
2432
- if adjust_ylim :
2433
- ymin , ymax = self .dataLim .intervaly
2434
- ymin = min (h for h in height if h > 0 )
2435
- if yerr is not None :
2436
- ymin = ymin - np .max (yerr )
2437
- ymin = max (ymin * 0.9 , 1e-100 )
2438
- self .dataLim .intervaly = (ymin , ymax )
2439
2416
self ._request_autoscale_view ()
2440
2417
2441
2418
bar_container = BarContainer (patches , errorbar , label = label )
@@ -6738,30 +6715,8 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6738
6715
if log :
6739
6716
if orientation == 'horizontal' :
6740
6717
self .set_xscale ('log' , nonposx = 'clip' )
6741
- logbase = self .xaxis ._scale .base
6742
6718
else : # orientation == 'vertical'
6743
6719
self .set_yscale ('log' , nonposy = 'clip' )
6744
- logbase = self .yaxis ._scale .base
6745
-
6746
- # Setting a minimum of 0 results in problems for log plots
6747
- if np .min (bottom ) > 0 :
6748
- minimum = np .min (bottom )
6749
- elif density or weights is not None :
6750
- # For data that is normed to form a probability density,
6751
- # set to minimum data value / logbase
6752
- # (gives 1 full tick-label unit for the lowest filled bin)
6753
- ndata = np .array (tops )
6754
- minimum = (np .min (ndata [ndata > 0 ])) / logbase
6755
- else :
6756
- # For non-normed (density = False) data,
6757
- # set the min to 1 / log base,
6758
- # again so that there is 1 full tick-label unit
6759
- # for the lowest bin
6760
- minimum = 1.0 / logbase
6761
-
6762
- y [0 ], y [- 1 ] = minimum , minimum
6763
- else :
6764
- minimum = 0
6765
6720
6766
6721
if align == 'left' :
6767
6722
x -= 0.5 * (bins [1 ]- bins [0 ])
@@ -6782,8 +6737,6 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6782
6737
# set the top of this polygon
6783
6738
y [1 :2 * len (bins )- 1 :2 ], y [2 :2 * len (bins ):2 ] = (m + bottom ,
6784
6739
m + bottom )
6785
- if log :
6786
- y [y < minimum ] = minimum
6787
6740
if orientation == 'horizontal' :
6788
6741
xvals .append (y .copy ())
6789
6742
yvals .append (x .copy ())
@@ -6806,9 +6759,9 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6806
6759
for patch_list in patches :
6807
6760
for patch in patch_list :
6808
6761
if orientation == 'vertical' :
6809
- patch .sticky_edges .y .append (minimum )
6762
+ patch .sticky_edges .y .append (0 )
6810
6763
elif orientation == 'horizontal' :
6811
- patch .sticky_edges .x .append (minimum )
6764
+ patch .sticky_edges .x .append (0 )
6812
6765
6813
6766
# we return patches, so put it back in the expected order
6814
6767
patches .reverse ()
0 commit comments