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

Skip to content

Commit f24663f

Browse files
authored
Check if zs has same length as paths, raise else
1 parent 5b00412 commit f24663f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ def _paths_to_3d_segments(paths, zs=0, zdir='z'):
209209

210210
if not np.iterable(zs):
211211
zs = np.broadcast_to(zs, len(paths))
212+
else:
213+
if len(zs) != len(paths):
214+
raise ValueError('Number of z-coordinates does not match paths.')
212215

213216
segs = [_path_to_3d_segment(path, pathz, zdir)
214217
for path, pathz in zip(paths, zs)]

0 commit comments

Comments
 (0)