我正在使用matplotlib和乳胶标签作为轴,标题和颜色条标签
虽然它在大多数情况下都非常好用,但是当你使用\ text时,它会有一些问题.
一个非常简单的例子.
from matplotlib import pyplot as plt
plt.plot([1,2,3])
plt.title(r"$f_{\text{cor, r}}$")
plt.show()
Run Code Online (Sandbox Code Playgroud)
这将导致错误消息,如:
IPython/core/formatters.py:239: FormatterWarning: Exception in image/png formatter:
f_{\text{1cor, r}}
^
Unknown symbol: \text (at char 3), (line:1, col:4)
FormatterWarning,
Run Code Online (Sandbox Code Playgroud)
有没有一种简单的方法在那里使用\ text?