layout = QtGui.QHBoxLayout()
self.button = QtGui.QPushButton('Start Plotting')
layout.addWidget(self.button)
self.plot = pg.PlotWidget()
layout.addWidget(self.plot)
self.setLayout(layout)
if __name__ == '__main__':
    app = QtGui.QApplication([])
window = MainWindow()
window.show()
app.exec_()
Live Plotting with PyQtGraph in PyQt4