Skip to content

Commit 6ff4539

Browse files
committed
Updates for mplot3d and manual contour example
1 parent 178012d commit 6ff4539

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lib/matplotlib/contour.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,12 @@ def __init__(self, ax, *args,
823823
self.norm.vmax = vmax
824824
self._process_colors()
825825

826-
self.allsegs, self.allkinds = self._get_allsegs_and_allkinds()
826+
if getattr(self, 'allsegs', None) is None:
827+
self.allsegs, self.allkinds = self._get_allsegs_and_allkinds()
828+
elif self.allkinds is None:
829+
# allsegs specified in constructor may or may not have allkinds as
830+
# well. Must ensure allkinds can be zipped below.
831+
self.allkinds = [None] * len(self.allsegs)
827832

828833
if self.filled:
829834
if self.linewidths is not None:
@@ -1032,7 +1037,11 @@ def _get_lowers_and_uppers(self):
10321037
return (lowers, uppers)
10331038

10341039
def _make_paths(self, segs, kinds):
1035-
return [mpath.Path(seg, codes=kind) for seg, kind in zip(segs, kinds)]
1040+
if kinds is None:
1041+
return [mpath.Path(seg) for seg in segs]
1042+
else:
1043+
return [mpath.Path(seg, codes=kind) for seg, kind
1044+
in zip(segs, kinds)]
10361045

10371046
def changed(self):
10381047
tcolors = [(tuple(rgba),)

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ def _3d_extend_contour(self, cset, stride=5):
20392039
topverts = art3d._paths_to_3d_segments(paths, z - dz)
20402040
botverts = art3d._paths_to_3d_segments(paths, z + dz)
20412041

2042-
color = linec.get_color()[0]
2042+
color = linec.get_edgecolor()[0]
20432043

20442044
polyverts = []
20452045
normals = []

0 commit comments

Comments
 (0)