-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
figure including align fails to output eps using savefig #11233
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 cannot reproduce the error (after adding |
Thank you for looking into this. This seems to be specific to eps and ps, the figure saves fine as a pdf which I think will work for my current task. In the meantime, I have attached all uncommented lines of my matplotlibrc file.
Following your comment, I also recreated this issue with my MacOSX system. The matplotlibrc file on this system only has a font.size setting. Matplotlib version
|
I get this bug and didn't see an easy fix....
|
Oh sorry, I was using mplcairo's postscript renderer, which works here :-) (for reasons I don't totally understand...) |
I figured out the difference between matplotlib and mplcairo. In matplotlib, usetex is implemented in three different ways depending on the backend:
mplcairo, on the other hand, uses approach 2) for all cases (because it can easily be made to work for all output formats, as they all need to know how to output individual glyphs anyways). |
https://tex.stackexchange.com/questions/155699/how-to-use-display-equations-with-psfrag suggests to wrap the |
I encountered this bug today and I need to send the figures as .eps format to my boss. Is there any workaround? I tried to wrap it with |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
rcparams validation get a bit stricter, but import matplotlib
import matplotlib.pyplot as plt
params= {'text.latex.preamble' : r'\usepackage{amsmath}', 'text.usetex': True}
plt.rcParams.update(params)
fig, ax = plt.subplots(figsize=(8, 6))
ax.text(0.5, 0.5, r'\begin{align*} H&: 2 \ \textrm{m} \\'\
+ r'\Lambda &: 40 \ \textrm{m} \end{align*}',
bbox=dict(boxstyle="square",
ec=(0.6, 0.6, 0.6),
fc=(1., 1., 1.),
),
fontsize=32)
plt.show(block=False)
# this works fine
#plt.savefig('test.png', format='png')
plt.savefig('test.eps', format='eps') still fails. |
trouble with latex align and eps output
png output works, eps breaks
I have a figure that contains an align latex environment to stack two parameter definitions. Saving the figure as png is OK, while as eps gives a complicated Latex error.
Actual outcome
Matplotlib version
print(matplotlib.get_backend())
): TkAggThe text was updated successfully, but these errors were encountered: