How can I draw automatic plots using point in Python on Mac?

I am creating graphs in a Python program and now I need to render them.

I am using Tkinter as a GUI to visualize all other data and I would like to have a small subset inside with a graph of the data. At the moment I have the data presented in a .dot file. And then I keep graphviz open, which is what the graph shows. But this is, of course, suboptimal. I need to get a graph inside a tk window.

I was thinking about using graphviz from the command line, but I always came across the same known message:

Desktop ibook$ dot -Tpng -O 1.dot
dyld: lazy symbol binding failed: Symbol not found: _pixman_image_create_bits
  Referenced from: /usr/local/lib/graphviz/libgvplugin_pango.5.dylib
  Expected in: flat namespace

dyld: Symbol not found: _pixman_image_create_bits
  Referenced from: /usr/local/lib/graphviz/libgvplugin_pango.5.dylib
  Expected in: flat namespace

Trace/BPT trap

      

The bug is well known in the Graphviz community:

http://www.graphviz.org/bugs/b1479.html

http://www.graphviz.org/bugs/b1488.html

http://www.graphviz.org/bugs/b1498.html

So, since it seems to me that I cannot use the command line utility, I was wondering if anyone knew a direct way to draw a point graph in Python without using the command line, or do something that would entail the same mistake?

I am programming on Mac Leopard, python 2.5.2

0


a source to share


2 answers


I don't have a macro to test, but NetworkX includes methods to read .dot files and draw plots using matplotlib . You can insert a matplotlib figure into Tk ( example 1 , example 2 ).



+2


a source


A quick Google pulls up http://code.google.com/p/pydot/ . I haven't tried it, but it looks promising.



+1


a source







All Articles