@@ -2303,20 +2303,12 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2303
2303
label = kwargs .pop ('label' , '' )
2304
2304
tick_labels = kwargs .pop ('tick_label' , None )
2305
2305
2306
- adjust_ylim = False
2307
- adjust_xlim = False
2308
-
2309
2306
y = bottom # Matches barh call signature.
2310
2307
if orientation == 'vertical' :
2311
- if bottom is None :
2312
- if self .get_yscale () == 'log' :
2313
- adjust_ylim = True
2308
+ if y is None :
2314
2309
y = 0
2315
-
2316
2310
elif orientation == 'horizontal' :
2317
2311
if x is None :
2318
- if self .get_xscale () == 'log' :
2319
- adjust_xlim = True
2320
2312
x = 0
2321
2313
2322
2314
if orientation == 'vertical' :
@@ -2429,21 +2421,6 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2429
2421
else :
2430
2422
errorbar = None
2431
2423
2432
- if adjust_xlim :
2433
- xmin , xmax = self .dataLim .intervalx
2434
- xmin = min (w for w in width if w > 0 )
2435
- if xerr is not None :
2436
- xmin = xmin - np .max (xerr )
2437
- xmin = max (xmin * 0.9 , 1e-100 )
2438
- self .dataLim .intervalx = (xmin , xmax )
2439
-
2440
- if adjust_ylim :
2441
- ymin , ymax = self .dataLim .intervaly
2442
- ymin = min (h for h in height if h > 0 )
2443
- if yerr is not None :
2444
- ymin = ymin - np .max (yerr )
2445
- ymin = max (ymin * 0.9 , 1e-100 )
2446
- self .dataLim .intervaly = (ymin , ymax )
2447
2424
self ._request_autoscale_view ()
2448
2425
2449
2426
bar_container = BarContainer (patches , errorbar , label = label )
@@ -6757,30 +6734,8 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6757
6734
if log :
6758
6735
if orientation == 'horizontal' :
6759
6736
self .set_xscale ('log' , nonposx = 'clip' )
6760
- logbase = self .xaxis ._scale .base
6761
6737
else : # orientation == 'vertical'
6762
6738
self .set_yscale ('log' , nonposy = 'clip' )
6763
- logbase = self .yaxis ._scale .base
6764
-
6765
- # Setting a minimum of 0 results in problems for log plots
6766
- if np .min (bottom ) > 0 :
6767
- minimum = np .min (bottom )
6768
- elif density or weights is not None :
6769
- # For data that is normed to form a probability density,
6770
- # set to minimum data value / logbase
6771
- # (gives 1 full tick-label unit for the lowest filled bin)
6772
- ndata = np .array (tops )
6773
- minimum = (np .min (ndata [ndata > 0 ])) / logbase
6774
- else :
6775
- # For non-normed (density = False) data,
6776
- # set the min to 1 / log base,
6777
- # again so that there is 1 full tick-label unit
6778
- # for the lowest bin
6779
- minimum = 1.0 / logbase
6780
-
6781
- y [0 ], y [- 1 ] = minimum , minimum
6782
- else :
6783
- minimum = 0
6784
6739
6785
6740
if align == 'left' :
6786
6741
x -= 0.5 * (bins [1 ]- bins [0 ])
@@ -6801,8 +6756,6 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6801
6756
# set the top of this polygon
6802
6757
y [1 :2 * len (bins )- 1 :2 ], y [2 :2 * len (bins ):2 ] = (m + bottom ,
6803
6758
m + bottom )
6804
- if log :
6805
- y [y < minimum ] = minimum
6806
6759
if orientation == 'horizontal' :
6807
6760
xvals .append (y .copy ())
6808
6761
yvals .append (x .copy ())
@@ -6825,9 +6778,9 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6825
6778
for patch_list in patches :
6826
6779
for patch in patch_list :
6827
6780
if orientation == 'vertical' :
6828
- patch .sticky_edges .y .append (minimum )
6781
+ patch .sticky_edges .y .append (0 )
6829
6782
elif orientation == 'horizontal' :
6830
- patch .sticky_edges .x .append (minimum )
6783
+ patch .sticky_edges .x .append (0 )
6831
6784
6832
6785
# we return patches, so put it back in the expected order
6833
6786
patches .reverse ()
0 commit comments