-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
mathtext.py bra-ket notation axes #3374
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
Can you include a minimal amount of code to show this? (If I am understanding this right, I think that two call to |
After #4147 was fixed, I checked if this one is also fixed, and it seems it is not. On current master, the following example produces a png, pdf and svg where the import matplotlib
matplotlib.use('MacOSX')
import matplotlib.pyplot as plt
plt.text(0.4,0.6,r'$\left|-\right\rangle$')
plt.text(0.4,0.4,r'$\left|\minus\right\rangle$')
plt.text(0.6,0.6,r'$\left|+\right\rangle$')
plt.text(0.6,0.4,r'$\left|\plus\right\rangle$')
plt.savefig('tmp.png')
plt.savefig('tmp.pdf')
plt.savefig('tmp.svg')
plt.show() |
just pinging @mdboom, @tacaswell because I'm not sure this was seen. |
I assume that is a similar problem with the height of the | and > being scaled to almost zero. |
This is a tricky one. At the end of the day, I think the metrics on the minus sign are just wrong (it defines a character with negative height). I guess the best we can do is special case it, but that's icky... Oh well, I think I can have a fix ready shortly. |
May be worth checking whether another version of computer modern (http://www.ams.org/publications/type1-fonts, http://cm-unicode.sourceforge.net/) has better metrics. |
This was actually fixed by #5871. |
When using qutip, which has mathtext.py in the backend, after setting on an axis the label '$\left|-\right>$' the text is not shown
For the label '$\left|\minus\right>$' only a minus sign is shown. It could be that the \left \right symbols are too small to be seen.
The label '$\left|+\right>$' is shown without any problem, and any other symbol instead of -, also.
The text was updated successfully, but these errors were encountered: