GTK embedding chaco

Embedding Chaco in Qt and Wx does not seem to be a problem. Does anyone have an example or idea how to embed Chaco in GTK?

+4
source share
1 answer

I am using python with matplotlib. For the graphical object to be inserted into the graphical interface, I need a "backend": http://matplotlib.sourceforge.net/faq/installing_faq.html#backends

Code snippet:

from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as Canvas 

Then enter the instance (add_subplot prepares a place for one plot):

 figsn = matplotlib.pyplot.figure() ax = figsn.add_subplot(1,1,1) canvas = Canvas(figsn) ... snBox.pack_start(canvas, True, True) canvas.draw() 

So, I want to say that you need a backend from your package that you can pull into, and that GTK can recognize. Suppose your chaco lib must be compiled with GTK support. Today I canโ€™t install chaco, so please dig this way and let me know what you find!

+2
source

All Articles