Skip to content

Instantly share code, notes, and snippets.

@ebuckley
Created March 7, 2018 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebuckley/7b8b8967ba7825a5763c5fed09b72c9a to your computer and use it in GitHub Desktop.
Save ebuckley/7b8b8967ba7825a5763c5fed09b72c9a to your computer and use it in GitHub Desktop.
graph stewards using jupyter notebook
stewards = [
("Steve", "Alice"),
("Alice", "Boris"),
("Boris", "Einstein"),
("Einstein", "Linus"),
("Linus", "Steve")
]
from graphviz import *
g = Digraph(name='stewards', engine='neato')
g.attr(overlap='false')
edges = []
for steward, stewardee in stewards:
g.node(steward)
g.edge(steward, stewardee)
edges.append((steward, stewardee))
g.render('dist/stewards.png')
g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment