Skip to content

Commit bdfa2cb

Browse files
committed
Merge pull request #1294 from jgehrcke/patch-1
Update lib/mpl_toolkits/mplot3d/axes3d.py
2 parents a881fd9 + 29e556a commit bdfa2cb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,9 +1936,13 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c='b', *args, **kwargs):
19361936
ys = np.ma.ravel(ys)
19371937
zs = np.ma.ravel(zs)
19381938
if xs.size != ys.size:
1939-
raise ValueError("x and y must be the same size")
1940-
if xs.size != zs.size and zs.size == 1:
1941-
zs = np.array(zs[0] * xs.size)
1939+
raise ValueError("Arguments 'xs' and 'ys' must be of same size.")
1940+
if xs.size != zs.size:
1941+
if zs.size == 1:
1942+
zs = np.tile(zs[0], xs.size)
1943+
else:
1944+
raise ValueError(("Argument 'zs' must be of same size as 'xs' "
1945+
"and 'ys' or of size 1."))
19421946

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

0 commit comments

Comments
 (0)