Minor fix in ScatterPlotItem handling of per-point data
This commit is contained in:
parent
ccc5e6274a
commit
810b90a1e6
@ -404,19 +404,24 @@ class AxisItem(GraphicsWidget):
|
|||||||
return self.mapRectFromParent(self.geometry()) | linkedView.mapRectToItem(self, linkedView.boundingRect())
|
return self.mapRectFromParent(self.geometry()) | linkedView.mapRectToItem(self, linkedView.boundingRect())
|
||||||
|
|
||||||
def paint(self, p, opt, widget):
|
def paint(self, p, opt, widget):
|
||||||
|
prof = debug.Profiler('AxisItem.paint', disabled=True)
|
||||||
if self.picture is None:
|
if self.picture is None:
|
||||||
try:
|
try:
|
||||||
picture = QtGui.QPicture()
|
picture = QtGui.QPicture()
|
||||||
painter = QtGui.QPainter(picture)
|
painter = QtGui.QPainter(picture)
|
||||||
specs = self.generateDrawSpecs(painter)
|
specs = self.generateDrawSpecs(painter)
|
||||||
|
prof.mark('generate specs')
|
||||||
if specs is not None:
|
if specs is not None:
|
||||||
self.drawPicture(painter, *specs)
|
self.drawPicture(painter, *specs)
|
||||||
|
prof.mark('draw picture')
|
||||||
finally:
|
finally:
|
||||||
painter.end()
|
painter.end()
|
||||||
self.picture = picture
|
self.picture = picture
|
||||||
#p.setRenderHint(p.Antialiasing, False) ## Sometimes we get a segfault here ???
|
#p.setRenderHint(p.Antialiasing, False) ## Sometimes we get a segfault here ???
|
||||||
#p.setRenderHint(p.TextAntialiasing, True)
|
#p.setRenderHint(p.TextAntialiasing, True)
|
||||||
self.picture.play(p)
|
self.picture.play(p)
|
||||||
|
prof.finish()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def setTicks(self, ticks):
|
def setTicks(self, ticks):
|
||||||
|
@ -517,7 +517,7 @@ class ScatterPlotItem(GraphicsObject):
|
|||||||
|
|
||||||
## Bug: If data is a numpy record array, then items from that array must be copied to dataSet one at a time.
|
## Bug: If data is a numpy record array, then items from that array must be copied to dataSet one at a time.
|
||||||
## (otherwise they are converted to tuples and thus lose their field names.
|
## (otherwise they are converted to tuples and thus lose their field names.
|
||||||
if isinstance(data, np.ndarray) and len(data.dtype.fields) > 1:
|
if isinstance(data, np.ndarray) and (data.dtype.fields is not None)and len(data.dtype.fields) > 1:
|
||||||
for i, rec in enumerate(data):
|
for i, rec in enumerate(data):
|
||||||
dataSet['data'][i] = rec
|
dataSet['data'][i] = rec
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user