Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Milestone
Description
Problem
To better support interactivity and contextual data, we should support data tooltips.
Proposed solution
Things to be done:
- 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 aTooltipEvent
or a more generalHoverEvent
? - 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.
- 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})')
- explicit strings: