← 返回首页
helper method to add text to the corner or center of a graphic by kushalkolar · Pull Request #738 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

helper method to add text to the corner or center of a graphic#738

Draft
kushalkolar wants to merge 4 commits into
mainfrom
text-on-graphics
Draft

helper method to add text to the corner or center of a graphic#738
kushalkolar wants to merge 4 commits into
mainfrom
text-on-graphics

Conversation

kushalkolar commented Feb 24, 2025
edited
Loading

Copy link
Copy Markdown
Member

very simple, API subject to change later, text moves if the graphic offset changes, or if the data changes in the case of lines and scatters

kushalkolar requested a review from clewis7 as a code owner February 24, 2025 09:12
kushalkolar marked this pull request as draft February 24, 2025 09:44

clewis7 commented Feb 24, 2025

Copy link
Copy Markdown
Member

I think this could be super useful. Even in the kmeans example, I was thinking about how nice it would be to have a label for each centroid point. Although, that would be giving a label to each point in a scatter, as opposed to a single label for a graphic. Should we support both?

The only potential issue that I see is if the graphics were super close to each other and the labels overlapped. How to reconcile potential readability issues. I guess making it easy to change what corner or position on the graphic the text is would be easiest.

Copy link
Copy Markdown
Member Author

I think this could be super useful. Even in the kmeans example, I was thinking about how nice it would be to have a label for each centroid point. Although, that would be giving a label to each point in a scatter, as opposed to a single label for a graphic. Should we support both?

In that case a user can easily create TextGraphic with the offset set near the scatter point. Maybe for scatters we override add_text() and have the option to place it w.r.t. a bbox corner or w.r.t. certain scatter indices?

The only potential issue that I see is if the graphics were super close to each other and the labels overlapped. How to reconcile potential readability issues. I guess making it easy to change what corner or position on the graphic the text is would be easiest.

This can come later.

Copy link
Copy Markdown
Member Author

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Footer

© 2026 GitHub, Inc.