-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
BUG: % crashes saving figure with tex enabled #6886
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
Conversation
I cannot reproduce import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import PercentFormatter
matplotlib.rc('text', usetex=True)
x, y = [1, 2, 3], [64, 128, 256]
fig, ax = plt.subplots()
ax.yaxis.set_major_formatter(PercentFormatter(xmax=512))
ax.bar(x, y)
fig.suptitle('usetex=True')
#fig.savefig('test_usetex-percentformatter.png')
plt.show() |
I could have sworn we have code that escapes all percent signs before On Thu, Sep 8, 2016 at 11:15 AM, Nikita Kniazev notifications@github.com
|
Nope. As my SO question states, I can't even find a list of characters that need to be escaped anywhere in matplotlib. |
@Kojoley The savefig issue is caused by the version of LaTeX on my machine, which barfs on non-escaped percent symbols. It is basically the exact same issue you are having, but with a different backend. Another problem here is that symbols should not be escaped in In the meantime, you can always pass in your own custom symbol (like |
This PR has been superseded and significantly improved on by #7965. Closing. |
This PR changes the default symbol used by
mpl.ticker.PercentFormatter
ifmpl.rcParams['text.usetex'] == True
. There is room for improvement, as evidenced by this question: http://stackoverflow.com/q/38731201/2988730.Tests coming soon.