Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
FIX/ENH: include text in ax.get_tightbbox#10678
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
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.
Looks good, subject to tests passing.
OK, actually, I'm a little confused now about the API for matplotlib/lib/matplotlib/axes/_base.py Line 4094 in4f5715a
It says that it will the matplotlib/lib/matplotlib/backend_bases.py Line 2190 in4f5715a
whereall the artists are iterated through and added to the bbox. I guess I don't see why this functionality isn't moved into Pros: are that dangling artists get counted for layout easily. Cons: its possible that the user would want the layout to ignore some artists when making a layout. Comments? |
Closing in lieu of#10682, which I think is a more comprehensive solution. |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
If text overflows an axes,
ax.get_tightbbox
doesn't include it.Note this doesn't require
constrained_layout
to be a problem.Saving withEDIT: This wasn't true -bbox_inches='tight'
will also cut the extra text off..bbox_inches='tight'
renders the figure and then figures out the bbox. But, I don't see why we wouldn't include over-spilling text in the tight bbox for an axes.Before
After
PR Checklist