Skip to content
Snippets Groups Projects
Commit 41bc951a authored by Luke Campagnola's avatar Luke Campagnola
Browse files

minor plotting example update

parent 53754038
No related branches found
No related tags found
No related merge requests found
......@@ -83,10 +83,13 @@ p8.addItem(lr)
p9 = win.addPlot(title="Zoom on selected region")
p9.plot(data2)
def update():
p9.setXRange(*lr.getRegion())
lr.sigRegionChanged.connect(update)
update()
def updatePlot():
p9.setXRange(*lr.getRegion(), padding=0)
def updateRegion():
lr.setRegion(p9.getViewBox().viewRange()[0])
lr.sigRegionChanged.connect(updatePlot)
p9.sigXRangeChanged.connect(updateRegion)
updatePlot()
## Start Qt event loop unless running in interactive mode or using pyside.
import sys
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment