diff options
author | Tom Rondeau <trondeau@molly.home> | 2009-08-25 18:22:06 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@molly.home> | 2009-08-25 18:22:06 -0400 |
commit | 785cacd477d50aba8a412bae16c57681c52a7fd2 (patch) | |
tree | 20bb87cf2fae4c4f228af11cc2175cca907c1005 /gr-utils/src/python/gr_plot_qt.py | |
parent | ab88e3c4fcf96093637eaadeae360df0d04282fa (diff) |
Added colorbar to spectrogram for magnitude measurement.
Diffstat (limited to 'gr-utils/src/python/gr_plot_qt.py')
-rwxr-xr-x | gr-utils/src/python/gr_plot_qt.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gr-utils/src/python/gr_plot_qt.py b/gr-utils/src/python/gr_plot_qt.py index 5579bbce29..a5e3463c8e 100755 --- a/gr-utils/src/python/gr_plot_qt.py +++ b/gr-utils/src/python/gr_plot_qt.py @@ -195,10 +195,16 @@ class gr_plot_qt(QtGui.QMainWindow): self.spec = Qwt.QwtPlotSpectrogram() self.spec.setColorMap(colorMap) self.spec.attach(self.gui.specPlot) - self.spec.setContourLevels([0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]) self.spec.setDisplayMode(Qwt.QwtPlotSpectrogram.ImageMode, True) self.spec.setData(self.specdata) + self.rightAxis = self.gui.specPlot.axisWidget(Qwt.QwtPlot.yRight) + self.rightAxis.setTitle("Magnitude (dBm)") + self.rightAxis.setColorBarEnabled(True) + self.rightAxis.setColorMap(self.spec.data().range(), + self.spec.colorMap()) + self.gui.specPlot.enableAxis(Qwt.QwtPlot.yRight) + # Set up initial color scheme self.color_modes["Blue on Black"]() @@ -488,13 +494,21 @@ class gr_plot_qt(QtGui.QMainWindow): # since this is taken care of in the SpectrogramData class self.specdata.set_data(self.spec_f, self.spec_t, self.iq_spec) + # Set the color map based on the new data + self.rightAxis.setColorMap(self.spec.data().range(), + self.spec.colorMap()) + + # Set the new axis base; include right axis for the intenisty color bar self.gui.specPlot.setAxisScale(self.gui.specPlot.xBottom, min(self.spec_f), max(self.spec_f)) self.gui.specPlot.setAxisScale(self.gui.specPlot.yLeft, min(self.spec_t), max(self.spec_t)) - + self.gui.specPlot.setAxisScale(self.gui.specPlot.yRight, + self.iq_spec.min(), + self.iq_spec.max()) + # Set the zoomer base to unzoom to the new axis self.specZoomer.setZoomBase() |