Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56520cb

Browse files
committed
Only try to broadcast if zs is not iterable
1 parent d2b5261 commit 56520cb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ def _path_to_3d_segment(path, zs=0, zdir='z'):
207207
def _paths_to_3d_segments(paths, zs=0, zdir='z'):
208208
"""Convert paths from a collection object to 3D segments."""
209209

210-
zs = np.broadcast_to(zs, len(paths))
210+
if not np.iterable(zs):
211+
zs = np.broadcast_to(zs, len(paths))
212+
211213
segs = [_path_to_3d_segment(path, pathz, zdir)
212214
for path, pathz in zip(paths, zs)]
213215
return segs

0 commit comments

Comments
 (0)