-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: possible regression in axis ticks handling in matplotlib 3.6.0rc2 #23806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for bringing this up. I think we need a discussion what we mean by I don't have the full history present and think we might have been inconsistent here. From a conceptual point of view. IMHO To be checked: We might have been inconsistent and even changed behavior unintendedly or at least without warning. So independent on what is a good behavior, we need to check the past and current behavior and also make sure we have consistency, or if that is not possible at least a documented behavior over time. |
My intuition is that clearing the axes removes artists, puts the axes back to its default axes limits, and clears label. Ie all data added to the axes would be removed. OTOH, axes styling - tickdir, tick length, which spines are shown, spine styling, etc would not be reset as these are independent of the data on the axes. That is what I believe the behaviour of Matlab is, and I think it is the behaviour Matplotlib has had until recently. |
Note that I opened #23808 to restore the behaviour of matplotlib 3.5, if you guys want to stay conservative. |
I'm inclined to be conservative and go back to the 3.5 behavior rather than adding a behavior change note at this point. I think it is better be consistent through time but inconsistent through the API (unless we can make the API fully consistent in one go or at least have a clearly articulated plan of where we are going). |
Agreed, but still we need to consider two which properties this should apply. For example, 3.5 also keeps We should add a figure comparison test
to make sure we are don't have an unintended regression through the clear refactoring. |
Bug summary
While running image tests for yt, I noticed a change of behaviour that bisects to
2357c92d87d96d519c8470776e76180e71663d0b (PR #22587)
and that I'm not 100% sure is intentional, where parameters set with
Axis.tick_params
are forgotten after a call toAxes.cla
.In yt we use persistent
Axis
instances inside container classes; we typically set sometick_params
during instantiation of the container, and defer rendering as much as possible, at which pointAxis
instances may be cleared before the plot is drawn again.I think this can easily be fixed in yt, but I wanted to check with you wether this change was intented or not.
Code for reproduction
Actual outcome
Expected outcome
with matplotlib 3.5

Additional information
No response
Operating system
N/A
Matplotlib Version
3.6 VS 3.5
Matplotlib Backend
MacOSX (but also seeing this on a Linux CI server)
Python version
3.10.4
Jupyter version
N/A
Installation
pip
The text was updated successfully, but these errors were encountered: