@@ -4792,11 +4792,10 @@ def make_iterable(x):
4792
4792
if orientation == 'vertical' :
4793
4793
self ._process_unit_info (xdata = left , ydata = height , kwargs = kwargs )
4794
4794
if log :
4795
- self .set_yscale ('log' )
4795
+ self .set_yscale ('log' , nonposy = 'clip' )
4796
4796
# size width and bottom according to length of left
4797
4797
if _bottom is None :
4798
4798
if self .get_yscale () == 'log' :
4799
- bottom = [1e-100 ]
4800
4799
adjust_ylim = True
4801
4800
else :
4802
4801
bottom = [0 ]
@@ -4808,11 +4807,10 @@ def make_iterable(x):
4808
4807
elif orientation == 'horizontal' :
4809
4808
self ._process_unit_info (xdata = width , ydata = bottom , kwargs = kwargs )
4810
4809
if log :
4811
- self .set_xscale ('log' )
4810
+ self .set_xscale ('log' , nonposx = 'clip' )
4812
4811
# size left and height according to length of bottom
4813
4812
if _left is None :
4814
4813
if self .get_xscale () == 'log' :
4815
- left = [1e-100 ]
4816
4814
adjust_xlim = True
4817
4815
else :
4818
4816
left = [0 ]
@@ -8118,7 +8116,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
8118
8116
if normed :
8119
8117
db = np .diff (bins )
8120
8118
m = (m .astype (float ) / db ) / m .sum ()
8121
- if stacked :
8119
+ if stacked :
8122
8120
m += mlast
8123
8121
mlast [:] = m
8124
8122
n .append (m )
@@ -8171,14 +8169,18 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
8171
8169
_barfunc = self .bar
8172
8170
8173
8171
for m , c in zip (n , color ):
8174
- patch = _barfunc (bins [:- 1 ]+ boffset , m , width , bottom ,
8172
+ if bottom is None :
8173
+ bottom = np .zeros (len (m ), np .float )
8174
+ if stacked :
8175
+ height = m - bottom
8176
+ else :
8177
+ height = m
8178
+ patch = _barfunc (bins [:- 1 ]+ boffset , height , width , bottom ,
8175
8179
align = 'center' , log = log ,
8176
8180
color = c , bottom = bottom )
8177
8181
patches .append (patch )
8178
8182
if stacked :
8179
- if bottom is None :
8180
- bottom = 0.0
8181
- bottom += m
8183
+ bottom [:] = m
8182
8184
boffset += dw
8183
8185
8184
8186
elif histtype .startswith ('step' ):
@@ -8191,10 +8193,10 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
8191
8193
8192
8194
if log :
8193
8195
if orientation == 'horizontal' :
8194
- self .set_xscale ('log' )
8196
+ self .set_xscale ('log' , nonposx = 'clip' )
8195
8197
logbase = self .xaxis ._scale .base
8196
8198
else : # orientation == 'vertical'
8197
- self .set_yscale ('log' )
8199
+ self .set_yscale ('log' , nonposy = 'clip' )
8198
8200
logbase = self .yaxis ._scale .base
8199
8201
8200
8202
# Setting a minimum of 0 results in problems for log plots
0 commit comments