LaTeX 标志 (\LaTeX)

问题描述 投票:0回答:0

我正在尝试让 \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$'
python matplotlib latex
© www.soinside.com 2019 - 2024. All rights reserved.