环境:anaconda
使用jupyter notebook尝试plt.text()报出异常:RuntimeError: Failed to process string with tex because latex could not be found
尝试解决方法:
pip install latex
安装成功
运行仍旧报出该异常。
到anaconda的官方网站搜索,找到答案
https://anaconda.org/conda-forge/jupyter_latex_envs
按照步骤:
conda install -c conda-forge jupyter_latex_envs
conda install -c conda-forge/label/cf201901 jupyter_latex_envs
conda install -c conda-forge/label/cf202003 jupyter_latex_envs
成功后,问题得到解决。
import matplotlib.pyplot as plt
fig = plt.figure()
plt.axis([0, 10