Hello everybody!
My name is Chris, I´m new here and would like to express my greatest gratitude to however can help me out as I´m stuck on something I´m not really good at.

My problem: I just started using Qwt since 1 week.
My specific problem:

I have absolute values of a digital process stored in: extern long Abs[1024][256];
I have 1024 values I want to plot on the X-Axis and 256 values on the Y-Axis, using the Spectrogram but I want them not to be scaled 0-1023 and 0-255 but with FREQUENCY and TIME, so

X-AXIS: 0 to 2048us with step 2us
Y-AXIS: -2560 to 2560Hz with step 20Hz

In the GUI, the tab called Visualization is where I see my plot:

Qt Code:
  1. ...
  2. d_spectrogram = new QwtPlotSpectrogram();
  3. d_spectrogram->setRenderThreadCount( 0 ); // use system specific thread count
  4.  
  5. d_spectrogram->setColorMap( new ColorMap() );
  6. d_spectrogram->setCachePolicy( QwtPlotRasterItem::PaintCache );
  7.  
  8. d_spectrogram->setData(new DSPFunc() );
  9. d_spectrogram->attach(ui->tab_Visualization->ui->qwtPlot_dataView);
  10.  
  11. ui->tab_Visualization->ui->qwtPlot_dataView->replot();
  12. ...
To copy to clipboard, switch view to plain text mode 


Here is the header of the function:

Qt Code:
  1. class DSPFunc : public QwtRasterData
  2. {
  3.  
  4. public:
  5. DSPFunc();
  6. virtual double value( double x, double y ) const;
  7. };
  8.  
  9. #endif // DSPFUNC_H
To copy to clipboard, switch view to plain text mode 


Here is the code

Qt Code:
  1. DSPFunc::DSPFunc()
  2. {
  3.  
  4. setInterval( Qt::XAxis, QwtInterval( 0.0, 1024.0 ) );
  5. setInterval( Qt::YAxis, QwtInterval( 0.0, 256.0 ) );
  6. setInterval( Qt::ZAxis, QwtInterval( 0.0, 10.0 ) );
  7.  
  8.  
  9. }
  10.  
  11. double DSPFunc::value( double x, double y ) const
  12. {
  13.  
  14.  
  15.  
  16.  
  17. if ((y >= 0.0) && (y <= double(256)) && (x >= 0.0) && (x <= double(1024)))
  18.  
  19. return Abs[quint16(floor(x))][quint16(floor(y))];
  20.  
  21. else
  22. return 0.0;
  23. }
To copy to clipboard, switch view to plain text mode 


Here is the visualization part:


Qt Code:
  1. Visualization::Visualization(QWidget *parent) :
  2. QDialog(parent),
  3. ui(new Ui::Visualization)
  4. {
  5.  
  6. ui->setupUi(this);
  7.  
  8. ui->qwtPlot_dataView->setAxisTitle(QwtPlot::yLeft, QwtText("FREQUENCY [Hz]"));
  9. ui->qwtPlot_dataView->setAxisScale(QwtPlot::yLeft, -2560, 2560);
  10. ui->qwtPlot_dataView->setAxisTitle(QwtPlot::xBottom, QwtText("TIME [µs]"));
  11. ui->qwtPlot_dataView->setAxisScale(QwtPlot::xBottom, 0, 2048 );
  12.  
  13. }
  14.  
  15. Visualization::~Visualization()
  16. {
  17. delete ui;
  18. }
To copy to clipboard, switch view to plain text mode 



Right now I see a plot that has the correct axis but data is not scaled correcty. I would like to know If I need to operate my changes on the
values returned here:
return Abs[quint16(floor(x))][quint16(floor(y))];

and if so how would I need to proceed.

Thanks and sorry for this simple and probably stupid question but Qwt is still a bit difficult for me and I really need help.