diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py index 53ba0fe2e559..fba8b529c708 100644 --- a/lib/mpl_toolkits/mplot3d/art3d.py +++ b/lib/mpl_toolkits/mplot3d/art3d.py @@ -106,9 +106,11 @@ def set_3d_properties(self, zs=0, zdir='z'): ys = self.get_ydata() try: + # If *zs* is a list or array, then this will fail and + # just proceed to juggle_axes(). zs = float(zs) zs = [zs for x in xs] - except: + except TypeError: pass self._verts3d = juggle_axes(xs, ys, zs, zdir) @@ -170,7 +172,7 @@ def set_segments(self, segments): ''' Set 3D segments ''' - self._segments3d = segments + self._segments3d = np.asanyarray(segments) LineCollection.set_segments(self, []) def do_3d_projection(self, renderer):