forked from Yanivmd/TRACY
-
Notifications
You must be signed in to change notification settings - Fork 2
/
graph_printer.py
69 lines (52 loc) · 1.48 KB
/
graph_printer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: user
#
# Created: 05/08/2012
# Copyright: (c) user 2012
# Licence: <your licence>
#-------------------------------------------------------------------------------
#!/usr/bin/env python
from igraph import *
def main():
#g = Graph.Read_GraphMLz(r"D:\User's documents\technion\project\workset\6.12.gcc\funcgraphs\.realloc.gml")
#
if 1==0:
g = Graph()
g.add_vertex()
g.add_vertex()
g.add_vertex()
g.add_vertex()
g.add_edge(0,1)
g.add_edge(0,2)
g.add_edge(2,3)
else:
g = read(r"D:\getftp.gml")
g.vs[0]['color'] = 'green'
# g.vs["label"] = g.vs["HstartEA"]
#print g["asd"]
#print g['name']
#g.is
#plot(g)
#g = Graph()
#g.add_vertex(2)
#g.add_edge(0,1)
#g['check'] = 'asd'
# is cool
# bad = "rt_circular","rt"
# good = "grid"
styleList3d = ["drl_3d","grid_3d","kk_3d","fr_3d"]
#"auto","circle","drl"
#styleList =["fr","grid","graphopt","gfr","kk","lgl","mds","sphere","star","sugiyama"]
"""
for plotStyle in ["grid"]:
print plotStyle
plot(g,layout=plotStyle ,bbox = (1600, 1600), margin = 20)
print "DONE"
"""
plot(g,layout="rt" ,root=0,bbox = (1600, 1600), margin = 20)
#plot(g1)
if __name__ == '__main__':
main()