File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1222,14 +1222,11 @@ def _setup_blit(self):
1222
1222
# axes
1223
1223
self ._blit_cache = dict ()
1224
1224
self ._drawn_artists = []
1225
- def remove_from_cache (ax ):
1226
- try :
1227
- del self ._blit_cache [ax ]
1228
- except KeyError :
1229
- pass
1230
1225
for ax in self ._fig .axes :
1231
- ax .callbacks .connect ('xlim_changed' , remove_from_cache )
1232
- ax .callbacks .connect ('ylim_changed' , remove_from_cache )
1226
+ ax .callbacks .connect ('xlim_changed' ,
1227
+ lambda ax : self ._blit_cache .pop (ax , None ))
1228
+ ax .callbacks .connect ('ylim_changed' ,
1229
+ lambda ax : self ._blit_cache .pop (ax , None ))
1233
1230
self ._resize_id = self ._fig .canvas .mpl_connect ('resize_event' ,
1234
1231
self ._handle_resize )
1235
1232
self ._post_draw (None , self ._blit )
You can’t perform that action at this time.
0 commit comments