8000 mplot3d: don't assume every contour level has a line. · matplotlib/matplotlib@be1f5c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit be1f5c1

Browse files
committed
mplot3d: don't assume every contour level has a line.
1 parent 5812e1d commit be1f5c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,8 +2027,11 @@ def _3d_extend_contour(self, cset, stride=5):
20272027
dz = (levels[1] - levels[0]) / 2
20282028

20292029
for z, linec in zip(levels, colls):
2030-
topverts = art3d.paths_to_3d_segments(linec.get_paths(), z - dz)
2031-
botverts = art3d.paths_to_3d_segments(linec.get_paths(), z + dz)
2030+
paths = linec.get_paths()
2031+
if not paths:
2032+
continue
2033+
topverts = art3d.paths_to_3d_segments(paths, z - dz)
2034+
botverts = art3d.paths_to_3d_segments(paths, z + dz)
20322035

20332036
color = linec.get_color()[0]
20342037

0 commit comments

Comments
 (0)
0