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