-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: EPS savefig messed up by 'figure.autolayout' rcParam on 3.5.0 #21930
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
Comments
I can confirm this, but I don't understand it. If you instead do import matplotlib.pyplot as plt
# plt.rcParams['figure.autolayout'] = 'True'
plt.figure(layout='tight')
plt.plot([1, 2, 3], [1, 2, 3], 'o-')
plt.title(r'$\sum_{i=0}^{\infty} x_i$ just a test')
plt.savefig('test2.eps', format='eps') it works fine. If you use the rcParam and save as PDF it works fine. So I'm not sure why the ps backend is doing something different. |
Same behaviour with |
Still not fixed in 3.5.1 |
someone will have to dig into it before it gets fixed. |
I'm not sure how you got this to work, I see no appreciable difference in the file between the |
Oh good, I must have been mixing up files somehow. Glad that it is consistent between the ways to set tight_layout... |
I've just tested it out and... plt.figure(layout='tight') gives a broken result like with the But plt.tight_layout() does not. 🤔 |
Same here with version 3.5.1 in archlinux.
|
Bug summary
Setting 'figure.autolayout' to 'True' removes most of the EPS savefig.
Code for reproduction
Actual outcome
Actual image after being exported from gimp (300dpi)
This is the EPS file:
https://we.tl/t-ka6aoUGxKm
Expected outcome
Expect the image in ".eps" file like this.
This is the EPS file:
https://we.tl/t-Q7WBPMwDcy
Additional information
I found this bug by an accident while using a custom ".mplstyle" on Matplotlib 3.5.0
Seems like this rcParam
['figure.autolayout'] = 'True'
destroys about 2/3 of the eps file.plt.tightlayout()
seem to not affect the result, the bug happens only with this rcParam on the latest matplotlib version.This is the code for the expected outcome.
Operating system
Windows
Matplotlib Version
Bug present only on 3.5.0
Matplotlib Backend
Qt5Agg
Python version
Tested with 3.10 and 3.9
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: