8000 Merge pull request #2172 from WeatherGod/mplot3d/iter_collections · ryanfreckleton/matplotlib@11666e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11666e5

Browse files
committed
Merge pull request matplotlib#2172 from WeatherGod/mplot3d/iter_collections
[SPRINT] Closes matplotlib#1079. Allow iterables for Line3DCollection
2 parents 96fb464 + 1f0c46c commit 11666e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ def set_3d_properties(self, zs=0, zdir='z'):
106106
ys = self.get_ydata()
107107

108108
try:
109+
# If *zs* is a list or array, then this will fail and
110+
# just proceed to juggle_axes().
109111
zs = float(zs)
110112
zs = [zs for x in xs]
111-
except:
113+
except TypeError:
112114
pass
113115
self._verts3d = juggle_axes(xs, ys, zs, zdir)
114116

@@ -170,7 +172,7 @@ def set_segments(self, segments):
170172
'''
171173
Set 3D segments
172174
'''
173-
self._segments3d = segments
175+
self._segments3d = np.asanyarray(segments)
174176
LineCollection.set_segments(self, [])
175177

176178
def do_3d_projection(self, renderer):

0 commit comments

Comments
 (0)
0