We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When usetex=True, the PercentFormatter renders using text mode instead of math mode.
usetex=True
PercentFormatter
It should be treated similar to how ScalarFormatter wraps the string. The entire string should be wrapped including both the number and symbol.
ScalarFormatter
Related: #26179 #6886 #7965
The text was updated successfully, but these errors were encountered:
I think this can be done by changing this line to:
return r'$\mathdefault{%s}$' % (s + self.symbol)
when text.usetex is True.
text.usetex
True
Sorry, something went wrong.
I would also like to have PercentFormatter to support mathtext.
from matplotlib import pyplot as plt import matplotlib.ticker as mtick plt.rcParams["axes.formatter.use_mathtext"] = True plt.rcParams["mathtext.fontset"] = "cm" plt.rcParams["font.serif"] = "cmr10" plt.rcParams["font.family"] = "serif" plt.plot([1, 2, 3], [-1, 0, 1]) plt.gca().yaxis.set_major_formatter(mtick.PercentFormatter())
Successfully merging a pull request may close this issue.
Problem
When
usetex=True
, thePercentFormatter
renders using text mode instead of math mode.Proposed solution
It should be treated similar to how
ScalarFormatter
wraps the string. The entire string should be wrapped including both the number and symbol.Related:
#26179
#6886
#7965
The text was updated successfully, but these errors were encountered: