Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Autopositioned title overlaps with offset text #22062

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
StefRe opened this issue Dec 29, 2021 · 2 comments · Fixed by #22063
Closed

[Bug]: Autopositioned title overlaps with offset text #22062

StefRe opened this issue Dec 29, 2021 · 2 comments · Fixed by #22063
Milestone

Comments

@StefRe
Copy link
Contributor

StefRe commented Dec 29, 2021

Bug summary

Autopositioned title overlaps with offset text of y axis.

Code for reproduction

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([1e8, 2e8])
ax.set_title('Title', loc='left')
plt.show()

Actual outcome

old

Expected outcome

Title would move to not overlap with offset text (as it is the case for a top x axis).

Additional information

No response

Operating system

No response

Matplotlib Version

3.5.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

No response

@dstansby
Copy link
Member

I'm not 100% sure we guarantee that artists won't be overlapping by default. If you do .tight_layout() or .constrained_layout(), does the title still overlap with the offset text?

@StefRe
Copy link
Contributor Author

StefRe commented Dec 29, 2021

Yes, title overlaps with both layout='constrained' and layout='tight'. The title is moved up (if Axes._autotitlepos is True) to not overlap with a top x axis, but an y axis offset text is currently not taken into account.

@QuLogic QuLogic added this to the v3.6.0 milestone Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants