From 10b25dd0ec469706d798193f69b52082c11a159c Mon Sep 17 00:00:00 2001 From: Marc Lichtman Date: Tue, 14 Nov 2023 01:30:21 -0500 Subject: [PATCH] Added colormap to waterfall --- examples/phaser/RADAR_FFT_Waterfall.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/phaser/RADAR_FFT_Waterfall.py b/examples/phaser/RADAR_FFT_Waterfall.py index 60b65e5df..f68b0609f 100644 --- a/examples/phaser/RADAR_FFT_Waterfall.py +++ b/examples/phaser/RADAR_FFT_Waterfall.py @@ -337,6 +337,12 @@ def UiComponents(self): self.waterfall = pg.PlotWidget() self.imageitem = pg.ImageItem() self.waterfall.addItem(self.imageitem) + # Use a viridis colormap + pos = np.array([0.0, 0.25, 0.5, 0.75, 1.0]) + color = np.array([[68, 1, 84,255], [59, 82, 139,255], [33, 145, 140,255], [94, 201, 98,255], [253, 231, 37,255]], dtype=np.ubyte) + lut = pg.ColorMap(pos, color).getLookupTable(0.0, 1.0, 256) + self.imageitem.setLookupTable(lut) + self.imageitem.setLevels([0,1]) # self.imageitem.scale(0.35, sample_rate / (N)) # this is deprecated -- we have to use setTransform instead tr = QtGui.QTransform() tr.scale(0.35, sample_rate / (N))