Skip to content

Commit

Permalink
Merge pull request matplotlib#29210 from meeseeksmachine/auto-backpor…
Browse files Browse the repository at this point in the history
…t-of-pr-29209-on-v3.10.x
  • Loading branch information
jklymak authored Nov 30, 2024
2 parents 53a9605 + 81f6933 commit ee02ba7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 1 addition & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5928,10 +5928,7 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
else:
X, Y = np.meshgrid(np.arange(ncols + 1), np.arange(nrows + 1))
shading = 'flat'
C = cbook.safe_masked_invalid(C, copy=True)
return X, Y, C, shading

if len(args) == 3:
elif len(args) == 3:
# Check x and y for bad data...
C = np.asanyarray(args[2])
# unit conversion allows e.g. datetime objects as axis values
Expand Down
14 changes: 14 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,20 @@ def test_pcolormesh_rgba(fig_test, fig_ref, dims, alpha):
ax.pcolormesh(c[..., 0], cmap="gray", vmin=0, vmax=1, alpha=alpha)


@check_figures_equal(extensions=["png"])
def test_pcolormesh_nearest_noargs(fig_test, fig_ref):
x = np.arange(4)
y = np.arange(7)
X, Y = np.meshgrid(x, y)
C = X + Y

ax = fig_test.subplots()
ax.pcolormesh(C, shading="nearest")

ax = fig_ref.subplots()
ax.pcolormesh(x, y, C, shading="nearest")


@image_comparison(['pcolormesh_datetime_axis.png'], style='mpl20')
def test_pcolormesh_datetime_axis():
# Remove this line when this test image is regenerated.
Expand Down

0 comments on commit ee02ba7

Please sign in to comment.