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

Skip to content

DOC: reword non-monotonic cell center warning #18483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5579,12 +5579,11 @@ def _interp_grid(X):
if not (np.all(dX >= 0) or np.all(dX <= 0)):
cbook._warn_external(
f"The input coordinates to {funcname} are "
"not all either increasing or decreasing, "
"the automatically computed edges can "
"produce misleading results in this case. "
"It is recommended to supply the "
f"quadrilateral edges to {funcname}"
f" yourself. See help({funcname}).")
"interpreted as cell centers, but are not "
"monotonically increasing or decreasing. "
"This may lead to incorrectly calculated cell "
"edges, in which case, please supply "
f"explicit cell edges to {funcname}.")
X = np.hstack((X[:, [0]] - dX[:, [0]],
X[:, :-1] + dX,
X[:, [-1]] + dX[:, [-1]]))
Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,8 @@ def test_pcolorargs():
y = [-10, 10]
X, Y = np.meshgrid(x, y)
Z = np.zeros(X.shape)
with pytest.warns(UserWarning, match="The input coordinates"):
with pytest.warns(UserWarning,
match='are not monotonically increasing or decreasing'):
ax.pcolormesh(X, Y, Z, shading='auto')


Expand Down