fixed ScatterPlotItem.setSize and setData

This commit is contained in:
Luke Campagnola 2013-02-24 11:58:39 -05:00
parent 4fad8fa3d2
commit 3c6081f3a4

View File

@ -495,8 +495,8 @@ class ScatterPlotItem(GraphicsObject):
if isinstance(size, np.ndarray) or isinstance(size, list):
sizes = size
if kargs['mask'] is not None:
sizes = sizes[kargs['mask']]
if mask is not None:
sizes = sizes[mask]
if len(sizes) != len(dataSet):
raise Exception("Number of sizes does not match number of points (%d != %d)" % (len(sizes), len(dataSet)))
dataSet['size'] = sizes
@ -508,13 +508,13 @@ class ScatterPlotItem(GraphicsObject):
if update:
self.updateSpots(dataSet)
def setPointData(self, data, dataSet=None):
def setPointData(self, data, dataSet=None, mask=None):
if dataSet is None:
dataSet = self.data
if isinstance(data, np.ndarray) or isinstance(data, list):
if kargs['mask'] is not None:
data = data[kargs['mask']]
if mask is not None:
data = data[mask]
if len(data) != len(dataSet):
raise Exception("Length of meta data does not match number of points (%d != %d)" % (len(data), len(dataSet)))