Removing the colorbar's axes should also remove the colorbar
()
| 313 | |
| 314 | |
| 315 | def 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 | |
| 327 | def test_colorbarbase(): |