@@ -96,6 +96,7 @@ def set_smart_bounds(self, value):
96
96
self .axes .yaxis .set_smart_bounds (value )
97
97
elif self .spine_type in ('top' , 'bottom' ):
98
98
self .axes .xaxis .set_smart_bounds (value )
99
+ self .stale = True
99
100
100
101
def get_smart_bounds (self ):
101
102
"""get whether the spine has smart bounds"""
@@ -110,10 +111,12 @@ def set_patch_circle(self, center, radius):
110
111
self ._angle = 0
111
112
# circle drawn on axes transform
112
113
self .set_transform (self .axes .transAxes )
114
+ self .stale = True
113
115
114
116
def set_patch_line (self ):
115
117
"""set the spine to be linear"""
116
118
self ._patch_type = 'line'
119
+ self .stale = True
117
120
118
121
# Behavior copied from mpatches.Ellipse:
119
122
def _recompute_transform (self ):
@@ -158,6 +161,7 @@ def register_axis(self, axis):
158
161
self .axis = axis
159
162
if self .axis is not None :
160
163
self .axis .cla ()
164
+ self .stale = True
161
165
162
166
def cla (self ):
163
167
"""Clear the current spine"""
@@ -274,7 +278,9 @@ def _adjust_location(self):
274
278
@allow_rasterization
275
279
def draw (self , renderer ):
276
280
self ._adjust_location ()
277
- return super (Spine , self ).draw (renderer )
281
+ ret = super (Spine , self ).draw (renderer )
282
+ self .stale = False
283
+ return ret
278
284
279
285
def _calc_offset_transform (self ):
280
286
"""calculate the offset transform performed by the spine"""
@@ -388,6 +394,7 @@ def set_position(self, position):
388
394
389
395
if self .axis is not None :
390
396
self .axis .reset_ticks ()
397
+ self .stale = True
391
398
392
399
def get_position (self ):
393
400
"""get the spine position"""
@@ -437,6 +444,7 @@ def set_bounds(self, low, high):
437
444
raise ValueError (
438
445
'set_bounds() method incompatible with circular spines' )
439
446
self ._bounds = (low , high )
447
+ self .stale = True
440
448
441
449
def get_bounds (self ):
442
450
"""Get the bounds of the spine."""
@@ -486,3 +494,4 @@ def set_color(self, c):
486
494
# The facecolor of a spine is always 'none' by default -- let
487
495
# the user change it manually if desired.
488
496
self .set_edgecolor (c )
497
+ self .stale = True
0 commit comments