Skip to content

Commit ef8eaae

Browse files
authored
add require_monotonicity to if condition
add require_monotonicity to if condition
1 parent 2136935 commit ef8eaae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6034,7 +6034,8 @@ def _interp_grid(X, require_monotonicity=False):
60346034
# monotonicity of Y coords needs to be checked.
60356035
if np.shape(X)[1] > 1:
60366036
dX = np.diff(X, axis=1) * 0.5
6037-
if not (np.all(dX >= 0) or np.all(dX <= 0)):
6037+
if (require_monotonicity and
6038+
not (np.all(dX >= 0) or np.all(dX <= 0))):
60386039
_api.warn_external(
60396040
f"The input coordinates to {funcname} are "
60406041
"interpreted as cell centers, but are not "

0 commit comments

Comments
 (0)