Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b80532

Browse files
committed
Fix removal of Figure-level artists
PyCharm has been warning that `Artist.figure` should be a `Figure|None`, not a `bool` as is set in this block. Based on the previous section of code, I think setting the figure to stale (if the Axes was not already set stale, meaning the Artist was on a Figure *only*) was the intended behaviour.
1 parent ee723d9 commit 9b80532

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/artist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ def remove(self):
249249
_ax_flag = True
250250

251251
if self.figure:
252-
self.figure = None
253252
if not _ax_flag:
254-
self.figure = True
253+
self.figure.stale = True
254+
self.figure = None
255255

256256
else:
257257
raise NotImplementedError('cannot remove artist')

0 commit comments

Comments
 (0)