Created
December 26, 2015 12:23
-
-
Save alan-mushi/845478267583b060f172 to your computer and use it in GitHub Desktop.
Easy graphviz for a simple graph in Python 3
This file contains 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
# Install graphviz using pip3 (on archlinux): | |
# $ sudo pip3 install graphviz | |
import graphviz as gv | |
g1 = gv.Graph(format="svg") # "svg" or "dot" | |
g1.node('A') | |
g1.node('B') | |
g1.node('C') | |
g1.edge('A', 'C') | |
g1.edge('B', 'C') | |
g1.view() | |
g1.render('/tmp/g1') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment