Skip to content

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

Closed

Description

@sorenwacker

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.

Activity

  1. jklymak commented on Jun 3, 2019

    @jklymak
    Member

    This will be provided by #13072

  2. github-actions commented on Jun 19, 2023

    @github-actions

    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!

  3. rcomer commented on Jun 19, 2023

    @rcomer
    Member

    This was done in #19743 I think.

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

  4. added this to the v3.7.0 milestone on Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions