Created
January 23, 2017 18:17
-
-
Save mgrady3/ee502090c135553af4f1028086bec999 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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