Skip to content

Commit

Permalink
Added colormap to waterfall
Browse files Browse the repository at this point in the history
  • Loading branch information
777arc authored Nov 14, 2023
1 parent 8bcfac1 commit 10b25dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/phaser/RADAR_FFT_Waterfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 10b25dd

Please sign in to comment.