Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: LaTeX was not able to process the following string: 'lp' #65

Closed
FelipeMuchtajidun opened this issue Feb 27, 2014 · 6 comments

Comments

@FelipeMuchtajidun
Copy link

Hello,This is the first time i use daft.Im trying to create one of the example graphs in the web site
%pylab inline
from IPython.external.mathjax import install_mathjax
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("mrf.pdf")

and i ma getting the error in the description.
Any help is much apreciated
Felipe

@dfm
Copy link
Member

dfm commented Feb 27, 2014

Have you used LaTeX with matplotlib in the past? What happens if you remove the line:

rc("text", usetex=True)

@djhshih
Copy link

djhshih commented Oct 6, 2014

I had the same error on Mac OS 10.9.5. The culprit was Apple, in particular its stock python and matplolib.
When I install the unadulterated version of python and matplotlib, the example ran without error.

$ brew install python
$ /usr/local/bin/pip install matplotlib
$ /usr/local/bin/pip install daft
$ /usr/local/bin/python example.py

@Huta2018
Copy link

Huta2018 commented Apr 9, 2018

My Script was working before, suddenly I got the same error. I spent almost an hour to find it and it did not help me at all. I closed the shell and run it again, then it worked. I don't know why there was a problem and when I close and reopen my spyder not book, it worked.

@davidwhogg
Copy link
Collaborator

That's bad. Should we close this bug for now?

@matanbz
Copy link

matanbz commented Apr 22, 2019

Have you used LaTeX with matplotlib in the past? What happens if you remove the line:

rc("text", usetex=True)

Works.
To make sure there's no ambiguity I wrote:
rc("text", usetex=Fal=se)

@wkerzendorf
Copy link

wkerzendorf commented Feb 25, 2020

It came back - the error. Just flagging this for other people trying to use cornerpy with latex.
and setting usetex=False helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants