简体   繁体   English

乳胶失效ipython daft matplotlib

[英]latex failure ipython daft matplotlib

I was keen to try out daft ( http://daft-pgm.org/ ) and through it I found out that latex functionality was not working in matplotlib. 我很想尝试daft( http://daft-pgm.org/ ),通过它我发现乳胶功能在matplotlib中不起作用。

I paste the example on the daft website ( http://daft-pgm.org/examples/nocircles/ ): 我将示例粘贴到daft网站上( http://daft-pgm.org/examples/nocircles/ ):

from matplotlib import rc
rc("font", family="serif", size=12)
rc("text", usetex=True)

import daft

pgm = daft.PGM([3.6, 2.4], origin = [1.15, 0.8], node_ec="none")
pgm.add_node(daft.Node("cloudy", r"cloudy", 3, 3))
pgm.add_node(daft.Node("rain", r"rain", 2, 2))
pgm.add_node(daft.Node("sprinkler", r"sprinkler", 4, 2))
pgm.add_node(daft.Node("wet", r"grass wet", 3, 1))
pgm.add_edge("cloudy", "rain")
pgm.add_edge("cloudy", "sprinkler")
pgm.add_edge("rain", "wet")
pgm.add_edge("sprinkler", "wet")
pgm.render()
pgm.figure.savefig("nocircles.pdf")
pgm.figure.savefig("nocircles.png", dpi=150)

This is what ipython returns to me 这就是ipython回归给我的

RuntimeError: LaTeX was not able to process the following string:  
'lp'
Here is the full report generated by LaTeX: 

There is no report supplied by ipython or LaTex. 没有ipython或LaTex提供的报告。 See screenshot: 看截图:

在此输入图像描述

The standard script on the matplotlib website gives me the same error. matplotlib网站上的标准脚本给出了同样的错误。 Is there a way to check if all the dependencies are met? 有没有办法检查是否满足所有依赖项? LaTex is installed on my system but I am not sure if ipython can access it. LaTex安装在我的系统上,但我不确定ipython是否可以访问它。

In my case it was a LaTex library that needed to be installed (sorry I didn't pay attention to which one) 在我的情况下,它是一个需要安装的LaTex库(抱歉,我没注意哪一个)

It automatically opened my MikTex installer, so you install the suggested library and you should be done. 它自动打开我的MikTex安装程序,所以你安装了建议的库,你应该完成。

There is no need for 'lp' to be accessible from the command line. 不需要从命令行访问“lp”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM