Skip to content

Commit b81c118

Browse files
committed
Fix sphinx build
1 parent 7c2c22e commit b81c118

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ def do_3d_projection(self, renderer):
479479
vxyzis = proj3d.proj_transform_clip(xs, ys, zs, renderer.M)
480480
vzs = vxyzis[2]
481481

482+
482483
fcs = (zalpha(self._facecolor3d, vzs) if self._depthshade else
483484
self._facecolor3d)
484485
fcs = mcolors.to_rgba_array(fcs, self._alpha)
@@ -802,9 +803,12 @@ def _rotate_axes_vec(xyz, zdir):
802803

803804
def get_colors(c, num):
804805
"""Stretch the color argument to provide the required number *num*."""
805-
return np.broadcast_to(
806-
mcolors.to_rgba_array(c) if len(c) else [0, 0, 0, 0],
807-
(num, 4))
806+
if not len(c):
807+
return np.zeros((num, 4))
808+
elif len(c) < num:
809+
return np.broadcast_to(mcolors.to_rgba_array(c), (num, 4))
810+
else:
811+
return mcolors.to_rgba_array(c)
808812

809813

810814
def zalpha(colors, zs):

0 commit comments

Comments
 (0)