使PySide与Matplotlib一起使用 [英] Getting PySide to work with matplotlib
本文介绍了使PySide与Matplotlib一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试在SciPy网站上运行示例代码,但是我明白了错误:
I have tried running the example code on the SciPy website, but I get this error:
Traceback (most recent call last):
File ".\matplotlibPySide.py", line 24, in <module>
win.setCentralWidget(canvas)
TypeError: 'PySide.QtGui.QMainWindow.setCentralWidget' called with wrong argument types:
PySide.QtGui.QMainWindow.setCentralWidget(FigureCanvasQTAgg)
Supported signatures:
PySide.QtGui.QMainWindow.setCentralWidget(PySide.QtGui.QWidget)
我正在构建一个简单的科学数据记录器,最终将其用于商业应用,因此我确实需要PySide的LGPL和绘图功能.有没有人有如何使它工作或替代绘图软件包或想法的经验?
I am building a simple scientific data logger that will eventually be used in commercial applications, so I really need both the LGPL from PySide and plotting functionality. Does anyone have experience on how to get this to work or alternative plotting packages or ideas?
谢谢.
推荐答案
您提到的示例:
http://www.scipy.org/Cookbook/Matplotlib/PySide
可行,但是您可能需要建议使用PySide:
works, but you might need to suggest the use of PySide:
...
matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4']='PySide'
import pylab
...
这篇关于使PySide与Matplotlib一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文