I’m exercising the NetworkX examples found at networkx.lanl.gov/examples
Each time I run the weighted_graph example, the graph appears to have rotated.
Why does the graph rotate?
Is there a way to control the rotation so that the graph is always in the same position?
What you are seeing is the result of the nx.spring_layout() algorithm that is being used to position the nodes. The algorithm starts with a random position of the nodes so the result is nondeterministic.
You can, however, specify an initial position that is not random e.g. use a circular layout like this,
and then you should get the same result every time.