I recently upgraded my machine and am now using QT 6.3.1 and pyqtgraph 0.13.1-3
There seems to be an API change with ImageItem.scale() that breaks existing code that was working perfectly before the upgrade.
As best I can tell, scale() is inherited from QGraphicsItem, and at some point in the past, it used to take 2 arguments x_scale,y_scale, but now takes none.
self.image = pg.ImageItem(np.zeros((1, 1)))
self.plot.addItem(self.image)
self.image.setImage(image)
# x-axis coordinate values are wavelengths (eg, 450--750)
# y-axis coordinates are simply the camera pixel numbers (0--199)
self.xlabels = np.arange(450, 750)
# Translate and scale the ImageItem to match the x-axis labels
self.image.translate(self.xlabels[0], 0)
self.image.scale((self.xlabels[-1] - self.xlabels[0])/len(self.xlabels), 1)
You can find various examples of ImageItem.scale(x_scale, y_scale) when googling a bit.
But now after the update to either QT or pyqtgraph (or both), that last line throws the error
TypeError: ImageItem.scale() takes no arguments (2 given)
So what's the new way to do this now? Is it using QtGui.QTransform, and then assigning the transform to the ImageItem?
I can't even find an older version of the QT API or the PyQTGraph API that shows a scale function that takes any arguments (so that's why I'm unsure which class the scale function used to even come from).