您的位置:首页 > 大数据 > 人工智能

[异常]Failed to process string with tex because latex could not be found

2020-04-04 12:14 11017 查看

环境: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, 0, 10])
t = ("ACEACEACE\n "
"ACEACE\n "
"ACE")
plt.text(6, 1, t, ha='left', rotation=15, wrap=True)
plt.text(1, 5, t, ha='left', rotation=15, wrap=True)
plt.text(5, 5, t, ha='right', rotation=-15, wrap=True)
plt.text(5, 10, t, fontsize=18, style='oblique', ha='center',
va='top', wrap=True)
plt.text(10, 4, t, family='serif', style='italic', ha='right', wrap=True)
plt.text(-1, 0, t, ha='left', rotation=-15, wrap=True)


终于可以加文字了,随便写个位置探索一下用法。

  • 点赞
  • 收藏
  • 分享
  • 文章举报
红泥小火炉儿 发布了5 篇原创文章 · 获赞 0 · 访问量 191 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐