FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

TST: Use text placeholders for empty legends by QuLogic · Pull Request #29908 · matplotlib/matplotlib · GitHub

Repository navigation

TST: Use text placeholders for empty legends - #29908

Merged
tacaswell merged 1 commit into
matplotlib:mainfrom
QuLogic:legend-placeholders
Apr 17, 2025
Merged

tacaswell merged 1 commit into
matplotlib:mainfrom
QuLogic:legend-placeholders

Conversation

QuLogic commented Apr 12, 2025

Copy link
Copy Markdown
Member

PR summary

These tests use remove_text=True and set legend labels to empty strings. However, they are still affected by font metrics because even the empty string is as tall as the line height (which is calculated from the height of the "lp" string.)

This depends on #29907.

PR checklist

Copy link
Copy Markdown
Member

👍🏻 now needs a rebase.

timhoffm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Now that text uses placeholders, can we change label=" " to some actual text like label="foo" or label="label"? This feels more normal and may be less confusing when reading the test, or when taking the code and running it without placeholders for debug purposes. The label=" " was only there to reduce the font-rendering impact. I don't see a reason we should keep it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why don't the black boxesh show up here like they do in the png?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ah, it just stopped after the first extension, and I didn't catch it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Because the mpl20 style doesn't have patch edges, I also decided to remove the forced blue colour on the bars, since they all look like single bars instead of stacked ones.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I also reverted the texts here to the values before 966e467

QuLogic force-pushed the legend-placeholders branch 3 times, most recently from 92cd616 to 2053e8c Compare April 15, 2025 03:02
QuLogic force-pushed the legend-placeholders branch from 2053e8c to 6f93bdc Compare April 15, 2025 22:42
These tests use `remove_text=True` and set legend labels to empty
strings. However, they are still affected by font metrics because even
the empty string is as tall as the line height (which is calculated from
the height of the "lp" string.)
QuLogic force-pushed the legend-placeholders branch from 6f93bdc to 7cdc74f Compare April 16, 2025 05:23
tacaswell modified the milestones: v3.11.0, v3.10.2 Apr 17, 2025
tacaswell merged commit c1a2ec4 into matplotlib:main Apr 17, 2025
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 17, 2025
QuLogic deleted the legend-placeholders branch April 17, 2025 19:23
rcomer pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 20, 2025
QuLogic pushed a commit to meeseeksmachine/matplotlib that referenced this pull request May 6, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL