在quickly app中嵌入matplotlib?

时间:2013-01-10 15:53:57

标签: python matplotlib embed canonical-quickly

我是一般的编程新手,因此很快。我想在我的Quickly应用程序中嵌入一个Matplotlib图。我找到了一些如何用普通pyGTK应用程序做的例子,但我不确定,如何快速使用它们... 我至少需要matplotlib窗口来停止主窗口的停用。

如果你能帮助我并告诉我在标准嵌入代码中需要改变什么,我会很高兴的。官方的例子是here我只是不明白,如何在这里应用它......

我使用Glade设计界面,快速使用pygobject,而不是pyGTK,这些是主要问题。

NEW:

我找到this 而且似乎我必须在这里使用文件 init .py,而不是我的所有代码的主文件。它看起来像这样:

# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
'''
Some licensing information
'''
import optparse

import locale
from locale import gettext as _
locale.textdomain('chromograph')

from gi.repository import Gtk # pylint: disable=E0611

from chromograph import ChromographWindow

from chromograph_lib import set_up_logging, get_version

def parse_options():
    """Support for command line options"""
    parser = optparse.OptionParser(version="%%prog %s" % get_version())
    parser.add_option(
        "-v", "--verbose", action="count", dest="verbose",
        help=_("Show debug messages (-vv debugs chromograph_lib also)"))
    (options, args) = parser.parse_args()

    set_up_logging(options)

def main():
    'constructor for your class instances'
    parse_options()

    # Run the application.    
    window = ChromographWindow.ChromographWindow()
    window.show()
    Gtk.main()

提前致谢!

0 个答案:

没有答案