Qt World Summit: Register Today!

QwtPlotSpectrogram, don't draw from scratch!

  • I want to draw a spectrogram periodically, which means that data come over time, and i want to just add columns to the previous graph.

    What i did is to declare a QwtPlotSpectrogram * spectrogram instance, and i use the setData() function where i pass a SpectrogramData instance:

    class SpectrogramData : public QwtRasterData {
        std::vector<std::vector<double>> data;
        SpectrogramData(int height, int width);
        virtual double value(double x, double y) const;


    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 does replot() do. Is there a way to tell qwt to only plot a certain column of data or region or rectangular or something?

  • Lifetime Qt Champion


    That's a question you should ask to the Qwt authors.

Log in to reply