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
For some reason I can't get matplotlib to write down the \approx LaTeX symbol in a legend.
matplotlib
\approx
Here's a MWE:
import matplotlib.pyplot as plt plt.scatter([0.5, 0.5], [0.5, 0.5], label='$U_{c} \approx %0.1f$' % 22) #plt.scatter([0.5, 0.5], [0.5, 0.5], label='$U_{c} \simeq %0.1f$' % 22) #plt.scatter([0.5, 0.5], [0.5, 0.5], label='$U_{c} \sim %0.1f$' % 22) plt.legend(fancybox=True, loc='upper right', scatterpoints=1, fontsize=16) plt.show()
Notice the first line will not show the \approx character or the value after it but both \simeq and \sim work fine.
\simeq
\sim
The text was updated successfully, but these errors were encountered:
Nevermind, forgot the r char.
r
http://stackoverflow.com/a/24739481/1391441
Sorry, something went wrong.
It's always recommended to use raw strings when specifying LaTeX, since otherwise the \a in \approx gets converted to a "bell" character.
\a
Stick r in front of the string or double-escape the slash:
r'$U_{c} \approx %0.1f$'
'$U_{c} \\approx %0.1f$'
I think I sent my comment the same moment you sent yours ;)
@mdboom you did but thank you very much nonetheless :)
No branches or pull requests
For some reason I can't get
matplotlib
to write down the\approx
LaTeX symbol in a legend.Here's a MWE:
Notice the first line will not show the
\approx
character or the value after it but both\simeq
and\sim
work fine.The text was updated successfully, but these errors were encountered: