Skip to content

Instantly share code, notes, and snippets.

@mgrady3
Created January 23, 2017 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgrady3/ee502090c135553af4f1028086bec999 to your computer and use it in GitHub Desktop.
Save mgrady3/ee502090c135553af4f1028086bec999 to your computer and use it in GitHub Desktop.
import numpy as np
import pyqtgraph as pqg
import sys
from PyQt5 import QtWidgets
class TestWindow(QtWidgets.QWidget):
def __init__(self, parent=None):
super(TestWindow, self).__init__(parent)
self.layout = QtWidgets.QVBoxLayout()
self.imageplot = pqg.ImageView()
self.layout.addWidget(self.imageplot)
self.setLayout(self.layout)
self.data = None
self.loadData()
self.show()
def loadData(self):
self.data = np.random.rand(640, 480)
self.imageplot.setImage(self.data)
def main():
app = QtWidgets.QApplication(sys.argv)
tw = TestWindow()
tw.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment