Skip to content

tight_layout() messes up bbox_to_anchor in legend(). #14432

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

Closed
sorenwacker opened this issue Jun 3, 2019 · 3 comments
Closed

tight_layout() messes up bbox_to_anchor in legend(). #14432

sorenwacker opened this issue Jun 3, 2019 · 3 comments
Milestone

Comments

@sorenwacker
Copy link

sorenwacker commented Jun 3, 2019

Bug report

I want to plot something with the legend outside the figure. I am using

 legend(bbox_to_anchor=(1.2, 1))

To position the legend and then I have to do

 tight_layout()

To make sure the plot is complete when saved to a file.

Unfortunately, tight_layout() pushes the legend into the figure no matter what values I put in the legend function.

It would be nice to have more convenient ways to postion the legend beside or even above or below the figure.

@jklymak
Copy link
Member

jklymak commented Jun 3, 2019

This will be provided by #13072

@github-actions
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Jun 19, 2023
@rcomer
Copy link
Member

rcomer commented Jun 19, 2023

This was done in #19743 I think.

Edit: though you need to use constrained layout rather than tight layout.

@rcomer rcomer closed this as completed Jun 19, 2023
@QuLogic QuLogic removed the status: inactive Marked by the “Stale” Github Action label Jun 19, 2023
@QuLogic QuLogic added this to the v3.7.0 milestone Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants