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

Function test_axes_remove

lib/matplotlib/tests/test_colorbar.py:315–324  ·  view source on GitHub ↗

Removing the colorbar's axes should also remove the colorbar

()

Source from the content-addressed store, hash-verified

313
314
315def test_axes_remove():
316 """Removing the colorbar's axes should also remove the colorbar"""
317 fig, ax = plt.subplots()
318 sc = ax.scatter([1, 2], [3, 4])
319 cb = fig.colorbar(sc)
320
321 with mock.patch.object(cb, 'remove') as mock_cb_remove:
322 cb.ax.remove()
323
324 mock_cb_remove.assert_called()
325
326
327def test_colorbarbase():

Callers

nothing calls this directly

Calls 4

subplotsMethod · 0.45
scatterMethod · 0.45
colorbarMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…