Reputation: 2564
I am working with Python 3.3 (Anaconda distribution), and I would like to display a graph using Graphviz.
You'll find below what I'm trying to do:
from graphviz import Digraph
g = Digraph('G', filename='hello.gv')
g.edge('Hello', 'World')
g.view()
Here's the error I get:
graphviz.dot.Digraph has no built-in viewer support for 'pdf' on 'linux' platform
I got the same error trying svg, png, etc.
I did this because of Python 3.3:
pip install graphviz
pip install pydot2
I want to use something that allows displaying great visualizations using Python and do some clustering according to some attribute of the nodes.
Do you know something that is better than Graphviz for that need?
(I would like to try something else. I've already tried networkx, but I can't obtain good visualizations. I can't have the length I want for edges and nx.draw_graphviz does not work either...)
Upvotes: 2
Views: 5587
Reputation: 88118
Answering the second question:
I want to use something that allows displaying great visualizations using Python and do some clustering according to some attribute of the nodes.
Do you know something that is better than Graphviz for that need?
I've found that the module graph-tool
does everything that networkx
can do and more. In my personal opinion, the rendering interface is a bit nicer, and it's less work to get a nice looking graph. This is especially true for directed graphs which are horrible using networkx. Graphviz is a bit better, but it still requires a lot of up front configuration. An example from the website:
Upvotes: 1