def draw_graph ( G : nx . DiGraph , filename : str ) : A = to_agraph ( G ) A . graph_attr [ "rankdir" ] = "LR" A . draw ( filename , prog = "dot" )
graphy not display in python
Draw a networkx graph with Pygraphviz .
def draw_graph(G: nx.DiGraph, filename: str):
    """ Draw a networkx graph with Pygraphviz. """
    A = to_agraph(G)
    A.graph_attr["rankdir"] = "LR"
    A.draw(filename, prog="dot")