-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Superscripts in axis label cut when saving .eps with bbox_inches="tight" #7075
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've been having some issues with text bounding boxes being wrong for axis labels on 2.0 (when saving PDFs in my case). Will investigate if this is the same bug... |
And to follow up on this, my issue is unrelated to usetex, so I don't think it's the same issue... |
I was having trouble with y-axis labels being cut off: it was fine for pgf output, but broke when using EPS. Googling brought me here, so I tried removing 'usetex = True' and it solved the problem. |
It causes labels to be chopped off e.g. see matplotlib/matplotlib#7075
This is still a bug on master... Its obviously the superscript that is causing the problem, with the text bounding box not surrounding the superscript. |
... same thing happens for a title. |
I'll close this in favour of #21653, which is the same thing, but perhaps easier to follow (bug doesn't depend on clipping or eps, etc) |
I have been saving some .eps plots using:
matplotlib.pyplot.savefig(file.eps, bbox_inches="tight")
and this works as expected; however, when using:
matplotlib.rcParams['text.usetex'] = True
matplotlib.pyplot.savefig(file.eps, bbox_inches="tight")
the y axis label is cut.
It has been noted before that there has been some issues with .eps fies and usetex (Bounding box no longer works for EPS files if usetex=True #85) but I don't know in what way the bounding box was wrong and I am also using a matplotlib version that is 5 years on.
Here is a somewhat forced example and the results.
Example
Results
Without
As expected

With
Y axis label cut

System
Matplotlib 1.5.1
Python 2.7.12 (Anaconda install)
CentOS Linux release 7.2.1511
GPL Ghostscript 9.07 (2013-02-14)
The text was updated successfully, but these errors were encountered: