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.