Skip to content

Commit

Permalink
Merge pull request #1294 from jgehrcke/patch-1
Browse files Browse the repository at this point in the history
Update lib/mpl_toolkits/mplot3d/axes3d.py
  • Loading branch information
dmcdougall committed Sep 24, 2012
2 parents a881fd9 + 29e556a commit bdfa2cb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Expand Up @@ -1936,9 +1936,13 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c='b', *args, **kwargs):
ys = np.ma.ravel(ys)
zs = np.ma.ravel(zs)
if xs.size != ys.size:
raise ValueError("x and y must be the same size")
if xs.size != zs.size and zs.size == 1:
zs = np.array(zs[0] * xs.size)
raise ValueError("Arguments 'xs' and 'ys' must be of same size.")
if xs.size != zs.size:
if zs.size == 1:
zs = np.tile(zs[0], xs.size)
else:
raise ValueError(("Argument 'zs' must be of same size as 'xs' "
"and 'ys' or of size 1."))

s = np.ma.ravel(s) # This doesn't have to match x, y in size.

Expand Down

0 comments on commit bdfa2cb

Please sign in to comment.