You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Toggling visibility of axis tick labels causes their destruction #16197
Toggling the visibility of the axis tick labels via set_visible(False) can lead to their outright destruction, see here. According to @ImportanceOfBeingErnest, this issue is related to #10088.
I include a minimal code fragment that demonstrates the problem.
Previously ticks whose label1On attribute was set to False were excluded (per 525dcef#diff-52127080e2783464f529df684d82d476L1239), so I just remapped the behavior to get_visible(), as that was the point of #10088. So it's intended, but really more "staying consistent with the old behavior while merging two visibility knobs into a single one".
If we are going to change this (unclear whether we do) I would rather always return all of them and let the user filter them as needed -- we don't hide non-visible() children in other cases.
Thank you for the prompt and vigorous discussion on the issue. I will leave the technicalities to you as the experts but I personally side with anntzer's suggestion to always (or, at least by default) return all tick labels regardless of visibility and let the user filter. For what's it worth, I would find this the most intuitive.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Single ticks should be considered ephemal. I don't think we can or should guarantee their lifetime. Overall, the strategy should be to migrate away from single tick objects.
Activity
timhoffm commentedon Jan 12, 2020
This seems sort of intentional:
matplotlib/lib/matplotlib/axis.py
Line 1189 in 2c5c351
@anntzer can you comment on that? This seems like a regression from #10088.
Anyway, if this is the desired behavior, we should add a note in the tick label getter methods.
anntzer commentedon Jan 13, 2020
Previously ticks whose label1On attribute was set to False were excluded (per 525dcef#diff-52127080e2783464f529df684d82d476L1239), so I just remapped the behavior to get_visible(), as that was the point of #10088. So it's intended, but really more "staying consistent with the old behavior while merging two visibility knobs into a single one".
timhoffm commentedon Jan 13, 2020
Should we add an include_hidden parameter to control the behavior?
anntzer commentedon Jan 13, 2020
If we are going to change this (unclear whether we do) I would rather always return all of them and let the user filter them as needed -- we don't hide non-visible() children in other cases.
TheAngulion commentedon Jan 13, 2020
Thank you for the prompt and vigorous discussion on the issue. I will leave the technicalities to you as the experts but I personally side with anntzer's suggestion to always (or, at least by default) return all tick labels regardless of visibility and let the user filter. For what's it worth, I would find this the most intuitive.
github-actions commentedon Apr 6, 2026
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
timhoffm commentedon Apr 15, 2026
Single ticks should be considered ephemal. I don't think we can or should guarantee their lifetime. Overall, the strategy should be to migrate away from single tick objects.
I propose to close this as "won't fix".