Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 50112a7

Browse filesBrowse files
committed
Merge pull request #5607 from anntzer/clarify-bad-shape-error
ENH: Clarify error when plot() args have bad shapes.
1 parent b6ab3a4 commit 50112a7
Copy full SHA for 50112a7

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+4-2Lines 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 and y must have same first dimension, but "
224+
"have shapes {} and {}".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 and y can be no greater than 2-D, but have "
227+
"shapes {} and {}".format(x.shape, y.shape))
226228

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.