Mac上的matplotlib QtDesigner小部件? [英] matplotlib QtDesigner widget on Mac?

查看:67
本文介绍了Mac上的matplotlib QtDesigner小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac上是否存在QTDesigner的matplotlib小部件插件?

is there a matplotlib widget plugin for QTDesigner available for the Mac?

为什么在乎:我正在尝试对现有的python/matplotlib/scipy/numpy应用程序进行GUI验证.我想尝试通过QT和Qdesigner做到这一点,但是我是他们的新手.我知道除了 Designer 之外,我还可以手动"实现 GUI,并从第 6 章:在 Qt 4 中嵌入 Matplotlib"(来自 Python 开发人员的 Matplotlib 一书)以及诸如使用imshow在pyqt4中嵌入matplotlib ".但据说 Designer 有一个小部件插件似乎可以帮助我,但我似乎在任何地方都找不到.

Why I care: I'm trying to GUI-ify an existing python/matplotlib/scipy/numpy application. I'd like to try to do this via QT and Qdesigner, but I'm new to them. I know I can implement the GUI apart from Designer "by hand" and have benefitted from "Chapter 6. Embedding Matplotlib in Qt 4" (from the book Matplotlib for Python Developers), and posts such as "http://eli.thegreenplace.net/2009/01/20/matplotlib-with-pyqt-guis/" and "Embedding matplotlib in pyqt4 using imshow". But supposedly there's a widget plugin for Designer that seems like it would help me out, and I can't seem to find it anywhere.

我看过诸如" Mtplotlib小部件在Qtdesigner中的帖子",但我似乎在我的 Mac 硬盘上找不到 matplotlib 插件.(我使用的是MacPorts,并且pythonselect设置为2.7版本)我似乎只有的插件是

I've seen posts such as "Matplotlib widget in Qtdesigner", but I can't seem to find a matplotlib plugin on my Mac's hard drive. (I'm using MacPorts, and pythonselect is set to the 2.7 version) The only plugins I seem to have are

/opt/local/share/qt4/plugins/designer/libpython27plugin.dylib
/opt/local/share/qt4/plugins/designer/libpython32plugin.dylib
/opt/local/share/qt4/plugins/designer/libqdeclarativeview.dylib
/opt/local/share/qt4/plugins/designer/libqt3supportwidgets.dylib
/opt/local/share/qt4/plugins/designer/libqwebview.dylib   
/opt/local/share/qt4/plugins/designer/libqwt_designer_plugin.dylib

据说PythonXY提供了matplotlib插件,但是根据线程" Mac上的PythonXY?"是没有可用的 PythonXY 端口...

Supposedly PythonXY supplies the matplotlib plugin, however according to the thread "PythonXY on Mac?" there is no available port of PythonXY...

那么有没有办法通过Designer(或其他解决方案)中的插件来计划我的完整GUI,或者我只是在某个框架中手动编码matplotlib部分?

So is there a way to plan out my full GUI this via a plugin in Designer (or some other solution), or will I just be hand-coding the matplotlib part in some frame?

谢谢.

P.S.- 我在 scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer 看到了用于构建 matplotlib 小部件的 Cookbook 说明,但是我的 Designer (4.8.4) 版本看起来与那里描述的完全不同.创建主窗口"后,没有工具"下拉菜单,也没有机会制作自定义小部件...帮助?当前关于制作自定义小部件的教程,qt-project.org/doc/qt-4.8/designer-customwidgetplugin.html,我发现作为一个新手......有点压倒性.

P.S.- I see Cookbook instructions for building a matplotlib widget at scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer , however my version of Designer (4.8.4) looks nothing like the one described there. After creating a "Main Window", there is no "Tools" drop-down, and no opportunity to make Custom widgets...help? The current tutorial on making custom widgets, qt-project.org/doc/qt-4.8/designer-customwidgetplugin.html, I find as a newbie to be...kind of overwhelming.

P.P.S-我也没有嫁给QT4.就像我说的那样,我是新手,所以如果您要指出涉及另一个(更简单?)GUI生成系统(例如Tkinter)的示例,我就很好.

P.P.S- I'm not married to QT4 either. Like I said, I'm brand new to that, so I'm totally fine if you wish to point to examples involving another (easier?) GUI building system such as Tkinter.

推荐答案

本书 Matplotlib用于Python开发人员详细说明了如何在QtDesigner(独立于平台)中添加Matplotlib图形.幸运的是,它包含在免费示例章节,见第 165 页.

The Book Matplotlib for Python Developers explains in detail how you can add a Matplotlib figure in QtDesigner (platform independent). Fortunately, it's covered in the free sample chapter, see page 165.

这篇关于Mac上的matplotlib QtDesigner小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆