Jupyter notebooksΒΆ

Graph and Digraph objects have a _repr_mimebundle_() method so they can be rendered and displayed directly inside a Jupyter notebook. For an example, check the examples/graphviz-notebook.ipynb file in the source repository/distribution (or the same notebook in nbviewer).

This also allows direct displaying within the Jupyter Qt Console (also the one inside Spyder IDE):

_images/qtconsole.png

By default _repr_mimebundle_() uses 'svg' format. You can use the graphviz.set_jupyter_format() to override the default format that is used for displaying in IPython/Jupyter. (example, nbviewer).

Hint

You can also use display_svg(), display_png(), or .display_jpeg() from IPython.display to display the rendered Graph or Digraph as SVG, PNG or JPEG in IPython/Jupyter.