Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
test annotate(textcoords=offset fontsize)#25989
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lib/matplotlib/tests/test_text.py Outdated
if i == 0: | ||
points_coords = str(ann.get_window_extent()) | ||
else: | ||
fontsize_coords = str(ann.get_window_extent()) |
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.
would spell the whole thing
anns= [ax.annotate(...)foriin ...]point_coords,fontsize_coords= [ann.get_window_extent()foranninanns]assertstr(point_coords)==str(fontsize_coords)
but either way works.
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 you're happy with that, I'll squash it down 👍
PR summary
PR checklist
Closes#25907. Adds a test to check that the annotation
offset_fontsize
parameter actually offsets the text by the correct fontsize units. The unit distance was measured by comparing the fontsize against the number of points inoffset_points