PDA

View Full Version : Help: spectrogram plot and color scale



gd
6th October 2009, 09:23
Hi,
I'm quite new in using qwt libraries and qt so probably my question is trivial.
I have a spectrogram plot in a main window generated from a data array:
->setData(...)
->replot()
Once I have the spectrogram displayed I just want to add the possibility to change the scales (x,y and color) without loading again the data to the spectrogram. For the x and y scales it is very easy I have used:
setAxisScale(QwtPlot::xButtom,x1,x2)
setAxisScale(QwtPlot::yLeft,y1,y2)
I cannot figure out the procedure to change the color scale. At the beginning the color scale is set just finding the maximum and the minimum of my data array let's say zmin and zmax. How can I replot the spectrogram using different values for zmin and zmax?

Thank you for your attention.

Bye
Giuseppe

Uwe
7th October 2009, 17:01
plot->axisWidget(...)->setColorMap(spectrogram->data().range(),
spectrogram->colorMap());

Uwe

gd
12th October 2009, 21:17
Thank you!!!