pyqtgraph/examples/test_scatterPlot.py
Luke Campagnola 6783f4fa26 sync changes from acq4:
- numerous fixes in close() functions
 - added Transform class
 - ROI widgets now operate in degrees instead of radians for easier Qt compatibility
2011-04-25 08:51:18 -04:00

27 lines
716 B
Python
Executable File

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