Skip to content

Commit be1d83d

Browse files
committed
ENH : add stale flags to Collection
1 parent c7af76c commit be1d83d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/matplotlib/collections.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def draw(self, renderer):
321321

322322
gc.restore()
323323
renderer.close_group(self.__class__.__name__)
324+
self.stale = False
324325

325326
def set_pickradius(self, pr):
326327
self._pickradius = pr
@@ -370,6 +371,7 @@ def set_urls(self, urls):
370371
self._urls = [None, ]
371372
else:
372373
self._urls = urls
374+
self.stale = True
373375

374376
def get_urls(self):
375377
return self._urls
@@ -405,6 +407,7 @@ def set_hatch(self, hatch):
405407
ACCEPTS: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
406408
"""
407409
self._hatch = hatch
410+
self.stale = True
408411

409412
def get_hatch(self):
410413
'Return the current hatching pattern'
@@ -424,6 +427,7 @@ def set_offsets(self, offsets):
424427
self._offsets = offsets
425428
else:
426429
self._uniform_offsets = offsets
430+
self.stale = True
427431

428432
def get_offsets(self):
429433
"""
@@ -446,6 +450,7 @@ def set_offset_position(self, offset_position):
446450
if offset_position not in ('screen', 'data'):
447451
raise ValueError("offset_position must be 'screen' or 'data'")
448452
self._offset_position = offset_position
453+
self.stale = True
449454

450455
def get_offset_position(self):
451456
"""
@@ -469,6 +474,7 @@ def set_linewidth(self, lw):
469474
if lw is None:
470475
lw = mpl.rcParams['patch.linewidth']
471476
self._linewidths = self._get_value(lw)
477+
self.stale = True
472478

473479
def set_linewidths(self, lw):
474480
"""alias for set_linewidth"""
@@ -519,6 +525,7 @@ def set_linestyle(self, ls):
519525
except ValueError:
520526
raise ValueError('Do not know how to convert %s to dashes' % ls)
521527
self._linestyles = dashes
528+
self.stale = True
522529

523530
def set_linestyles(self, ls):
524531
"""alias for set_linestyle"""
@@ -537,6 +544,7 @@ def set_antialiased(self, aa):
537544
if aa is None:
538545
aa = mpl.rcParams['patch.antialiased']
539546
self._antialiaseds = self._get_bool(aa)
547+
self.stale = True
540548

541549
def set_antialiaseds(self, aa):
542550
"""alias for set_antialiased"""
@@ -577,6 +585,7 @@ def set_facecolor(self, c):
577585
c = mpl.rcParams['patch.facecolor']
578586
self._facecolors_original = c
579587
self._facecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
588+
self.stale = True
580589

581590
def set_facecolors(self, c):
582591
"""alias for set_facecolor"""
@@ -623,6 +632,7 @@ def set_edgecolor(self, c):
623632
c = mpl.rcParams['patch.edgecolor']
624633
self._edgecolors_original = c
625634
self._edgecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
635+
self.stale = True
626636

627637
def set_edgecolors(self, c):
628638
"""alias for set_edgecolor"""
@@ -676,6 +686,7 @@ def update_scalarmappable(self):
676686
self._facecolors = self.to_rgba(self._A, self._alpha)
677687
elif self._is_stroked:
678688
self._edgecolors = self.to_rgba(self._A, self._alpha)
689+
self.stale = True
679690

680691
def get_fill(self):
681692
'return whether fill is set'
@@ -700,7 +711,7 @@ def update_from(self, other):
700711
self.norm = other.norm
701712
self.cmap = other.cmap
702713
# self.update_dict = other.update_dict # do we need to copy this? -JJL
703-
714+
self.stale = True
704715

705716
# these are not available for the object inspector until after the
706717
# class is built so we define an initial set here for the init

0 commit comments

Comments
 (0)