From 558ccae6f04499ea87d8e5bf1d9eea1614e3d271 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Mon, 14 Sep 2020 18:08:32 -0700 Subject: [PATCH] DOC: reword non-monotonic cell center warning --- lib/matplotlib/axes/_axes.py | 11 +++++------ lib/matplotlib/tests/test_axes.py | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index a4f2e2436ad2..2eaf8133960e 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -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]])) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 2f7b9b121614..8b950b98a289 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -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')