Commit 7c1c9f8d authored by Luke Campagnola's avatar Luke Campagnola
Browse files

added auto-ranging example

parent 038b116a
# -*- coding: utf-8 -*-
## This example demonstrates the different auto-ranging capabilities of ViewBoxes
import initExample ## Add path to library (just for examples; you do not need this)
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
app = QtGui.QApplication([])
#mw = QtGui.QMainWindow()
win = pg.GraphicsWindow(title="Plot auto-range examples")
d = np.random.normal(size=100)
d[50:54] += 10
p1 = win.addPlot(title="95th percentile range", y=d)
p1.enableAutoRange('y', 0.95)
p2 = win.addPlot(title="Auto Pan Only")
curve = p2.plot()
def update():
t = pg.time()
data = np.ones(100) * np.sin(t)
data[50:60] += np.sin(t)
global curve
timer = QtCore.QTimer()
## Start Qt event loop unless running in interactive mode or using pyside.
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment