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

Skip to content

Optimize 3D data limits calculation by simplifying direct updates to dataLim #28998

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 2 commits into from

Conversation

Thierno88
Copy link

This pull request addresses the inefficiency in updating 3D dataLim for plots in Matplotlib by eliminating unnecessary data processing and copying. Instead of creating a new _Bbox3d class, this PR introduces methods to directly compute and update the X, Y, and Z data limits using individual functions for each axis (get_datalim_x, get_datalim_y, get_datalim_z). This simplifies the code and improves performance by reducing the overhead of manipulating large data structures.

The change allows for direct updates of dataLim within the plotting logic, making the process of auto-scaling more efficient. This resolves the same core problem as discussed in issue #28403 but with a different approach, focusing on minimal code changes and improved performance.

PR Checklist:

Copy link

@github-actions github-actions bot left a 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 week or so, please leave a new comment below and that should bring it to our attention. 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.

@timhoffm
Copy link
Member

@Thierno88 do you mean #28444 instead of #28403?

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

This only proposes set_datalim_x/y/z() and corresponding properties datalim_x/y/z. I does not show how this is integerated with the current code, i.e. the auto limits, which #28444 is primarily about. I'm not convinced this new API is helping with that (or maybe I'm just not seeing it, because that part is not implemented here).

I'm also a bit sceptical to introduce z-information in the basic Artist. So far, the main matplotlib code is all 2D and 3D aspects are limited to mpl_toolkits.mplot3d.

@Thierno88 Thierno88 closed this by deleting the head repository Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

3 participants