Skip to content

[Doc]: xlim_changed and ylim_changed not listed with other events #30647

Open

Description

@cmp0xff

Documentation Link

https://matplotlib.org/stable/users/explain/figure/event_handling.html

Problem

Suggested improvement

  • Include these two events in the list

Activity

  1. timhoffm commented on Oct 10, 2025

    @timhoffm
    Member

    This needs better documentation, but the topic is a bit more complex than just adding to the list as these are slightly different topics: Axes events vs GUI events. Both use a CallbackRegistry but

    xlim_changed / ylim_changed GUI events
    callback registry Axes.callbacks figure.canvas.callbacks
    callback signature def handle_lim_change(ax: Axes) def handle_event(event: Event)

    We actually have a couple more callback registries: https://github.com/search?q=repo%3Amatplotlib%2Fmatplotlib+%2FCallbackRegistry%2F+path%3A*.py&type=code

  2. shiivangr commented on Oct 10, 2025

    @shiivangr

    Hi! I'd like to work on this. I'm planning to add a section that distinguishes
    between Axes events (xlim_changed, ylim_changed) and GUI events with examples.

  3. timhoffm commented on Oct 10, 2025

    @timhoffm
    Member

    @shiivangr Thanks for your willingness to contribue. However, I think we'd need a more general section on callbacks see the linked cases above. I'm even unaware how systematically designed our use of callbacks is. It feels a bit bolted-on in some places.

  4. shiivangr commented on Oct 10, 2025

    @shiivangr

    I understand you'd like more comprehensive callback documentation. Is this the right scope for me as a new contributor? I'm happy to take on the challenge if you think it's manageable

  5. timhoffm commented on Oct 10, 2025

    @timhoffm
    Member

    The problem is I'm not clear that attaching the callback registries to all the objects is an architecture we want to pursue in the long run. Therefore, I'm not clear we want to advertize this in the docs more.

  6. rcomer commented on Apr 14, 2026

    @rcomer
    Member

    Marking this as “needs discussion” because, per #30647 (comment), we need to decide how much we want to advertise the various callback registries before anyone can write a PR.

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