MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_remove

Function test_remove

lib/matplotlib/tests/test_artist.py:189–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187
188
189def test_remove():
190 fig, ax = plt.subplots()
191 im = ax.imshow(np.arange(36).reshape(6, 6))
192 ln, = ax.plot(range(5))
193
194 assert fig.stale
195 assert ax.stale
196
197 fig.canvas.draw()
198 assert not fig.stale
199 assert not ax.stale
200 assert not ln.stale
201
202 assert im in ax._mouseover_set
203 assert ln not in ax._mouseover_set
204 assert im.axes is ax
205
206 im.remove()
207 ln.remove()
208
209 for art in [im, ln]:
210 assert art.axes is None
211 assert art.get_figure() is None
212
213 assert im not in ax._mouseover_set
214 assert fig.stale
215 assert ax.stale
216
217
218@image_comparison(["default_edges.png"], remove_text=True, style='default')

Callers

nothing calls this directly

Calls 6

imshowMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
drawMethod · 0.45
removeMethod · 0.45
get_figureMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…