matplotlib
matplotlib copied to clipboard
[MNT]: Add tests to codify `ax.clear`
Summary
As discussed on today's call.
We need to codify what ax.clear
and plt.cla
are meant to actually clear on an axes, versus setting on the axes that should remain static.
For instance, it is pretty straight forward that clearing an axes should remove any data artists from the plot. However, what other properties should be reset. Labels? Tick styling, grids? Units on axes? Locators and formatters? The scale of the axises?
If anyone with edit access wants, they should start a list here, or if folks don't have edit access they can add list items on the comments.
Crossref: https://github.com/matplotlib/matplotlib/pull/23808
More reference from @timhoffm (https://github.com/matplotlib/matplotlib/pull/23808#pullrequestreview-1099932104):
- #20149 is the original issue, that started everything
- #20161 was the bugfix for above (v3.4.2)
- resulting in regressions #20721 and #20219.
- these were hot-fixed in #20826 (v3.4.3)
- #22587 (v3.6.0) claims to be a follow-up cleanup which claims to not change the outcome, but apparently we did not have enough tests.
Proposed fix
No response