Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0c419ad

Browse filesBrowse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR #18483: DOC: reword non-monotonic cell center warning
1 parent c23f81e commit 0c419ad
Copy full SHA for 0c419ad

File tree

Expand file treeCollapse file tree

2 files changed

+7
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-7
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5633,12 +5633,11 @@ def _interp_grid(X):
56335633
if not (np.all(dX >= 0) or np.all(dX <= 0)):
56345634
cbook._warn_external(
56355635
f"The input coordinates to {funcname} are "
5636-
"not all either increasing or decreasing, "
5637-
"the automatically computed edges can "
5638-
"produce misleading results in this case. "
5639-
"It is recommended to supply the "
5640-
f"quadrilateral edges to {funcname}"
5641-
f" yourself. See help({funcname}).")
5636+
"interpreted as cell centers, but are not "
5637+
"monotonically increasing or decreasing. "
5638+
"This may lead to incorrectly calculated cell "
5639+
"edges, in which case, please supply "
5640+
f"explicit cell edges to {funcname}.")
56425641
X = np.hstack((X[:, [0]] - dX[:, [0]],
56435642
X[:, :-1] + dX,
56445643
X[:, [-1]] + dX[:, [-1]]))

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,8 @@ def test_pcolorargs():
11671167
y = [-10, 10]
11681168
X, Y = np.meshgrid(x, y)
11691169
Z = np.zeros(X.shape)
1170-
with pytest.warns(UserWarning, match="The input coordinates"):
1170+
with pytest.warns(UserWarning,
1171+
match='are not monotonically increasing or decreasing'):
11711172
ax.pcolormesh(X, Y, Z, shading='auto')
11721173

11731174

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.