-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Share subplots() label visibility handling with label_outer(). #19540
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these possible bugs only have an effect if you've already set some labels, and nothing is testing that.
oops. fixed, with a test. |
Code coverage appears to be saying that there should be a test for when the |
This allows label_outer() to also benefit from handling of top-or-right labeled axes (not only for the tick labels, but also for the axis labels themselves).
fixed coverage. |
self.set_xlabel("") | ||
self.xaxis.set_tick_params(which="both", labeltop=False) | ||
if self.xaxis.offsetText.get_position()[1] == 1: | ||
self.xaxis.offsetText.set_visible(False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part not tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because moving offset texts is somewhat broken anyways (#19471).
self.set_ylabel("") | ||
self.yaxis.set_tick_params(which="both", labelright=False) | ||
if self.yaxis.offsetText.get_position()[0] == 1: | ||
self.yaxis.offsetText.set_visible(False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...ditto
This allows label_outer() to also benefit from handling of top-or-right
labeled axes (not only for the tick labels, but also for the axis labels
themselves).
followup to #19472.
edit: this should also be useful for #18305.
PR Summary
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).