From: Gerald S. <gd...@mr...> - 2011-07-15 02:47:51
|
As Eric said Github master works with PySide. If you can't wait for a release and you don't want to run the Github version of MPL you can use the following code to render a plot inside a PySide app. Note that this will just show the plot image. You won't get the tool bar, status bar or any other GUI elements. Gerald. On 14/07/2011 3:33 PM, Eric Firing wrote: > On 07/13/2011 09:18 PM, Armagan Tarim wrote: >> Hi All, >> I have tried the sample PySide code given at >> http://www.scipy.org/Cookbook/Matplotlib/PySide >> the below excerpt is from my "Python Shell" for this sample code, which >> gives this error, > Github master works with pyside. It is expected to emerge as a release > within a few weeks. > > Eric > >> "ImportError: Warning: formlayout requires PyQt4>v4.3" >> It seems that it is looking for PyQt; but the whole point of using >> PySide is to avoid using PyQt. >> Any help is appreciated. >> -- Armagan >> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit >> (Intel)] on win32 >> Type "copyright", "credits" or "license()" for more information. >> >>> import sys >> >>> import matplotlib >> >>> matplotlib.use('Qt4Agg') >> >>> import pylab >> Traceback (most recent call last): >> File "<pyshell#3>", line 1, in<module> >> import pylab >> File "C:\Python27\lib\site-packages\pylab.py", line 1, in<module> >> from matplotlib.pylab import * >> File "C:\Python27\lib\site-packages\matplotlib\pylab.py", line 263, in >> <module> >> from matplotlib.pyplot import * >> File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 95, in >> <module> >> new_figure_manager, draw_if_interactive, show = pylab_setup() >> File "C:\Python27\lib\site-packages\matplotlib\backends\__init__.py", >> line 25, in pylab_setup >> globals(),locals(),[backend_name]) >> File >> "C:\Python27\lib\site-packages\matplotlib\backends\backend_qt4agg.py", >> line 12, in<module> >> from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\ >> File "C:\Python27\lib\site-packages\matplotlib\backends\backend_qt4.py", >> line 18, in<module> >> import matplotlib.backends.qt4_editor.figureoptions as figureoptions >> File >> "C:\Python27\lib\site-packages\matplotlib\backends\qt4_editor\figureoptions.py", >> line 11, in<module> >> import matplotlib.backends.qt4_editor.formlayout as formlayout >> File >> "C:\Python27\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py", >> line 51, in<module> >> raise ImportError, "Warning: formlayout requires PyQt4>v4.3" >> ImportError: Warning: formlayout requires PyQt4>v4.3 >> >> ------------------------------------------------- >> |