简体   繁体   English

将chaco嵌入GTK

[英]Embedding chaco in GTK

Embedding Chaco into Qt and Wx seems to be no problem. 将Chaco嵌入Qt和Wx似乎没有问题。 Does anyone have an example or an idea how to embed Chaco into GTK? 有没有人有例子或想法如何将Chaco嵌入GTK?

I use python with matplotlib. 我将python与matplotlib一起使用。 To have a graphic inserted in the GUI, I need a "backend" : http://matplotlib.sourceforge.net/faq/installing_faq.html#backends 要在GUI中插入图形,我需要一个“后端”: http : //matplotlib.sourceforge.net/faq/installing_faq.html#backends

Code snippet : 程式码片段:

from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as Canvas

Then, instance it (the add_subplot prepares a place for one plot) : 然后,对其进行实例化(add_subplot为一个图准备一个位置):

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

So, what I want to say is that you need a "backend" from your package where you may be able to draw into, and that GTK can recognize. 因此,我想说的是,您需要从包中获取一个“后端”,以便您可以使用它,并且GTK可以识别。 It suppose your chaco lib has to be compiled with GTK support. 它假定您的chaco库必须在GTK支持下进行编译。 I can not install chaco here today, so please dig that way and let me know what you find ! 我今天不能在这里安装chaco,所以请以这种方式进行挖掘,并让我知道您发现了什么!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM