Skip to content

[MNT]: Refactor data limit handling #28816

Open

Description

@timhoffm

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.

Activity

  1. anntzer commented on Sep 19, 2024

    @anntzer
    Contributor

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

  2. timhoffm commented on Sep 20, 2024

    @timhoffm
    MemberAuthor

    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`.

  3. gabisoaresm commented on Oct 19, 2024

    @gabisoaresm

    Can I work on this issue?

  4. timhoffm commented on Oct 19, 2024

    @timhoffm
    MemberAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions