In networkx, I found drawing labels of edges is very easy but I how can I draw length or relative distance of edges?
Here is my test code
G = nx.Graph()
G.add_edge(0, 1, length=1)
G.add_edge(0, 2, length=5)
pos = nx.spring_layout(G)
length = nx.get_node_attributes(G, 'length')
What I mean is the plot should show length between nodes since edge has its corresponding length. Here is example
the distance between 0 and 2 looks larger than that between 0 and 1.