-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[WIP] Fix annotation get window extent #4023
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Fix annotation get window extent #4023
Conversation
Great! This looks like it will need a re-base to current master already. |
All reactions
Sorry, something went wrong.
I am on it |
All reactions
Sorry, something went wrong.
Conflicts: lib/matplotlib/tests/test_text.py
conflict resolved, please note that I still need to fix and add a couple of tests |
All reactions
Sorry, something went wrong.
@image_comparison(baseline_images=['text_bboxclip']) | ||
def test_bbox_clipping(): | ||
plt.text(0.9, 0.2, 'Is bbox clipped?', backgroundcolor='r', clip_on=True) | ||
t = plt.text(0.9, 0.5, 'Is fancy bbox clipped?', clip_on=True) | ||
t.set_bbox({"boxstyle": "round, pad=0.1"}) | ||
|
||
|
||
def test_text_annotation_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.
It is easier to add the @cleanup
decorator use pyplot to make your figure/axes objects.
Sorry, something went wrong.
All reactions
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.
Maybe, I now see why you are doing it this way.
Sorry, something went wrong.
All reactions
I have cherry-picked these over to be based on the 1.4.x branch. I should have a version of this merged in the near future. |
All reactions
Sorry, something went wrong.
…w-extent BUG : annotation objects did not report their window extent properl
Merged in to v1.4.x as 26c7d65 |
All reactions
Sorry, something went wrong.
Thanks @tacaswell. Sorry for the delay. I will make a separate PR for the additional tests. |
All reactions
Sorry, something went wrong.
@itziakos Thanks for your work. Sorry if you feel like I stepped on your toes, I wanted to get this in and this was the fastest path to get there. |
All reactions
Sorry, something went wrong.
There was no offense taken, It is me who should apologize for the delay. |
All reactions
Sorry, something went wrong.
Successfully merging this pull request may close these issues.
None yet
This PR reworks
Annotation
to provide a get_window_extent method that will return as bounding box the union of the contained text and arrow.Pending: