Skip to content

[ENH]: Enable native tab support, with MultiCursor functionality (improvement on plotWindow) #23328

Closed

Description

@goobleplax

Problem

The program plotWindow allows several tabs to be created, and subplots within each tab.

The problem is that plotWindow seems unable to display a vertical cursor in several tabs, using MultiCursor.

Proposed solution

One solution could be to enable support for tabs natively within MatPlotLib. This would make it possible to use MultiCursor correctly for all subplots, and with all tabs.

Otherwise, if anyone has ideas about how to solve the problem of plotWindow integration with MatPlotLib (specifically, how to use a vertical cursor across subplots, and to allow this for all tabs), that would be fine if native tabs support is too hard.

Activity

  1. QuLogic commented on Jun 23, 2022

    @QuLogic
    Member

    If you have a problem with plotWindow, I'm not sure why you reported it here and not to them.

    Anyway, the tabbed view request is a duplicate of #2194.

  2. goobleplax commented on Jun 23, 2022

    @goobleplax
    Author

    The problem isn't only with plotWindow.

    Your mention of issue #2194 led me to the program mpl-multitab by @astromancer, mentioned here:

    #2194 (comment)

    The problem is reproduced there as well (MultiCursor only displays vertical cursor on the last tab).

    So it seems to be an issue with MatPlotLib and/or implementation of MultiCursor.

  3. jklymak commented on Jun 23, 2022

    @jklymak
    Member

    @goobleplax this sort of thing is exactly why we don't support tabs. The interactions between canvases can be quite complex, and one use cases' idea of how it should work is different than another use case.

    In this case, if one of the tabbed library authors has an upstream fix for us, we are happy to consider it, but the core library cannot guarantee and test that every widget works on every downstream library.

    Matplotlib is foremost a library, but we supply simple apps to interact with the library (the interactive backends). Requests to expand the scope of those simple apps need to be weighed very carefully against our very limited maintenance ability, and the fact that such expansions need to be supported across an imposing matrix of backends and operating systems. Multi-tab only works with Qt, for instance. The tools that we do have get out of sync across backends, and/or break, and impose quite a maintenance burden.

    Regardless, please carry on discussion in #2194.

  4. tacaswell commented on Jun 24, 2022

    @tacaswell
    Member

    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.

  5. anntzer commented on Jun 24, 2022

    @anntzer
    Contributor

    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.

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