Thank you,
Sorry I did known the existence of matplotlib.backends.backend_qt4agg. It is more easy than I thought.

but I still have a problem. This is my code :

import sys

from PyQt4.QtCore import *
from PyQt4.QtGui import *

from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure

#------------------------------------------------------------------------------
class MyWidget(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.menuBar = QMenuBar()
        self.fileMenu = QMenu(self.tr("&File"), self)
        self.menuBar.addMenu(self.fileMenu)

        mainLayout = QVBoxLayout()
        mainLayout.setMenuBar(self.menuBar)
       
        self.setLayout(mainLayout)

#------------------------------------------------------------------------------
if __name__ == "__main__":
    app = QApplication(sys.argv)
    dialog = MyWidget()
    dialog.show()
    sys.exit(app.exec_())


and it does not works because the main window is blocking.
But when I comment this line :
#from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
it works !
What  am I doing wrong ?

PyQT4 is 4.0.1
Matplotlib is 0.87.4

Samuel


Darren Dale wrote:
On Tuesday 15 August 2006 16:05, [EMAIL PROTECTED] wrote:
  
Thank you very much.

What I would like is example for embedding_in_qt.py but whith qt4

when I tried :

import PyQt4
from PyQt4.QtCore import *
from PyQt4.QtGui import *

from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as
FigureCanvas
from matplotlib.figure import Figure

but I have :

Traceback (most recent call last):
    

You should be doing this instead:

from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas

Darren

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to