@@ -6397,7 +6397,7 @@ def _normalize_input(inp, ename='input'):
6397
6397
xvals .append (x .copy ())
6398
6398
yvals .append (y .copy ())
6399
6399
6400
- #stepfill is closed, step is not
6400
+ # stepfill is closed, step is not
6401
6401
split = - 1 if fill else 2 * len (bins )
6402
6402
# add patches in reverse order so that when stacking,
6403
6403
# items lower in the stack are plottted on top of
@@ -6419,9 +6419,13 @@ def _normalize_input(inp, ename='input'):
6419
6419
xmin0 = max (_saved_bounds [0 ]* 0.9 , minimum )
6420
6420
xmax = self .dataLim .intervalx [1 ]
6421
6421
for m in n :
6422
- if np . sum ( m ) > 0 : # make sure there are counts
6423
- xmin = np .amin ( m [ m != 0 ])
6422
+ # make sure there are counts
6423
+ if np .sum ( m ) > 0 :
6424
6424
# filter out the 0 height bins
6425
+ xmin = np .amin (m [m != 0 ])
6426
+ # If no counts, set min to zero
6427
+ else :
6428
+ xmin = 0.0
6425
6429
xmin = max (xmin * 0.9 , minimum ) if not input_empty else minimum
6426
6430
xmin = min (xmin0 , xmin )
6427
6431
self .dataLim .intervalx = (xmin , xmax )
@@ -6430,9 +6434,13 @@ def _normalize_input(inp, ename='input'):
6430
6434
ymax = self .dataLim .intervaly [1 ]
6431
6435
6432
6436
for m in n :
6433
- if np . sum ( m ) > 0 : # make sure there are counts
6434
- ymin = np .amin ( m [ m != 0 ])
6437
+ # make sure there are counts
6438
+ if np .sum ( m ) > 0 :
6435
6439
# filter out the 0 height bins
6440
+ ymin = np .amin (m [m != 0 ])
6441
+ # If no counts, set min to zero
6442
+ else :
6443
+ ymin = 0.0
6436
6444
ymin = max (ymin * 0.9 , minimum ) if not input_empty else minimum
6437
6445
ymin = min (ymin0 , ymin )
6438
6446
self .dataLim .intervaly = (ymin , ymax )
0 commit comments