2010-11-22 03:50:04 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import sys, os
|
2011-04-05 14:35:50 +00:00
|
|
|
## Add path to library (just for examples; you do not need this)
|
2010-11-22 03:50:04 +00:00
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
|
|
|
|
|
|
|
|
from PyQt4 import QtGui, QtCore
|
2011-04-05 14:35:50 +00:00
|
|
|
import pyqtgraph as pg
|
|
|
|
import numpy as np
|
2010-11-22 03:50:04 +00:00
|
|
|
|
|
|
|
app = QtGui.QApplication([])
|
|
|
|
mw = QtGui.QMainWindow()
|
2011-04-05 14:35:50 +00:00
|
|
|
cw = pg.PlotWidget()
|
2010-11-22 03:50:04 +00:00
|
|
|
mw.setCentralWidget(cw)
|
|
|
|
mw.show()
|
|
|
|
|
2011-04-05 14:35:50 +00:00
|
|
|
s1 = pg.ScatterPlotItem(size=10, pen=QtGui.QPen(QtCore.Qt.NoPen), brush=QtGui.QBrush(QtGui.QColor(255, 255, 255, 20)))
|
2010-11-22 03:50:04 +00:00
|
|
|
pos = np.random.normal(size=(2,3000))
|
|
|
|
spots = [{'pos': pos[:,i]} for i in range(3000)]
|
|
|
|
s1.addPoints(spots)
|
|
|
|
|
|
|
|
cw.addDataItem(s1)
|
|
|
|
|
2011-04-05 14:35:50 +00:00
|
|
|
## Start Qt event loop unless running in interactive mode.
|
|
|
|
if sys.flags.interactive != 1:
|
|
|
|
app.exec_()
|
2010-11-22 03:50:04 +00:00
|
|
|
|