Hi all,
Because reasons, I found a problem with the getGradient function in the ColorMap class when using python 3.
Here's the code that I've executed:
cmap = self.color_widget.colorMap()
self.legend.setGradient(cmap.getGradient())
which causes the following exception:
File "C:\Python34\lib\site-packages\pyqtgraph\colormap.py", line 140, in getGradient
g.setStops(zip(pos, color))
TypeError: QGradient.setStops(list-of-tuple-of-float-QColor): argument 1 has unexpected type 'zip'
I found that modifying the function call in colormap.py from
g.setStops(zip(pos, color))
to
g.setStops(list(zip(pos, color)))
fixed the problem.
In python 2.7, zip returns a list of tuples, while in python 3.4 it returns a generator which needs to be converted to a list for setStops to work. Hopefully this helps someone!