Commit f5ee45ac authored by Guillaume Poulin's avatar Guillaume Poulin
Browse files

Improve ScatterPlotItem

Slightly faster and more memory efficient, correct python 3 bug
parent 26b84693
......@@ -4,6 +4,10 @@ import pyqtgraph.functions as fn
from .GraphicsItem import GraphicsItem
from .GraphicsObject import GraphicsObject
from itertools import starmap
from itertools import imap
except ImportError:
imap = map
import numpy as np
import scipy.stats
import weakref
......@@ -702,8 +706,8 @@ class ScatterPlotItem(GraphicsObject):
# rect = QtCore.QRectF(y, x, h, w)
# self.fragments.append(QtGui.QPainter.PixmapFragment.create(pos, rect))
rect = starmap(QtCore.QRectF,['fragCoords'])
pos = map(QtCore.QPointF, pts[0,:], pts[1,:])
self.fragments = map(QtGui.QPainter.PixmapFragment.create, pos, rect)
pos = imap(QtCore.QPointF, pts[0,:], pts[1,:])
self.fragments = list(imap(QtGui.QPainter.PixmapFragment.create, pos, rect))
def setExportMode(self, *args, **kwds):
GraphicsObject.setExportMode(self, *args, **kwds)
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