ScatterPlotItem

class pyqtgraph.ScatterPlotItem(spots=None, x=None, y=None, pxMode=True, pen='default', brush='default', size=7, symbol=None, identical=False, data=None)
__init__(spots=None, x=None, y=None, pxMode=True, pen='default', brush='default', size=7, symbol=None, identical=False, data=None)
Arguments:
spots: list of dicts. Each dict specifies parameters for a single spot:
{‘pos’: (x,y), ‘size’, ‘pen’, ‘brush’, ‘symbol’}

x,y: array of x,y values. Alternatively, specify spots[‘pos’] = (x,y) pxMode: If True, spots are always the same size regardless of scaling, and size is given in px.

Otherwise, size is in scene coordinates and the spots scale with the view.
identical: If True, all spots are forced to look identical.
This can result in performance enhancement.
symbol can be one of:
‘o’ circle ‘s’ square ‘t’ triangle ‘d’ diamond ‘+’ plus
setPoints(spots=None, x=None, y=None, data=None)

Remove all existing points in the scatter plot and add a new set. Arguments:

spots - list of dicts specifying parameters for each spot
[ {‘pos’: (x,y), ‘pen’: ‘r’, ...}, ...]
x, y - arrays specifying location of spots to add.
all other parameters (pen, symbol, etc.) will be set to the default values for this scatter plot. these arguments are IGNORED if ‘spots’ is specified
data - list of arbitrary objects to be assigned to spot.data for each spot
(this is useful for identifying spots that are clicked on)

Previous topic

PlotCurveItem

Next topic

PlotItem

This Page