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.

There are a few examples around of setting the scale of the image based on 
the number of points in my data, like this one from here: 
https://www.mail-archive.com/[email protected]/msg00740.html

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).

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/5a0112ca-9ec9-49fb-948b-73944104fdc3n%40googlegroups.com.

Reply via email to