簡體   English   中英

乳膠失效ipython daft matplotlib

[英]latex failure ipython daft matplotlib

我很想嘗試daft( http://daft-pgm.org/ ),通過它我發現乳膠功能在matplotlib中不起作用。

我將示例粘貼到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)

這就是ipython回歸給我的

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

沒有ipython或LaTex提供的報告。 看截圖:

在此輸入圖像描述

matplotlib網站上的標准腳本給出了同樣的錯誤。 有沒有辦法檢查是否滿足所有依賴項? LaTex安裝在我的系統上,但我不確定ipython是否可以訪問它。

在我的情況下,它是一個需要安裝的LaTex庫(抱歉,我沒注意哪一個)

它自動打開我的MikTex安裝程序,所以你安裝了建議的庫,你應該完成。

不需要從命令行訪問“lp”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM