我需要生成一个图表。我使用pydot
图书馆。我的代码是:
import pydot
people = ['person_%d'%i for i in range(10)]
graph = pydot.Dot(graph_type='graph', rankdir='LR', splines='ortho')
# create nodes for people
node_list = []
for person in people:
node = pydot.Node(person, shape="record", style="filled", fillcolor="#E8E8E8")
node_list.append(node)
# get parent node
parent_node = node_list.pop(0)
# create edges
for node in node_list:
edge = pydot.Edge(parent_node, node, color="#B6B6B6")
graph.add_edge(edge)
graph.write_png('chart.png')
执行此代码的结果是:
http://i49.tinypic.com/keu7mw.png
所以我需要改变什么以获得与下图相同(相似)的结果: