Skip to content

Commit

Permalink
Ticket xmikos#103 Waterfall scale error
Browse files Browse the repository at this point in the history
Patch by Ian Mortimer @ianmorti
  • Loading branch information
aeburriel committed Sep 5, 2024
1 parent c712a2c commit a86f554
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qspectrumanalyzer/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import collections, math

from Qt import QtCore
from Qt import QtCore, QtGui
import pyqtgraph as pg

# Basic PyQtGraph settings
Expand Down Expand Up @@ -311,7 +311,10 @@ def update_plot(self, data_storage):
# Create waterfall image on first run
if self.counter == 1:
self.waterfallImg = pg.ImageItem()
self.waterfallImg.scale((data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x), 1)
tr = QtGui.QTransform()
scale_x = (data_storage.x[-1] - data_storage.x[0]) / len(data_storage.x)
tr.scale(scale_x, 1)
self.waterfallImg.setTransform(tr)
self.plot.clear()
self.plot.addItem(self.waterfallImg)

Expand Down

0 comments on commit a86f554

Please sign in to comment.