Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ENH]: Data tooltip support #23378

Open
@timhoffm

Description

@timhoffm

Problem

To better support interactivity and contextual data, we should support data tooltips.

Proposed solution

Things to be done:

  1. Add tooltip API to backend_bases. This should be similar to the picker functionality, only with hover instead of click. T.b.d.: Do we want a TooltipEvent or a more general HoverEvent?
  2. Implement that API for the backends. As a first step or prove of concept one could start with one backend, e.g. Qt and add the other backends later. ipympl could/should follow at some point as well.
  3. Add high-level API to support setting tooltips.
    We likely want at least:
    • explicit strings: plt.plot(x, y, tooltip=['A', 'B', 'C', 'D'])
    • data support: plt.plot('x', 'y', tooltip='label', data=data)
    • functions: plt.plot(x, y, tooltip=lambda x, y: f'({x}, {y})')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions