Skip to content

Commit 805e4f0

Browse files
chahak13tacaswell
andcommitted
Update lib/matplotlib/contour.py
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
1 parent 92a5b02 commit 805e4f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/contour.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1456,8 +1456,10 @@ def _contour_args(self, args, kwargs):
14561456
kwargs
14571457
)
14581458
elif (("X" in kwargs) ^ ("Y" in kwargs)) and "Z" in kwargs:
1459-
raise KeyError("Both 'X' and 'Y' must be passed as kwargs. "
1460-
"Passing only one of the two is not allowed.")
1459+
raise TypeError(
1460+
"Both or neither 'X' and 'Y' may be passed as kwargs. "
1461+
"Passing only one of the two is not allowed."
1462+
)
14611463
elif "Z" in kwargs:
14621464
z = ma.asarray(kwargs.pop("Z"), dtype=np.float64)
14631465
x, y = self._initialize_x_y(z)

0 commit comments

Comments
 (0)