Skip to content

Restore axis title set to the right on a twinx() copied axis when cleared. #28321

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

Closed
wants to merge 6 commits into from

Conversation

pizzathief
Copy link
Contributor

PR summary

When an axis is copied using twinx() the twin title is set to the right. If that axis is then cleared and its title text is set again,
the title is set back to the left. This PR alters that behaviour to be forced back to the right again.

closes #28268.

There was one test warning:
test test_pickle_load_from_subprocess
"This figure was saved with matplotlib version 1.6.0.dev34660+gae23583050.d19700101 and loaded with 1.6.0.dev34660+gae23583050.d20240530 so may not function correctly."

I'm hoping this doesn't appear on matplotlib's test runner.

@pizzathief
Copy link
Contributor Author

oops, I'd better remove those merge branch commits...
I was wondering if its better if I put in a private __twinx variable to make sure the axis was made using the twinx() function, rather than just setting the label alignment back to 'right' if it was set that way at the start of clear() for any axis.

@pizzathief pizzathief closed this May 31, 2024
@pizzathief pizzathief deleted the bug_#28268 branch May 31, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: y_label in wrong place after clearing for twinx axes
1 participant