Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Draft PR: On adding data tooltip support (#23378)#30133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Dil003 wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromebubekir-pulat:data-tooltip-support

Conversation

Dil003
Copy link

Hello there,

This pull request introduces basic native tooltip support in Matplotlib, addressing issue#23378. The goal is to enable tooltips that display arbitrary user-defined data, and not just coordinates, when hovering over data points.

I’m new to contributing to the Matplotlib open-source project, and with this implementation, I’ve done my best to follow the development guidelines.I welcome any feedback for improvement. I have also reviewed the previous pull request#25831, which was rejected, and I want to ensure my current approach aligns better with Matplotlib’s goals. At this stage, I would greatly appreciate feedback on whether I’m heading in the right direction.

The following components are currently working:

High-level API support:
plt.plot(x, y, tooltip=['A', 'B', 'C']) now accepts the tooltip argument. Tooltip data is correctly extracted from kwargs in axes.py.

Data storage system:
Artists support set_tooltip() and get_tooltip().
Tooltips support:

  • Strings (e.g. "Data point")

  • Lists (e.g. ['A', 'B', 'C'])

  • Functions (e.g. lambda x, y: f'({x}, {y})')

Basic infrastructure:

  • Canvas includes show_tooltip() and hide_tooltip()

  • Figure implements _on_mouse_move_for_tooltip() to handle mouse movement

  • Local installation works using pip install -e .

I have tested the following so far:

Tooltip data is being stored correctly:
Screenshot 2025-06-02 at 11 05 12 PM
My backend supports tooltip-related data functions:
Screenshot 2025-06-02 at 11 06 24 PM

What I currently need help with is mouse event detection. At the moment, hovering over data points does not trigger the tooltip display. Since adding this feature touches many parts of the codebase, I am unsure how to properly integrate this with Matplotlib’s existing event-handling system. Any guidance or suggestions would be greatly appreciated.

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Dil003@Dilraj3

[8]ページ先頭

©2009-2025 Movatter.jp