Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix 3D set_aspect error cases #25481

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
oscargus merged 1 commit into matplotlib:main from scottshambaugh:3d_aspect_fix
Apr 5, 2023
Merged

Conversation

Copy link
Contributor

@scottshambaugh scottshambaugh commented Mar 17, 2023

PR Summary

Closes #25443

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

@scottshambaugh scottshambaugh added topic: mplot3d PR: bugfix Pull requests that fix identified bugs labels Mar 17, 2023
Copy link
Member

The test code is a bit messier now, and the image is more crammed. What if the test image had two rows, where the first row is the original set of aspect displays, and the second shows off the same set but with "datalim" as the adjustable?

Copy link
Contributor Author

Sure, I cleaned up the tests code a bit and made the images clearer.

Copy link
Member

Most of the original five cubes have now changed their appearance. Not sure if that was expected. Also, maybe I'm not understanding something, but why just add a single new subplot? I was thinking one row would be the original 5, and a second row would be the same aspects, but under the new condition. It would make it easy to visualize the effect of setting the datalim as the "adjustable".

Copy link
Contributor Author

Hi @WeatherGod, I’m not following the two rows idea. What do you mean by "the new condition"? This PR isn’t adding anything new.

for ax in axs.flatten()[0:-1]:
plot_cuboid(ax, scale=[5, 1, 1])
# plot a cube as well to cover github #25443
plot_cuboid(axs[1][2], scale=[1, 1, 1])
Copy link
Member

@WeatherGod WeatherGod Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over here. The first five subplots are done with 5x1x1 cuboid, but then the last one is done as a 1x1x1 regular cube. What I'm saying is that the first row can be done as 5x1x1, and the second row as 1x1x1, with each column being a different aspect mode.

We also still have to explain why some of the original five plots now look different. Was that supposed to be expected? I want to make sure the results make sense.

Copy link
Contributor Author

@scottshambaugh scottshambaugh Mar 23, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah originally it was a 1x1x5 and got switched as I was iterating, I switched it back to that just now so it should match what was there before.

After plotting it up I'm not getting too much from the second row... the cube was added because that was a failure case in the linked issue, but I don't think it helps too much to demonstrate the behavior to whoever is looking at tests rather than docs. But I'm happy to add it in if you find it useful.
aspects

Copy link
Member

@WeatherGod WeatherGod Mar 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think you are right, it isn't really all that illuminating. What you have now is good.

scottshambaugh reacted with thumbs up emoji
@oscargus oscargus added this to the v3.7.2 milestone Apr 5, 2023
Copy link
Member

oscargus commented Apr 5, 2023

Since this was introduced in 3.7(?), I think it makes sense to fix it for 3.7.2.

@oscargus oscargus merged commit be46312 into matplotlib:main Apr 5, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 5, 2023
rcomer added a commit that referenced this pull request Apr 6, 2023
...481-on-v3.7.x
Backport PR #25481 on branch v3.7.x (Fix 3D set_aspect error cases)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@WeatherGod WeatherGod WeatherGod approved these changes

@oscargus oscargus oscargus approved these changes

Assignees
No one assigned
Labels
PR: bugfix Pull requests that fix identified bugs topic: mplot3d
Projects
None yet
Milestone
v3.7.2
Development

Successfully merging this pull request may close these issues.

[Bug]: 3D set_aspect equal doesn't bound data in all cases

AltStyle によって変換されたページ (->オリジナル) /