Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug]: Legend with location set to ‘best’ overlaps with the title when the titles is moved down #29319

Copy link
Copy link
Open
@aweinstein

Description

@aweinstein
Issue body actions

Bug summary

If I adjust the y-position of a plot title to move it down, and then I add a legend with loc set to best, the legend overlaps with the title.

Code for reproduction

import matplotlib.pyplot as plt

plt.close('all')
plt.plot((1,2,3), label='Just a very long legend')
plt.title('Just a very long title 1234567890', y=0.9)
plt.legend(loc='best')
plt.show()

Actual outcome

foo

Expected outcome

I expect the legend to be placed in a location that does not overlap with the title.

Additional information

No response

Operating system

Linux

Matplotlib Version

3.9.4

Matplotlib Backend

qtagg

Python version

3.12.7

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.