How do I customize the display of edge labels in networkx?
This way it worked on my :
grafo_labels = nx.get_edge_attributes(G,'weight')
edges_label = nx.draw_networkx_edge_labels(G, pos, edge_labels = grafo_labels)
The command draw_networkx_edge_labels
needs the argument edge_labels
rather than labels
.
So you need to change nx.draw_networkx_edge_labels(G, pos, labels = edge_labels)
to nx.draw_networkx_edge_labels(G, pos, edge_labels = edge_labels)