Questions tagged [pygraphviz]

PyGraphviz is a Python interface to Graphviz. With PyGraphviz it is possible to create, read, write and draw graphs with Python utilizing the Graphviz `dot`language and its layout algorithms.

PyGraphviz is a Python interface to Graphviz. With PyGraphviz it is possible to create, read, write and draw network structures (graphs) with Python utilizing the Graphviz dot language and its layout algorithms.

There is a wide range of applications of Graphviz and PyGraphviz, e.g. flowcharts and biological networks with many features to customize colors, fonts and layout, to mention a few.

Resources

Related Tags

281 questions
6
votes
1 answer

Python Graphs: Latex Math rendering of node labels

I am using the following code to create a pygraphviz graph. But is it possible to make it render latex math equations (see Figure 1)? If not, is there an alternative python library that plots similar graphs but supports latex rendering ? import…
IssamLaradji
  • 6,637
  • 8
  • 43
  • 68
6
votes
2 answers

pygraphviz, ImportError: undefined symbol: Agundirected

import pygraphviz Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/pygraphviz/__init__.py", line 58, in from .agraph import AGraph, Node, Edge, Attribute,…
midhun j
  • 61
  • 1
  • 4
6
votes
1 answer

horizontal tree with graphviz_layout

in python, with networkx. I can plot a vertical tree with : g=nx.balanced_tree(2,4) pos = nx.graphviz_layout(g, prog='dot') nx.draw(g,pos,labels=b_all, node_size=500) plt.show() similar to [root] | | | node node how…
JuanPablo
  • 23,792
  • 39
  • 118
  • 164
6
votes
1 answer

Programmatically specifying nodes of the same rank within networkx's wrapper for pygraphviz/dot

Is it possible to alter the following code to put Child_4 at the same horizontal level as Grandchild_0 (thereby pushing Grandchild_4 to its own level)? import networkx as nx import matplotlib.pyplot as plt G = nx.DiGraph() G.add_node("ROOT") for i…
plt
  • 101
  • 1
  • 8
6
votes
3 answers

Draw more information on graph\nodes using PyGraphviz

I want to create a graph and draw it, so far so good, but the problem is that i want to draw more information on each node. I saw i can save attributes to nodes\edges, but how do i draw the attributes? i'm using PyGraphviz witch uses Graphviz.
rafi wiener
  • 587
  • 1
  • 9
  • 19
5
votes
2 answers

Pygraphviz crashes after drawing 170 graphs

I am using pygraphviz to create a large number of graphs for different configurations of data. I have found that no matter what information is put in the graph the program will crash after drawing the 170th graph. There are no error messages…
draB1
  • 63
  • 2
  • 7
5
votes
1 answer

Draw a graph from networkx centered on a basemap position

I'm searching to plot multiple sub-graphes on a map, each sub-graph would be centered in one geographical position (or one coordinate of a plot). Nodes don't have position by themselves (or they all belong to a city), but each subgraph corresponds…
sol
  • 1,389
  • 3
  • 19
  • 32
5
votes
4 answers

pygraphviz OSError: Format: "dot" not recognized. Use one of:

I want to plot the tree generated by DEAP using pygraphviz. I tried to follow the example in this DEAP document, but got the following error: Traceback (most recent call last): File "", line 24, in File…
xxyao
  • 529
  • 1
  • 7
  • 16
5
votes
4 answers

InvocationException: GraphViz's executables not found

I'm unable to visualize or write the Decision tree. How can I go about it? Python version 3.5, Anaconda 3, I have even set the environment variables from sklearn import tree model = tree.DecisionTreeClassifier(criterion='gini') …
Anagha
  • 3,073
  • 8
  • 25
  • 43
5
votes
1 answer

Nested clusters (or add_subgraph) on pygraphviz

With pygraphviz, I can add subgraphs with add_subgraph(list_of_nodes, label='cluster_somename'). This will create it inside a subgraph block when layout is called. Is there a way to nest the subgraphs? I'm using the dot layout, I know it can handle…
KalEl
  • 8,978
  • 13
  • 47
  • 56
5
votes
2 answers

Pygraphviz Installation Failed with error code 1083 Cannot open file graphviz/cgraph.h: No such file or directory

While trying to install pygraphviz 1.3 with pip the below error msg is coming Fatal error 1083 Cannot open file graphviz/cgraph.h: No such file or directory error: command C:\Users\Appdata\Local\Programs\Common\Microsoft\Visual C++ for…
P.D
  • 51
  • 1
  • 3
5
votes
0 answers

pygraphviz / grapviz has a non-deterministic output, so how to force the order of the nodes?

Running this code: import pygraphviz as PG tree = PG.AGraph(directed=True, strict=False) tree.add_node(1) tree.add_node(2) tree.add_node(3) tree.add_node(4) tree.add_node(5) tree.add_edge(1, 2) tree.add_edge(1, 3) tree.add_edge(4,…
dhorat
  • 1,509
  • 1
  • 8
  • 4
5
votes
1 answer

Drawing graph in graphviz layout in python using nx.draw_graphviz gives error

I am trying to draw a 100 node multi-graph G in graphviz layout in python's networkx so I made two trials so far: Trial 1 nx.draw_graphviz function as follows nx.draw_graphviz(G) but I get the following error repeated for all nodes in the…
Abdallah Sobehy
  • 2,881
  • 1
  • 15
  • 28
5
votes
3 answers

NetworkX graphviz_layout not working?

I encountered a problem when trying to plot a graph with many nodes using NetworkX and graphviz_layout. More specifically, the arguments that pass into nx.graphviz_layout do not help at all. Attached is the code I use: G=some_graph() import…
wpqmanu
  • 51
  • 1
  • 2
5
votes
2 answers

No module named _graphviz

I installed graphviz and pygraphviz, when I open a cmd and type python import _graphviz _graphviz can be imported, but when I run a C++ program which will invoke a .py file, there is a line in this .py file which is import pygraphviz as pgv Then…
ryan pei
  • 51
  • 1
  • 1
  • 3
1 2
3
18 19