Skip to content

MultiCursor should be able to bind to axes in more than one figure... #23339

Closed

Description

@jklymak

Multicursor only works if all the axes are in the same figure...

Each tab is its own Figure/Canvas. MultiCursor only binds itself to one Canvas so it only sees mouse events from axes on in the figure that canvas is associated with.

The fix here is to add a check that all Axes are in the same Figure on init and raise otherwise.

Originally posted by @tacaswell in #23328 (comment)

and possible solution:

While I haven't looked at the details, it should be possible (and hopefully easy) for MultiCursor to just loop over all canvases of all artists (both when connecting the callbacks, and in the callbacks implementations). mplcursors does something similar, e.g. registration over all canvases is at https://github.com/anntzer/mplcursors/blob/main/lib/mplcursors/_mplcursors.py#L256-L259.

Originally posted by @anntzer in #23328 (comment)

Activity

  1. tacaswell commented on Jun 24, 2022

    @tacaswell
    Member

    This is complicated by #21496 .

  2. added this to the needs sorting milestone on Jun 24, 2022
  3. removed this from the future releases milestone on Oct 6, 2022
  4. added this to the v3.6.0 milestone on Jun 21, 2025
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions