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

Visualisation of Model input not possible #1

Open
Kecksdose opened this issue Mar 18, 2016 · 2 comments
Open

Visualisation of Model input not possible #1

Kecksdose opened this issue Mar 18, 2016 · 2 comments

Comments

@Kecksdose
Copy link

Hi,

while copy/pasting your RooFit Notebook, I got some Errors on the nx.draw_graphvix() method. It says

0.5  [color=red,
  ^
Expected "}" (at char 200), (line:10, col:3)

Could me tell me which specific versions of Pydot, Networkx and Graphviz you are using? Mine are

pydot==1.0.2
networlx==1.10
graphviz==2.38.0

Regards,
Timon

@cranmer
Copy link
Owner

cranmer commented Mar 18, 2016

Hi Timon,

I recently updated my system. Currently I'm having all sorts of problems with pygraphviz, pydot, networks. I just spent a couple of hours on it. I'll try again later.

you might try replacing G = nx.DiGraph(nx.read_dot('expressionTree.dot')) with G =nx.drawing.nx_agraph.read_dot('expressionTree.dot') (seems the networkx api has changed a bit)

Also, maybe issue is with the dot file created by RooFit. Check to see if you can run dot directly on the expressionTree.dot file. Or comment the line pdf.graphVizTree('expressionTree.dot') and use the one in the repository.

@Kecksdose
Copy link
Author

Hi Kyle,

I found a solution without using nx.draw_graphviz (which is some kind of broken, I think). Here is the code:

import networkx as nx
import pydot
from IPython.display import Image

model.graphVizTree('SimpleModel.dot')
G = nx.drawing.nx_agraph.read_dot('SimpleModel.dot')
model_dot = nx.to_pydot(G)

model_png = model_dot.create_png(prog='dot')
Image(model_png)

Anyway, thanks for your quick response!
Timon

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

2 participants