Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Draw 3D gridlines below axis lines, labels, text, and ticks #25482

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

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

scottshambaugh
Copy link
Contributor

@scottshambaugh scottshambaugh commented Mar 17, 2023

PR Summary

Right now, 3D gridlines are drawn on top of more important elements such as the axis lines, labels, text, and ticks. I consider this a visual bug, as it obscures the information that the user cares about. This PR changes the draw order so that 3D gridlines are above only the 3D axis panes, and below everything else.

This requires updating 53 out of 57 test_axes3d baseline images, all 3 test_label3d baseline images, and 2 other baseline images that used 3D axes. These are minor changes in all instances, and I think these two diffs are the largest & most illustrative (you'll probably want to look at the "Files changed" swipe view for these):

axes3d_primary_views:
axes3d_primary_views-failed-diff

axes3d_labelpad:
axes3d_labelpad-failed-diff

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [N/A] New plotting related features are documented with examples.

Release Notes

  • [N/A] New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • [N/A] API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • [N/A] Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@QuLogic
Copy link
Member

QuLogic commented Apr 7, 2023

Have you confrmed that this looks correct when grid lines are disabled? We don't appear to have any tests that turn them off, so I'm uncertain if that's even possible for 3D Axes.

@oscargus
Copy link
Member

oscargus commented Apr 7, 2023

Oh, btw, can you please change all tests that now require new images to use style='mpl20' (if they are not)?

@scottshambaugh
Copy link
Contributor Author

scottshambaugh commented Apr 11, 2023

Thanks for the reviews! @QuLogic I added a new test to exercise hiding gridlines, ticks, and axis spines (invisible_grid_ticks_axis.png), and @oscargus I added style='mpl20' to all the applicable image tests. There were a few that had style=('classic', '_classic_test_patch'), which I left alone.

@oscargus
Copy link
Member

There were a few that had style=('classic', '_classic_test_patch'), which I left alone.

That is just there to enable a transition to mpl20 as default at a later stage, see #24716, so please update those as well.

@scottshambaugh
Copy link
Contributor Author

Sure thing @oscargus, moved those over.

@oscargus
Copy link
Member

Thanks! (Although I must admit that I expected more "fundamental" changes when changing the style...)

@oscargus oscargus added this to the v3.8.0 milestone Apr 15, 2023
@scottshambaugh
Copy link
Contributor Author

Would recommend merging this sooner rather than later, since it will conflict with any MR that modifies the mplot3d test images.

Add mplot3d test to cover hiding most elements

mpl20 style on test images
@QuLogic QuLogic merged commit 7e23435 into matplotlib:main Apr 29, 2023
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.

3 participants