Created
March 7, 2018 04:23
-
-
Save ebuckley/7b8b8967ba7825a5763c5fed09b72c9a to your computer and use it in GitHub Desktop.
graph stewards using jupyter notebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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