I want to draw a spectrogram periodically, which means that data come over time, and i just want to add columns to the previous graph (see photo).
What i did is to declare a
QwtPlotSpectrogram * spectrogram
To copy to clipboard, switch view to plain text mode
instance, and i use the setData() function where i pass a SpectrogramData instance:
private:
std::vector<std::vector<double>> data;
public:
SpectrogramData(int height, int width);
~SpectrogramData();
virtual double value(double x, double y) const;
};
class SpectrogramData : public QwtRasterData {
private:
std::vector<std::vector<double>> data;
public:
SpectrogramData(int height, int width);
~SpectrogramData();
virtual double value(double x, double y) const;
};
To copy to clipboard, switch view to plain text mode
spectrogram->setData(spectrogram_data);
spectrogram->setData(spectrogram_data);
To copy to clipboard, switch view to plain text mode
When new data come, i add them to the data structure, and call replot() in the QwtPlot instance that the QwtSpectrogram is attached to.
Because the spectrogram will ultimately have about 700*22000 size, i don't know what replot() does. Is there a way to tell qwt to only plot a certain column of data or region or rectangular or something in the spectrogram?
Bookmarks