Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55a9da4

Browse files
committed
FIX: regression
1 parent e405ba7 commit 55a9da4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/cbook.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,10 @@ def hexbin(x, y, C=None, gridsize=100,
15451545
ty = np.log10(ty)
15461546
if extent is not None:
15471547
xmin, xmax, ymin, ymax = extent
1548+
if xmin > xmax:
1549+
raise ValueError("In extent, xmax must be greater than xmin")
1550+
if ymin > ymax:
1551+
raise ValueError("In extent, ymax must be greater than ymin")
15481552
else:
15491553
xmin, xmax = (tx.min(), tx.max()) if len(x) else (0, 1)
15501554
ymin, ymax = (ty.min(), ty.max()) if len(y) else (0, 1)
@@ -1600,7 +1604,7 @@ def hexbin(x, y, C=None, gridsize=100,
16001604
else:
16011605
Cs_at_i2[i2[i]].append(C[i])
16021606
if mincnt is None:
1603-
mincnt = 0
1607+
mincnt = 1
16041608
accum = np.array(
16051609
[reduce_C_function(acc) if len(acc) >= mincnt else np.nan
16061610
for Cs_at_i in [Cs_at_i1, Cs_at_i2]

0 commit comments

Comments
 (0)