Skip to content

Commit 5a6d0c1

Browse files
committed
Ignore np 1.16 warning
1 parent faf47e3 commit 5a6d0c1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,13 +1003,19 @@ def test_fill_between_interpolate_nan():
10031003
y1 = np.asarray([8, 18, np.nan, 18, 8, 18, 24, 18, 8, 18])
10041004
y2 = np.asarray([18, 11, 8, 11, 18, 26, 32, 30, np.nan, np.nan])
10051005

1006+
# numpy 1.16 issues warning 'invalid value encountered in greater_equal'
1007+
# for comparisons that include nan.
1008+
with np.errstate(invalid='ignore'):
1009+
greater2 = y2 >= y1
1010+
greater1 = y1 >= y2
1011+
10061012
fig, ax = plt.subplots()
10071013

10081014
ax.plot(x, y1, c='k')
10091015
ax.plot(x, y2, c='b')
1010-
ax.fill_between(x, y1, y2, where=y2 >= y1, facecolor="green",
1016+
ax.fill_between(x, y1, y2, where=greater2, facecolor="green",
10111017
interpolate=True, alpha=0.5)
1012-
ax.fill_between(x, y1, y2, where=y2 <= y1, facecolor="red",
1018+
ax.fill_between(x, y1, y2, where=greater1, facecolor="red",
10131019
interpolate=True, alpha=0.5)
10141020

10151021

0 commit comments

Comments
 (0)