-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix y axis on 3d plot #21424
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
fix y axis on 3d plot #21424
Conversation
This commit corrects the axis which the 3D y axis inherits from. The y-axis on 3D plots initially inherited from the x axis object, rather than a y axis object. This resulted in a bug where the x axis (instead of the y) was inverted for 3D plots when was called. After inheritance correction, correct behavior was achieved with inversion, but the tick marks were incorrectly placed. The default location for tick marks on the y-axis is now set to be right, rather than left. Resolves matplotlib#21369
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Does this work okay if you rotate the axes so that the y axis is on the left side? There may be some automated alignment picker that assumes the labels were on the 'bottom of the x axis'. I think the other test failures are in the wrong grid lines. I'll mark this Draft for now. |
Good point. I will check for that. |
I've tried rotation with both the feature and main versions of this code reported in the issue with the following results (attached). The first figure is from this feature branch, the second is from main branch. There is no resulting error, and with a rotation of 200 degrees, each appears okay. Is there a recommended more systematic way to test this? There does seem to be something that needs to be fixed for this branch when a Y label is present (y label and tick labels overlap), so this is a to-do: |
OK, that's good. If you want to test directly at some direction, you can use |
Hi @QuLogic - thanks. I did use It seems like some failures may have to do with reference figures, and I'm not sure how I would approach this. |
That one is likely okay, but the ones with extra tick lines (e.g., |
I'm going to close this because we resolved the issue in a different way. Thank you for your work @janash and I hope we hear from you again! |
This commit corrects the axis which the 3D y axis inherits from. The y-axis on 3D plots initially inherited from the x axis object, rather than a y axis object. This resulted in a bug where the x axis (instead of the y) was inverted for 3D plots when was called. After inheritance correction, correct behavior was achieved with inversion, but the tick marks were incorrectly placed. The default location for tick marks on the y-axis is now
set to be right, rather than left.
Resolves #21369
PR Summary
See commit message. This PR unfortunately causes failure of most tests in mplot3D at the moment.
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).