import sys import time import numpy as np import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui class App(QtGui.QMainWindow): def __init__(self, parent=None): super(App, self).__init__(parent) #### Create Gui Elements ########### self.mainbox = QtGui.QWidget() self.setCentralWidget(self.mainbox) self.mainbox.setLayout(QtGui.QVBoxLayout()) self.canvas = pg.GraphicsLayoutWidget() self.mainbox.layout().addWidget(self.canvas) self.label = QtGui.QLabel() self.mainbox.layout().addWidget(self.label) self.view = self.canvas.addViewBox() self.view.setAspectLocked(True) self.view.setRange(QtCore.QRectF(0,0, 100, 100)) # image plot self.img = pg.ImageItem(border='w') self.view.addItem(self.img) self.canvas.nextRow() # line plot self.otherplot = self.canvas.addPlot() self.h2 = self.otherplot.plot(pen='y')