Код: Выделить всё
def plot(self):
G = nx.MultiDiGraph()
nodes = self.collect_nodes()
for n in nodes:
G.add_node(n.id)
for n in nodes:
for naar, label in n.get_edges():
G.add_edge(n.id, naar, label=label)
pos = nx.spring_layout(G)
nx.draw(G, pos, with_labels=True, arrows=True)
nx.draw_networkx_edge_labels(G, pos, edge_labels=nx.get_edge_attributes(G, "label"))
plt.show()

Сюжет выглядит следующим образом:

Края перекрываются, и это также имеет раздражающую форму. Все ли знают, как построить ориентированный мультиграф в networkx так, чтобы края не перекрывались? Заранее спасибо.