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