Skip to content

Commit ee02ba7

Browse files
authored
Merge pull request matplotlib#29210 from meeseeksmachine/auto-backport-of-pr-29209-on-v3.10.x
2 parents 53a9605 + 81f6933 commit ee02ba7

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5928,10 +5928,7 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
59285928
else:
59295929
X, Y = np.meshgrid(np.arange(ncols + 1), np.arange(nrows + 1))
59305930
shading = 'flat'
5931-
C = cbook.safe_masked_invalid(C, copy=True)
5932-
return X, Y, C, shading
5933-
5934-
if len(args) == 3:
5931+
elif len(args) == 3:
59355932
# Check x and y for bad data...
59365933
C = np.asanyarray(args[2])
59375934
# unit conversion allows e.g. datetime objects as axis values

lib/matplotlib/tests/test_axes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,20 @@ def test_pcolormesh_rgba(fig_test, fig_ref, dims, alpha):
14991499
ax.pcolormesh(c[..., 0], cmap="gray", vmin=0, vmax=1, alpha=alpha)
15001500

15011501

1502+
@check_figures_equal(extensions=["png"])
1503+
def test_pcolormesh_nearest_noargs(fig_test, fig_ref):
1504+
x = np.arange(4)
1505+
y = np.arange(7)
1506+
X, Y = np.meshgrid(x, y)
1507+
C = X + Y
1508+
1509+
ax = fig_test.subplots()
1510+
ax.pcolormesh(C, shading="nearest")
1511+
1512+
ax = fig_ref.subplots()
1513+
ax.pcolormesh(x, y, C, shading="nearest")
1514+
1515+
15021516
@image_comparison(['pcolormesh_datetime_axis.png'], style='mpl20')
15031517
def test_pcolormesh_datetime_axis():
15041518
# Remove this line when this test image is regenerated.

0 commit comments

Comments
 (0)