3
Write first 20 graphs from the graph atlas as graphviz dot files
5
Requires pygraphviz and graphviz.
7
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
8
__date__ = "$Date: 2005-05-19 14:23:02 -0600 (Thu, 19 May 2005) $"
11
# Copyright (C) 2006 by
12
# Aric Hagberg <hagberg@lanl.gov>
13
# Dan Schult <dschult@colgate.edu>
14
# Pieter Swart <swart@lanl.gov>
15
# Distributed under the terms of the GNU Lesser General Public License
16
# http://www.gnu.org/copyleft/lesser.html
19
from networkx.generators.atlas import *
20
from pygraphviz import *
22
atlas=graph_atlas_g()[0:20]
26
print "graph %s has %d nodes with %d edges"\
27
%(G.name,NX.number_of_nodes(G),NX.number_of_edges(G))
29
A.graph_attr['label']=G.name
30
# set default node attributes
31
A.node_attr['color']='red'
32
A.node_attr['style']='filled'
33
A.node_attr['shape']='circle'
34
A.write(G.name+'.dot')