NetworkX doesn't have very sophisticated graph layout algorithms
but you might be able to get what you want by using the Graphviz
layout algorithms.
Here is an example using NetworkX with PyGraphviz to position the
nodes using the "weight" keyword or the "len" keyword.
(see http://graphviz.org/doc/info/attrs.html)
You'll need the latest NetworkX code (from SVN or
http://networkx.lanl.gov/download/networkx/)
#!/usr/bin/env python
import networkx
G=networkx.Graph()
G.add_edge(1,2,1)
G.add_edge(2,3,4)
# assigns edge weight as graphviz "weight" attribute
pos=networkx.graphviz_layout(G)
networkx.draw_networkx(G,pos)
H=networkx.Graph(G)
# replace all the edge data with a dictionary of
# the single graphviz keyword "len" set to the weight
for (u,v,w) in G.edges(data=True):
H.add_edge(u,v,{'len':str(w)})
pos=networkx.graphviz_layout(H)
networkx.draw_networkx(G,pos)
Aric