pydot graphviz
graph = pydot.Dot(graph_type="graph")としておいて、
Image(graph.create_png())でoutput
stackoverflow のどこかで、tips的に紹介されていた
code:python
import pydot
graph = pydot.Dot(graph_type='graph')
for i in range(3):
edge = pydot.Edge("king", "lord%d" % i)
graph.add_edge(edge)
vassal_num = 0
for i in range(3):
for j in range(2):
edge = pydot.Edge("lord%d" % i, "vassal%d" % vassal_num)
graph.add_edge(edge)
vassal_num += 1
from IPython.display import Image
Image(graph.create_png())
https://gyazo.com/0d5df5960a90598a670990a4b23df711