Ask Your Question

Revision history [back]

Install graphviz on your system and install dot2tex:

sage -i dot2tex

Use it to generate tikz code:

sage: G =  ... your graph ....
sage: kwds = dict(format='dot2tex', edge_labels=True, color_by_label=False, prog='dot')
sage: G.latex_options().set_options(**kwds)
sage: tikz = graph._latex_()

View it:

sage: view(G)

You may test prog='neato' for another type of node placement.