Hi all,<br><br>I am totally new to python programming and especially pyqt..<br> I tried to use plot in a small GUI application which should produce a new figure window when we click the push button.<br>It works well in Windows. In Ubuntu the plot window appears only once ;ie first click. But the 'print' statements are appearing.Also the Gui window becomes active only if we close the figure window.<br>
<br>from pylab import *<br>import matplotlib.pyplot as plt<br>import sys<br>from PyQt4 import QtCore, QtGui<br>from push import Ui_Form<br><br>class Form(QtGui.QMainWindow):<br> <br> def __init__(self, parent=None):<br>
QtGui.QWidget.__init__(self, parent)<br> self.ui = Ui_Form()<br> self.ui.setupUi(self) <br> QtCore.QObject.connect(self.ui.pushButton, QtCore.SIGNAL("clicked()"), self.toplot)<br><br> def toplot(self):<br>
x=[1,2,3]<br> y=[1,2,3]<br> figure(1)<br> plot(x,y)<br> show()<br> print x<br> print y<br> <br><br>if __name__ == "__main__":<br> app = QtGui.QApplication(sys.argv)<br> a = Form() <br>
a.show()<br> sys.exit(app.exec_())<br><br><br>Thanks in advance.<br><br>