trungdong/prov — pull request #55 by krischer (2014-07-31 12:42:25+00:00)
Title: Convenience plot

One can just do a `ProvDocument.plot()` call and it will plot is using the `prov.dot` submodule.

Most arguments are just passed to the `prov.dot.prov_to_dot()` function.

The `filename` parameter specifies where to write the file to. The fileformat will be determined from the filename and passed to pydot. This therefore automatically supports all output formats pydot supports.

If `filename` is not given, a preview will be shown by outputting a `png` image in memory and displaying it with matplotlib. I chose matplotlib and not the `show()` function from PIL as matplotlib plays nice with the notebook enabling things like this:

http://nbviewer.ipython.org/gist/krischer/39489ed6e487688c94e9

All imports are lazy to not affect the dependencies of the rest of the project.