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

Skip to content

Commit 2c59935

Browse files
committed
FIX: short-circuit the contour changed call when uninitialized
The Quadcontourset.changed() method assumes some attributes to be there. If we called changed from a parent class, the object may not have been initialized with those attributes yet, so skip that portion of the update.
1 parent 8eaff42 commit 2c59935

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/contour.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,10 @@ def _make_paths(self, segs, kinds):
10271027
return [mpath.Path(seg) for seg in segs]
10281028

10291029
def changed(self):
1030+
if not hasattr(self, "cvalues"):
1031+
# Just return after calling the super() changed function
1032+
cm.ScalarMappable.changed(self)
1033+
return
10301034
# Force an autoscale immediately because self.to_rgba() calls
10311035
# autoscale_None() internally with the data passed to it,
10321036
# so if vmin/vmax are not set yet, this would override them with

0 commit comments

Comments
 (0)