Skip to content

Commit 6542ab9

Browse files
author
Yi Wei
committed
add tests
1 parent 616be00 commit 6542ab9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/matplotlib/tests/test_axes.py

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

1481+
# GH 26093
1482+
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)
1485+
plt.pcolormesh(masked_x)
1486+
1487+
x = np.linspace(0, 1, 10)
1488+
y = np.linspace(0, 1, 10)
1489+
X, Y = np.meshgrid(x, y)
1490+
Z = np.sin(2 * np.pi * X) * np.cos(2 * np.pi * Y)
1491+
Zmask = np.broadcast_to([True, False]*5, Z.shape)
1492+
masked_Z = np.ma.array(Z, mask = Zmask)
1493+
plt.pcolormesh(X, Y, masked_Z)
1494+
14811495

14821496
@check_figures_equal(extensions=["png"])
14831497
def test_pcolornearest(fig_test, fig_ref):

0 commit comments

Comments
 (0)