Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Bug summary
When using a polar coordinate system the plot title overlaps with the axis labels. This worked in 3.9.4 and broke with 3.10.0. This commit broke it:8abe308 via#28300
Code for reproduction
importmatplotlib.pyplotaspltplt.polar([0,1], [0,1])plt.title('My Title')plt.savefig('output.png')
Actual outcome
The title overlaps the axis labels
Expected outcome
The title should be above the axis labels
Additional information
- This bug happens with the new 3.10 version, but with the 3.9.4 version
I performed a git bisect using this:
git bisect start
git bisect good v3.9.4
git bisect bad HEAD
a small test scriptcheck.py
- there's probably a better way, but that's what I came up with. (Note that the issues also comes up when not using `bbox_inches='tight', but this way it was easier to bisect, since I could instrument the image size)
importmatplotlib.pyplotaspltfromPILimportImagedefmain():plt.polar([0,1], [0,1])plt.title('My Title')plt.savefig('output.png',bbox_inches='tight')withImage.open('output.png')asimg:size=img.sizeifsize!= (453,464):return1else:return0if__name__=='__main__':raiseSystemExit(main())
finally,
git bisect run python3 check.py
After a few steps it yielded this suspicious commit:8abe308 (cc@rcomer) which was merged in#28300
Operating system
Ubuntu 22.04
Matplotlib Version
3.10.0.dev1180+gc2d502d219
Matplotlib Backend
agg
Python version
3.13.1
Jupyter version
No response
Installation
git checkout