Have you looked at examples on the Networkx website? This example can help you get started with this.
Networkx also has a number of features that generate random graphics that are likely to be useful. See the random_powerlaw_tree (....) function, described in detail in the graph generator section of the documentation.
source
share