Commit 810b90a1 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Minor fix in ScatterPlotItem handling of per-point data

parent ccc5e627
......@@ -404,19 +404,24 @@ class AxisItem(GraphicsWidget):
return self.mapRectFromParent(self.geometry()) | linkedView.mapRectToItem(self, linkedView.boundingRect())
def paint(self, p, opt, widget):
prof = debug.Profiler('AxisItem.paint', disabled=True)
if self.picture is None:
try:
picture = QtGui.QPicture()
painter = QtGui.QPainter(picture)
specs = self.generateDrawSpecs(painter)
prof.mark('generate specs')
if specs is not None:
self.drawPicture(painter, *specs)
prof.mark('draw picture')
finally:
painter.end()
self.picture = picture
#p.setRenderHint(p.Antialiasing, False) ## Sometimes we get a segfault here ???
#p.setRenderHint(p.TextAntialiasing, True)
self.picture.play(p)
prof.finish()
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.
## (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):
dataSet['data'][i] = rec
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment