Skip to content

[MNT]: Refactor data limit handling #28816

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

Open
timhoffm opened this issue Sep 13, 2024 · 4 comments
Open

[MNT]: Refactor data limit handling #28816

timhoffm opened this issue Sep 13, 2024 · 4 comments

Comments

@timhoffm
Copy link
Member

Summary

Currently, the approach is calling _AxesBase.update_datalim in the plot factory functions with an array of points (often with an already reduced list [(xmin, ymin), (xmax, ymax)] but not always. The information is ad-hoc generated in the factory function.

Proposed fix

We should switch to pushing the logic for data limit evaluation into the Artists. Then the plot factory functions only query the created Artist for their limits and pass that on.

@anntzer
Copy link
Contributor

anntzer commented Sep 19, 2024

Also related to #28101 (comment) and issues linked therein.

@timhoffm
Copy link
Member Author

Note: We have a mechanism for collections : https://matplotlib.org/devdocs/api/collections_api.html#matplotlib.collections.Collection.get_datalim
And Axes.add_collection will use this depending on the autolim parameter`.

@gabisoaresm
Copy link

Can I work on this issue?

@timhoffm
Copy link
Member Author

@gabisoaresm everybody is welcome to contribute. However, for this issue, you should have relevant experience in API design and refactoring. Currently, only the high-level goal is given. Part of the task here is to Analyse the code base and decide how this can be modified to achieve the goal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants