File indexing completed on 2025-08-03 08:19:05
0001
0002
0003 from graph_tool.all import *
0004 from pylab import *
0005
0006 print 'Graph-tool test program'
0007
0008 g = load_graph("./my_test.graphml")
0009
0010 print 'Graph is directed = %s '%(g.is_directed())
0011 print 'my_test.graphml loaded!'
0012
0013 print 'Graph Veretx/Node and Edge properties:'
0014 g.list_properties()
0015
0016
0017
0018
0019 pT=g.edge_properties["pT"]
0020 E=g.edge_properties["E"]
0021
0022 t=g.vertex_properties["t"]
0023 label=g.vertex_properties["label"]
0024
0025
0026 E.a=1/(E.a/10)
0027
0028 gdict={'rankdir' : 'LR'}
0029 edict={'dir' : 'forward', 'arrowhead' : 'normal','arrowsize' : '1.0','label' : pT}
0030 vdict={'shape' : "plain", 'label' : label}
0031
0032 graphviz_draw(g,layout="dot",gprops=gdict, vprops=vdict, eprops=edict, ecmap=matplotlib.cm.autumn, penwidth=E, ecolor=E, vcolor="#ffffff", output="my_test_fancy.pdf")
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065