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

Skip to content

Commit ad06d93

Browse files
committed
changes for fixing the failing test
1 parent 04f0dc1 commit ad06d93

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5748,9 +5748,10 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
57485748

57495749
if shading == 'flat':
57505750
if (Nx, Ny) != (ncols + 1, nrows + 1):
5751-
raise TypeError(f"Dimensions of X({Nx}) and y({Ny}) should"
5752-
f" be one larger than C {C.shape} while using"
5753-
f" shading='flat' see help({funcname})")
5751+
raise TypeError(f"Dimensions of C {C.shape} should"
5752+
f" be one smaller than X({Nx}) and Y({Ny})"
5753+
f" while using shading='flat'"
5754+
f" see help({funcname})")
57545755
else: # ['nearest', 'gouraud']:
57555756
if (Nx, Ny) != (ncols, nrows):
57565757
raise TypeError('Dimensions of C %s are incompatible with'

lib/matplotlib/tests/test_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ def test_samesizepcolorflaterror():
14431443
fig, ax = plt.subplots()
14441444
x, y = np.meshgrid(np.arange(5), np.arange(3))
14451445
Z = x + y
1446-
with pytest.raises(TypeError, match=r".*one larger than C"):
1446+
with pytest.raises(TypeError, match=r".*one smaller than X"):
14471447
ax.pcolormesh(x, y, Z, shading='flat')
14481448

14491449

0 commit comments

Comments
 (0)