Closed
Description
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
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
Metadata
Metadata
Assignees
Labels
No labels
Activity
dstansby commentedon Dec 29, 2021
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 commentedon Dec 29, 2021
Yes, title overlaps with both
layout='constrained'
andlayout='tight'
. The title is moved up (ifAxes._autotitlepos
is True) to not overlap with a top x axis, but an y axis offset text is currently not taken into account.