{
  "nbformat_minor": 0, 
  "nbformat": 4, 
  "cells": [
    {
      "execution_count": null, 
      "cell_type": "code", 
      "source": [
        "%matplotlib inline"
      ], 
      "outputs": [], 
      "metadata": {
        "collapsed": false
      }
    }, 
    {
      "source": [
        "\n# Sampson\n\n\nSampson's monastery data.\n\nShows how to read data from a zip file and plot multiple frames.\n\n\n"
      ], 
      "cell_type": "markdown", 
      "metadata": {}
    }, 
    {
      "execution_count": null, 
      "cell_type": "code", 
      "source": [
        "# Author: Aric Hagberg (hagberg@lanl.gov)\n\n#    Copyright (C) 2010-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 zipfile\nimport cStringIO\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\n\nzf = zipfile.ZipFile('sampson_data.zip')  # zipfile object\ne1 = cStringIO.StringIO(zf.read('samplike1.txt'))  # read info file\ne2 = cStringIO.StringIO(zf.read('samplike2.txt'))  # read info file\ne3 = cStringIO.StringIO(zf.read('samplike3.txt'))  # read info file\nG1 = nx.read_edgelist(e1, delimiter='\\t')\nG2 = nx.read_edgelist(e2, delimiter='\\t')\nG3 = nx.read_edgelist(e3, delimiter='\\t')\npos = nx.spring_layout(G3, iterations=100)\nplt.clf()\n\nplt.subplot(221)\nplt.title('samplike1')\nnx.draw(G1, pos, node_size=50, with_labels=False)\nplt.subplot(222)\nplt.title('samplike2')\nnx.draw(G2, pos, node_size=50, with_labels=False)\nplt.subplot(223)\nplt.title('samplike3')\nnx.draw(G3, pos, node_size=50, with_labels=False)\nplt.subplot(224)\nplt.title('samplike1,2,3')\nnx.draw(G3, pos, edgelist=list(G3.edges()), node_size=50, with_labels=False)\nnx.draw_networkx_edges(G1, pos, alpha=0.25)\nnx.draw_networkx_edges(G2, pos, alpha=0.25)\nplt.show()"
      ], 
      "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"
      }
    }
  }
}