pyqtgraph/examples/CLIexample.py
2012-03-01 22:53:52 -05:00

23 lines
564 B
Python

## Add path to library (just for examples; you do not need this)
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
app = QtGui.QApplication([])
data = np.random.normal(size=1000)
pg.plot(data, title="Simplest possible plotting example")
data = np.random.normal(size=(500,500))
pg.show(data, title="Simplest possible image example")
## Start Qt event loop unless running in interactive mode.
if sys.flags.interactive != 1:
app.exec_()