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

Skip to content

Commit f7bdfd3

Browse files
authored
Merge pull request #26273 from rcomer/pcolor-maskwrite
TST: simplify mask in pcolor writing to mask test
2 parents 5e2c230 + 3438301 commit f7bdfd3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,16 +1507,16 @@ def test_pcolorargs_with_read_only():
15071507
y = np.linspace(0, 1, 10)
15081508
X, Y = np.meshgrid(x, y)
15091509
Z = np.sin(2 * np.pi * X) * np.cos(2 * np.pi * Y)
1510-
mask = np.broadcast_to([True, False] * 5, Z.shape)
1510+
mask = np.zeros(10, dtype=bool)
1511+
mask[-1] = True
1512+
mask = np.broadcast_to(mask, Z.shape)
15111513
assert mask.flags.writeable is False
15121514
masked_Z = np.ma.array(Z, mask=mask)
15131515
plt.pcolormesh(X, Y, masked_Z)
15141516

15151517
masked_X = np.ma.array(X, mask=mask)
15161518
masked_Y = np.ma.array(Y, mask=mask)
1517-
with pytest.warns(UserWarning,
1518-
match='are not monotonically increasing or decreasing'):
1519-
plt.pcolor(masked_X, masked_Y, masked_Z)
1519+
plt.pcolor(masked_X, masked_Y, masked_Z)
15201520

15211521

15221522
@check_figures_equal(extensions=["png"])

0 commit comments

Comments
 (0)