Created
February 12, 2014 23:02
-
-
Save anonymous/8966321 to your computer and use it in GitHub Desktop.
pyqtgraph prolbem
This file contains 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
## Create window with two ImageView widgets | |
win = QtGui.QMainWindow() | |
win.resize(800,800) | |
win.setWindowTitle('pyqtgraph example: DataSlicing') | |
cw = QtGui.QWidget() | |
win.setCentralWidget(cw) | |
l = QtGui.QGridLayout() | |
cw.setLayout(l) | |
dummy_plot= pg.PlotItem(title='Pilatus image') | |
dummy_plot.enableAutoRange() | |
imv1 = pg.ImageView(view=dummy_plot ) | |
# imv1 = pg.ImageView() | |
pw = pg.PlotWidget() | |
pw2 = pg.PlotWidget() | |
pw3 = pg.PlotWidget() | |
# imv2 = pg.ImageView() | |
l.addWidget(imv1, 0, 0) | |
l.addWidget(pw, 1, 0) | |
l.addWidget(pw2, 2, 0) | |
win.show() | |
roi = pg.LineSegmentROI([[10, 64], [120,64]], pen='r') | |
imv1.addItem(roi) | |
data = data_array | |
def update(): | |
global data, imv1, pw, roi | |
pw.clear() | |
pw2.clear() | |
d2 = roi.getArrayRegion(data_array, imv1.imageItem, axes=(1,2)) | |
pw.plot(d2[0],pen=roi.pen) | |
pw2.plot(d2[1],pen = [5,8]) | |
roi.sigRegionChanged.connect(update) | |
imv1.setImage(data_array, xvals=data_df.Time )#, axes= {'t':2, 'x':0, 'y':1, 'c':3},transform=) | |
update() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment