Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ def _zalpha(colors, zs):
# in all three dimensions. Otherwise, at certain orientations,
# the min and max zs are very close together.
# Should really normalize against the viewing depth.
if len(zs) == 0:
if len(colors) == 0 or len(zs) == 0:
return np.zeros((0, 4))
norm = Normalize(min(zs), max(zs))
sats = 1 - norm(zs) * 0.7
Expand Down
8 changes: 7 additions & 1 deletion lib/mpl_toolkits/tests/test_mplot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,14 @@ def test_scatter3d():
def test_scatter3d_color():
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# Check that 'none' color works; these two should overlay to produce the
# same as setting just `color`.
ax.scatter(np.arange(10), np.arange(10), np.arange(10),
facecolor='r', edgecolor='none', marker='o')
ax.scatter(np.arange(10), np.arange(10), np.arange(10),
color='r', marker='o')
facecolor='none', edgecolor='r', marker='o')

ax.scatter(np.arange(10, 20), np.arange(10, 20), np.arange(10, 20),
color='b', marker='s')

Expand Down