Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QwtPlotSpectrogram, don't draw from scratch!
Forum Update on Monday, May 27th 2025

QwtPlotSpectrogram, don't draw from scratch!

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 842 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    k_kaz
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved