Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Cleanups to Annotation.#25940
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
Cleanups to Annotation.#25940
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.
Nit that I expect you'll tell me to implement in a follow up.
lib/matplotlib/text.py Outdated
'offset points' Offset (in points) from the *xy* value | ||
'offset pixels' Offset (in pixels) from the *xy* value | ||
================= ========================================= | ||
'offset fontsize' Offset (relative to fontsize) from the *xy* value |
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.
Slightly unclear what relative to font size means here - I can do a followup on the annotations tutorial to add an offset font size example, but can this be in some form similar to "offset in x relative to font size from thexy value"
And yeah I disagree with the parenthesis here b/c in this whole chunk the unit is the important bit, would probably rework table so that the header is "value | unit of offset fromxy "
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.
What other font size there is? This is literally in the docstring forannotate() which is about putting atext somewhere.
I did remove the parentheses, though.
I do think keeping thesame header as for xycoords is better, as this table is supposed to be a continuation of the one just above.
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.
What I mean is what does relative to font size mean - like if I set offset to (12,12) in font size, what does that mean for how far the offset is from the text?.
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.
If your font size is 12pt, then 1 means "12 pt".
- Reorder logic in _get_xy_transform to make the case of xy0 not being specified (i.e. invalid bbox_name) fail more obviously.- Document "offset fontsize" option.
Also, I think it would be nice to a add a test for some Is |
anntzer commentedMay 21, 2023 • 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.
I guess so, but I don't think e.g.
If you're thinking
At least#25905 will exercise this in building the docs; I'll skip actual tests for now... |
oscargus commentedMay 22, 2023 • 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.
More something like: ifunit=="points":scale=self.figure.dpi/72# dpi/72 dots per pointelifunit=="pixels":scale=1. ...returnAffine2D().scale(scale).translate(*xy0) |
But there's the unit == "fraction" case, which is a bit ugly to also handle here. |
Fair enough. Didn't see that. |
See discussion at#25907.
PR summary
PR checklist