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

Skip to content

Commit 880b068

Browse files
committed
Clarify error when plot() args have bad shapes.
1 parent a382319 commit 880b068

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,11 @@ def _xy_from_xy(self, x, y):
220220
x = _check_1d(x)
221221
y = _check_1d(y)
222222
if x.shape[0] != y.shape[0]:
223-
raise ValueError("x and y must have same first dimension")
223+
raise ValueError("x (shape: {}) and y (shape: {}) must have same "
224+
"first dimension".format(x.shape, y.shape))
224225
if x.ndim > 2 or y.ndim > 2:
225-
raise ValueError("x and y can be no greater than 2-D")
226+
raise ValueError("x (shape: {}) and y (shape: {}) can be no "
227+
"greater than 2-D".format(x.shape, y.shape))
226228

227229
if x.ndim == 1:
228230
x = x[:, np.newaxis]

0 commit comments

Comments
 (0)