Qtdesigner 中的 Matplotlib 小部件 [英] Matplotlib widget in Qtdesigner

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

问题描述

我正在使用 Qtdesigner3 编写一个 python gui,它将读取数据文件做一些数学运算,然后使用 matplotlib 绘制结果.我看过matplotlib qt的示例,但是没有一个使用设计器.

I am using Qtdesigner3 to write a python gui that will read data files do some math and then plot the results using matplotlib. I've looked at examples of matplotlib qt, but none of them use the designer.

我的问题是如何在QTdesigner中创建matplotlib小部件?

My question is how do I create a matplotlib widget in the QTdesigner?

推荐答案

在pythonxy邮件列表上,几乎对这个确切的问题有了更好的回答

There is a better response to almost this exact question over at the pythonxy mailling list

http://groups.google.com/group/pythonxy/browse_thread/thread/c52424bf11328181?pli = 1

引用线程中的显着点.来自项目的主要开发人员之一.

To quote the salient point from the thread. This is from one of the lead developers of the project.

你可以直接使用 Matplotlib Qt Designer 插件,它是随Python(x,y)一起提供.它位于:C:\Python26\Lib\site-packages\PyQt4\plugins\设计师\蟒蛇".在您的linux机器上,创建一个名为PYQTDESIGNERPATH,并将其设置为包含'matplotlibplugin.py'.就这样!

You may directly use the Matplotlib Qt Designer plugin which is shipped with Python(x,y). It is located here: "C:\Python26\Lib\site-packages\PyQt4\plugins \designer\python". On your linux machine, create an environment variable called PYQTDESIGNERPATH, and set it to the directory containing 'matplotlibplugin.py'. That's all!

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

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