Hi I am using qwtspectrogram to plot my array data but the problem i am having is scaling.. the qwt scales are distributed over the intervals x and y and the axis are dependent on the pixels. for example if I have a data set of (500×500) and i want to plot for 500mm x500mm its perfect because it is translated over the pixels but if i want to plot 500×500 number of points for 300mmx300mm it is a mess and it shows in the plot 500×500 i know i have to manage the x and y axis but I have no idea how to do that. I manage to play a little and display 500×500 for 250mmx250mm area but can not do for others.
my code is as shown below

Qt Code:
  1. class mydata: public QwtRasterData
  2. {
  3. char filepath[35];
  4. QFile myfile;
  5. QVector<qint16> fileBuf;
  6. int pixel =500; // it represents the number of pixels in one row or column
  7. int dial =1000;
  8. public:
  9.  
  10. mydata()
  11. {
  12. setInterval( Qt::XAxis, QwtInterval( 0, (pixel)-1 ) );
  13. setInterval( Qt::YAxis, QwtInterval( 0, (pixel)-1 ) );
  14. setInterval( Qt::ZAxis, QwtInterval( -dial, dial ) );
  15.  
  16. {
  17. sprintf_s(filepath, "c:\\myfile.bin");
  18.  
  19. myfile.setFileName(filepath);
  20. if(!myfile.open(QIODevice::ReadOnly)) return;
  21.  
  22. QDataStream data(&myfile);
  23. data.setByteOrder(QDataStream::LittleEndian);
  24.  
  25. while(!data.atEnd()) {
  26. qint16 x;
  27. data >> x;
  28. fileBuf.append(x);
  29. }
  30.  
  31. myfile.close();
  32. }
  33. }
  34.  
  35. virtual double value( double x, double y ) const
  36. {
  37. int x_pos = static_cast<int>(x);
  38. int y_pos = static_cast<int>(y);
  39. double c = (fileBuf[ ((x_pos)+((pixel-(y_pos))*pixel))]);
  40. return c;
  41. }
  42. }
To copy to clipboard, switch view to plain text mode 
in short i have same number of pixels for different areas but i have same representation of axis in plot.