2016-11-19 19 views
0

以下のコードは、Tkinter用とmayavi用の2つの画面をダンプします。 Tkinterの中にマヤビを埋め込む方法。それも可能ですか?そうでない場合は、フレーム/キャンバスに埋め込まれたmayaviプロットを持つGUIを構築するための代替手段は何ですか?tavinterにmayaviプロットを埋め込むことは可能ですか?

from tkinter import * 
import numpy 
from mayavi.mlab import * 


top = Tk() 


t = numpy.linspace(0, 4 * numpy.pi, 20) 
cos = numpy.cos 
sin = numpy.sin 

x = sin(2 * t) 
y = cos(t) 
z = cos(2 * t) 
s = 2 + sin(t) 

points3d(x, y, z, s, colormap="copper", scale_factor=.25) 

top.mainloop() 

答えて

2

MayaviはwxWidgetsのないTkinterのとhttp://wxwidgets.org/またはQtのhttps://www.qt.io/ベースのGUIプログラムに埋め込むことができます。

関連する文書は、文書はまた、あなたのニーズがシンプルであれば、近いソリューションにあなたを得ることができるコントローラウィジェットを使用するための簡単な例を持っているhttp://docs.enthought.com/mayavi/mayavi/building_applications.html

です。

関連する問題