Skip to content

Commit 8186243

Browse files
committed
FIX: make image.set_clim mark the figure as stale
Push the stale flag down into the ScalarMappable so that it gets applied to all ScalarMappable sub-classes (ex Collections).
1 parent b5238ac commit 8186243

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/matplotlib/cm.py

+3
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ def set_clim(self, vmin=None, vmax=None):
311311
if vmax is not None:
312312
self.norm.vmax = vmax
313313
self.changed()
314+
self.stale = True
314315

315316
def set_cmap(self, cmap):
316317
"""
@@ -321,13 +322,15 @@ def set_cmap(self, cmap):
321322
cmap = get_cmap(cmap)
322323
self.cmap = cmap
323324
self.changed()
325+
self.stale = True
324326

325327
def set_norm(self, norm):
326328
'set the normalization instance'
327329
if norm is None:
328330
norm = colors.Normalize()
329331
self.norm = norm
330332
self.changed()
333+
self.stale = True
331334

332335
def autoscale(self):
333336
"""

lib/matplotlib/image.py

-8
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,6 @@ def _interpdr(self):
192192
def iterpnames(self):
193193
return interpolations_names
194194

195-
def set_cmap(self, cmap):
196-
super(_ImageBase, self).set_cmap(cmap)
197-
self.stale = True
198-
199-
def set_norm(self, norm):
200-
super(_ImageBase, self).set_norm(norm)
201-
self.stale = True
202-
203195
def __str__(self):
204196
return "AxesImage(%g,%g;%gx%g)" % tuple(self.axes.bbox.bounds)
205197

0 commit comments

Comments
 (0)