{
  "nbformat_minor": 0, 
  "nbformat": 4, 
  "cells": [
    {
      "execution_count": null, 
      "cell_type": "code", 
      "source": [
        "%matplotlib inline"
      ], 
      "outputs": [], 
      "metadata": {
        "collapsed": false
      }
    }, 
    {
      "source": [
        "\n# Atlas2\n\n\nWrite first 20 graphs from the graph atlas as graphviz dot files\nGn.dot where n=0,19.\n\n"
      ], 
      "cell_type": "markdown", 
      "metadata": {}
    }, 
    {
      "execution_count": null, 
      "cell_type": "code", 
      "source": [
        "# Author: Aric Hagberg (hagberg@lanl.gov)\n# Date: 2005-05-19 14:23:02 -0600 (Thu, 19 May 2005)\n\n#    Copyright (C) 2006-2017 by\n#    Aric Hagberg <hagberg@lanl.gov>\n#    Dan Schult <dschult@colgate.edu>\n#    Pieter Swart <swart@lanl.gov>\n#    All rights reserved.\n#    BSD license.\n\nimport networkx as nx\nfrom networkx.generators.atlas import graph_atlas_g\n\natlas = graph_atlas_g()[0:20]\n\nfor G in atlas:\n    print(\"graph %s has %d nodes with %d edges\"\n          % (G.name, nx.number_of_nodes(G), nx.number_of_edges(G)))\n    A = nx.nx_agraph.to_agraph(G)\n    A.graph_attr['label'] = G.name\n    # set default node attributes\n    A.node_attr['color'] = 'red'\n    A.node_attr['style'] = 'filled'\n    A.node_attr['shape'] = 'circle'\n    A.write(G.name + '.dot')"
      ], 
      "outputs": [], 
      "metadata": {
        "collapsed": false
      }
    }
  ], 
  "metadata": {
    "kernelspec": {
      "display_name": "Python 2", 
      "name": "python2", 
      "language": "python"
    }, 
    "language_info": {
      "mimetype": "text/x-python", 
      "nbconvert_exporter": "python", 
      "name": "python", 
      "file_extension": ".py", 
      "version": "2.7.12", 
      "pygments_lexer": "ipython2", 
      "codemirror_mode": {
        "version": 2, 
        "name": "ipython"
      }
    }
  }
}