Skip to content

Commit

Permalink
Merge pull request #5607 from anntzer/clarify-bad-shape-error
Browse files Browse the repository at this point in the history
ENH: Clarify error when plot() args have bad shapes.
  • Loading branch information
tacaswell committed Dec 5, 2015
2 parents 95b67ff + dd4dc1a commit 2f65b5b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/matplotlib/axes/_base.py
Expand Up @@ -220,9 +220,11 @@ def _xy_from_xy(self, x, y):
x = _check_1d(x)
y = _check_1d(y)
if x.shape[0] != y.shape[0]:
raise ValueError("x and y must have same first dimension")
raise ValueError("x and y must have same first dimension, but "
"have shapes {} and {}".format(x.shape, y.shape))
if x.ndim > 2 or y.ndim > 2:
raise ValueError("x and y can be no greater than 2-D")
raise ValueError("x and y can be no greater than 2-D, but have "
"shapes {} and {}".format(x.shape, y.shape))

if x.ndim == 1:
x = x[:, np.newaxis]
Expand Down

0 comments on commit 2f65b5b

Please sign in to comment.