Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
add itemboxalign option to legend constructor#29197
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this 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.
timhoffm commentedNov 28, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the contribution. This looks fundamentally reasonable. I'm still thinking about proper naming. Note: We unfortunately have analignment parameter that only covers the horizontal alignment of title and content and is thus too generic and semantically overlapping the alignment here. But for backward-compatibility we cannot change that. The new naming needs to be more specific, but |
I'll also note that in Legend documentation, the term "entry" is also used for the marker+label combination:
So, perhaps also |
PR summary
This pull request adds the option "itemboxalign" to the Legend constructor. From the proposed announcement .rst:
Legend previously always aligns items using the "baseline" option, which results in
the appearance of vertical centering of the artist and label for multi-line labels.
This is sometimes hard to read. The introduction of the
itemboxalign
parameter to the Legend constructorallows the user to change this behavior and choose a different desired vertical alignment.
I chose the name "itemboxalign" on a whim based on the existing rendering code in Legend. I think the name could be better, such as:
itemboxalignment
itemboxverticalalign
itemboxverticalalign(ment)
labelverticalalign(ment)
PR checklist