Skip to content

Commit 234cc9c

Browse files
committed
ENH : add stale flags to Collection
1 parent 495b5a0 commit 234cc9c

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"""
@@ -540,6 +546,7 @@ def set_linestyle(self, ls):
540546
except ValueError:
541547
raise ValueError('Do not know how to convert %s to dashes' % ls)
542548
self._linestyles = dashes
549+
self.stale = True
543550

544551
def set_linestyles(self, ls):
545552
"""alias for set_linestyle"""
@@ -558,6 +565,7 @@ def set_antialiased(self, aa):
558565
if aa is None:
559566
aa = mpl.rcParams['patch.antialiased']
560567
self._antialiaseds = self._get_bool(aa)
568+
self.stale = True
561569

562570
def set_antialiaseds(self, aa):
563571
"""alias for set_antialiased"""
@@ -598,6 +606,7 @@ def set_facecolor(self, c):
598606
c = mpl.rcParams['patch.facecolor']
599607
self._facecolors_original = c
600608
self._facecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
609+
self.stale = True
601610

602611
def set_facecolors(self, c):
603612
"""alias for set_facecolor"""
@@ -644,6 +653,7 @@ def set_edgecolor(self, c):
644653
c = mpl.rcParams['patch.edgecolor']
645654
self._edgecolors_original = c
646655
self._edgecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
656+
self.stale = True
647657

648658
def set_edgecolors(self, c):
649659
"""alias for set_edgecolor"""
@@ -697,6 +707,7 @@ def update_scalarmappable(self):
697707
self._facecolors = self.to_rgba(self._A, self._alpha)
698708
elif self._is_stroked:
699709
self._edgecolors = self.to_rgba(self._A, self._alpha)
710+
self.stale = True
700711

701712
def get_fill(self):
702713
'return whether fill is set'
@@ -721,7 +732,7 @@ def update_from(self, other):
721732
self.norm = other.norm
722733
self.cmap = other.cmap
723734
# self.update_dict = other.update_dict # do we need to copy this? -JJL
724-
735+
self.stale = True
725736

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

0 commit comments

Comments
 (0)