diff --git a/pygraphml/graph.py b/pygraphml/graph.py index 91bc0f5..927c53e 100644 --- a/pygraphml/graph.py +++ b/pygraphml/graph.py @@ -241,10 +241,11 @@ def show(self, show_label=False): n2_label = e.node2.id G.add_edge(n1_label, n2_label) - nx.draw(G) - + pos = None if show_label: - nx.draw_networkx_labels(G, pos=nx.spring_layout(G)) + pos = nx.spring_layout(G) + nx.draw_networkx_labels(G, pos=pos) + nx.draw(G, pos=pos) plt.show()