2012-03-17 15:47:20 +00:00
|
|
|
import initExample ## Add path to library (just for examples; you do not need this)
|
2011-04-05 16:53:05 +00:00
|
|
|
|
2012-03-02 03:53:52 +00:00
|
|
|
from pyqtgraph.Qt import QtGui, QtCore
|
2012-03-02 02:55:32 +00:00
|
|
|
import numpy as np
|
2011-04-05 16:53:05 +00:00
|
|
|
import pyqtgraph as pg
|
|
|
|
|
|
|
|
app = QtGui.QApplication([])
|
|
|
|
|
|
|
|
|
2012-03-02 02:55:32 +00:00
|
|
|
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")
|
2011-04-05 16:53:05 +00:00
|
|
|
|
|
|
|
|
2012-03-17 15:47:20 +00:00
|
|
|
## 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'):
|
2011-04-05 16:53:05 +00:00
|
|
|
app.exec_()
|