示例程序
G1 = nx.MultiDiGraph()
for node in nodes:
G1.add_node(node)
for edge in edges:
G1.add_edge(edge)
G1.graph['edge'] = {'arrowsize': '0.3', 'splines': 'curved', 'color':'red'}
G1.graph['node'] = {'shape':'ellipse'}
A = to_agraph(G1)
A.layout('dot')
A.draw('./graph/test.png')
发现中文显示出现乱码,修改节点标签字体
G1.graph['node'] = {'shape':'ellipse', 'fontname':"FangSong"}
中文内容正常显示