My question is dead simple.
Is there a package to plot state-transition or markov diagrams that look like any of the following? I am thinking it has to exist, but I simply can't find it!
I've really had a search around, also on Stackoverflow, but to no avail.
If you install graphviz and pygraphviz as mentioned above, you can render dot syntax directly in a ipython/jupyter notebook like this (without the need for networkx):
import pygraphviz as pgv
from IPython.display import Image
def draw(dot):
return Image(pgv.AGraph(dot).draw(format='png', prog='dot'))
g1 = """digraph top {
a -> b -> c;
}"""
draw(g1)
This draws:
Complete dot reference here.
Right. I found the following packages, installed in the correct order, will produce the graphs I was looking for.
1) Install Graphviz. This is a standalone package, and can be installed with e.g. brew install graphviz.
2) Install PyGraphviz using pip install pygraphviz (requires Graphviz executables)
3) Install PyDot using pip install pydot
If you want to do inline stuff in iPython Notebook, as I do, then check out this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With