How do I draw non-overlapping edge labels in networkx? Using the option scale
looks better but the edge labels are still overlapping, for instance,
The related source codes are below:
# build a graph
G.add_edge(u, v, r=value)
# plot the graph
pos = nx.spring_layout(G, scale=3)
nx.draw(G, pos)
edge_labels = nx.get_edge_attributes(G,'r')
nx.draw_networkx_edge_labels(G, pos, edge_labels = edge_labels)
plt.savefig(filename)