I am trying to gather data from twitter and visualize it through Graphviz. I have already installed Graphviz and currently I am trying to generate a DOT language output through Python, I ran into the problem of not being able to get any response from my code. I would like to know if my code has generated a DOT file or not and if yes, where is my DOT file? Below is my code.
OUT ="Paul_search_results.dot"
try:
nx.drawing.write_dot(g, OUT)
except ImportError, e:
dot = ['"%s" -> "&s" [tweet_id=%s]'% (n1, n2, g[n1][n2]['tweet_id'])\
for n1, n2 in g.edges()]
f = open(OUT, 'w')
f.write('strict digraph {\n%s\n}' % (';\n'.join(dot),))
f.close()
I am using windows and I know I can't easy_install pygraphviz, but the code above should do the same thing. According to the book, I should have DOT language output on hand with the code above. But I didn't get any response from my code.
I already have gathered the information from twitter and the nodes and edges ready.
>>> g.number_of_nodes()
235
>>> g.number_of_edges()
202
Can somebody please help me out here?
dot's contents?