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 {
    
    private:
        std::vector<std::vector<double>> data;
    
    public:
        SpectrogramData(int height, int width);
    
        ~SpectrogramData();
    
        virtual double value(double x, double y) const;
    };
    

    spectrogram->setData(spectrogram_data);

    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

    Hi,

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.