我正在尝试让 \LaTeX 符号在 matplotlib.pyplot 的 mathtext 或 usetex (matplotlib==3.5.2) 中工作。
Other symbols display correctly with
text_usetex
both True
and False
:
import matplotlib.pyplot as plt
plt.rcParams['text.usetex'] = False
plt.plot([],[])
plt.title(r"$\alpha$")
plt.show()
然而
\LaTeX
不适用于:
plt.title(r"$\LaTeX$")
代替投掷,用
plt.rcParams['text.usetex']=True
:
Unknown symbol: \LaTeX, found '\' (at char 0), (line:1, col:1)
和
plt.rcParams['text.usetex']=False
:
RuntimeError: latex was not able to process the following string:
b'$\\\\LaTeX$'