This documents the development version of NetworkX. Documentation for the current release can be found here.


Write first 20 graphs from the graph atlas as graphviz dot files where n=0,19.

import networkx as nx
from networkx.generators.atlas import graph_atlas_g

atlas = graph_atlas_g()[0:20]

for G in atlas:
        f"{} has {nx.number_of_nodes(G)} nodes with {nx.number_of_edges(G)} edges"
    A = nx.nx_agraph.to_agraph(G)
    A.graph_attr["label"] =
    # set default node attributes
    A.node_attr["color"] = "red"
    A.node_attr["style"] = "filled"
    A.node_attr["shape"] = "circle"
    A.write( + ".dot")

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery