Mikhail
# -*- coding: utf-8 -*-
import initExample
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
from pyqtgraph import functions as fn
app = QtGui.QApplication([])
mw = QtGui.QMainWindow()
view = pg.GraphicsLayoutWidget() ## GraphicsView with GraphicsLayout inserted by default
mw.setCentralWidget(view)
mw.show()
mw.setWindowTitle('pyqtgraph example: ScatterPlot')
w = view.addPlot()
mysymbol = QtGui.QPainterPath()
mysymbol.addText(0.0, 0.0, QtGui.QFont("San Serif", 1), "Y")
s = pg.ScatterPlotItem(pxMode=True) ## Set pxMode=False to allow spots to transform with the view
spots = []
for i in range(10):
for j in range(10):
spots.append({'pos': (i, j), 'size': 20, 'pen': fn.mkPen({'color': 'w', 'width': 2}),
'brush':pg.intColor(i*10+j, 100), 'symbol': mysymbol})
s.addPoints(spots)
w.addItem(s)
if __name__ == '__main__':
QtGui.QApplication.instance().exec_()