QtCore.QObject.__init__(self)
app = QtGui.QApplication([])
# Create window with GraphicsView widget
win = pg.GraphicsLayoutWidget()
win.show() ## show widget alone in its own window
win.setWindowTitle('Realtime prediction')
# Create ViewBox
self.view = win.addViewBox(enableMouse=False)
self.view.invertY()
self.view.setAspectLocked(True)
# Create image item
self.vis = pg.ImageItem()
self.view.addItem(self.vis)
# Create obstacle histogram
plot = pg.PlotItem() # <- background here
plot.layout.setMinimumWidth(200.0)
plot.layout.setMinimumHeight(150.0)
axesB = plot.getAxis('bottom')
axesB.setTicks([xdict.items()])
axesB.setPen((0, 0, 0))
axesL = plot.getAxis('left')
axesL.setPen((0, 0, 0))
plot.setZValue(10)
plot.setY(320.0)
plot.setX(220.0)
self.view.addItem(plot)
self.barGraphItem = pg.BarGraphItem(x = x, height = self.y, width = 1, brush = (255, 0, 0, 128))
plot.addItem(self.barGraphItem)
self.text = pg.TextItem('Loading...') # <- background here
self.text.setColor((0.5, 0.5, 0.5))
self.view.addItem(self.text)
QtGui.QApplication.instance().exec_()