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

Skip to content

Commit 0f43f68

Browse files
committed
Put shape in exception
1 parent 0b8d693 commit 0f43f68

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,9 @@ def set_data(self, x, y, A):
888888
y = np.asarray(y, np.float64).ravel()
889889

890890
if A.shape[:2] != (y.size-1, x.size-1):
891-
raise ValueError("Axes don't match array shape")
891+
raise ValueError(
892+
"Axes don't match array shape. Got %s, expected %s." %
893+
(A.shape[:2], (y.size - 1, x.size - 1)))
892894
if A.ndim not in [2, 3]:
893895
raise ValueError("A must be 2D or 3D")
894896
if A.ndim == 3 and A.shape[2] == 1:

0 commit comments

Comments
 (0)