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

Skip to content

Commit b1d657c

Browse files
author
Yi Wei
committed
add test_pcolorargs_with_read_only
1 parent 68dad00 commit b1d657c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,17 +1478,18 @@ def test_pcolorargs():
14781478
match='are not monotonically increasing or decreasing'):
14791479
ax.pcolormesh(X, Y, Z, shading='auto')
14801480

1481-
# GH 26093
1481+
1482+
def test_pcolorargs_with_read_only():
14821483
x = np.arange(6).reshape(2, 3)
1483-
mask = np.broadcast_to([False, True, False], x.shape) # read-only array
1484-
masked_x = np.ma.array(x, mask=mask)
1484+
xmask = np.broadcast_to([False, True, False], x.shape) # read-only array
1485+
masked_x = np.ma.array(x, mask=xmask)
14851486
plt.pcolormesh(masked_x)
14861487

14871488
x = np.linspace(0, 1, 10)
14881489
y = np.linspace(0, 1, 10)
14891490
X, Y = np.meshgrid(x, y)
14901491
Z = np.sin(2 * np.pi * X) * np.cos(2 * np.pi * Y)
1491-
Zmask = np.broadcast_to([True, False]*5, Z.shape)
1492+
Zmask = np.broadcast_to([True, False] * 5, Z.shape)
14921493
masked_Z = np.ma.array(Z, mask=Zmask)
14931494
plt.pcolormesh(X, Y, masked_Z)
14941495

0 commit comments

Comments
 (0)