10000 Update lib/mpl_toolkits/mplot3d/axes3d.py · matplotlib/matplotlib@c50411e · GitHub
[go: up one dir, main page]

Skip to content

Commit c50411e

Browse files
jgehrckedmcdougall
authored andcommitted
Update lib/mpl_toolkits/mplot3d/axes3d.py
Axes3D.scatter: raise exception in case z.size neither being 1 nor equaling x.size and y.size (according to documentation).
1 parent 9115000 commit c50411e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,8 +1937,11 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c='b', *args, **kwargs):
19371937
zs = np.ma.ravel(zs)
19381938
if xs.size != ys.size:
19391939
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)
1940+
if xs.size != zs.size:
1941+
if zs.size == 1:
1942+
zs = np.array(zs[0] * xs.size)
1943+
else:
1944+
raise ValueError("z must be either of same size as x and y or of size 1")
19421945

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

0 commit comments

Comments
 (0)
0