Hello,

I have a Qwt plot that displays the X-Axis in units of digital samples. My data series is 10 samples for example, data = [ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ]. My x-axis actually corresponds to a length in mm, where 10 Samples = 3 mm. How can I draw the axis so the same data is plotted, but I display a different scale? See the example graph I've drawn below. In reality, I have 512 Samples that correspond to ~3 mm, but I believe this is effectively the same.

Thank you in advance!
Ryan


Qt Code:
  1. plotting data that consists of 10 samples
  2. data = [ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ]
  3.  
  4. 110 + : : : : : : : : : :
  5. 100 + : : : : : : : : x :
  6. 90 + : : : : : : : x : :
  7. 80 + : : : : : : x : : :
  8. 70 + : : : : : x : : : :
  9. 60 + : : : : x : : : : :
  10. 50 + : : : x : : : : : :
  11. 40 + : : x : : : : : : :
  12. 30 + : x : : : : : : : :
  13. 10 + x : : : : : : : : :
  14. 10 x : : : : : : : : : :
  15. 0 --+--+--+--+--+--+--+--+--+--+--+
  16. | | | | | | | | | | |
  17. 0 2 4 6 8
  18. (Samples)
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. Draw X Axis to a new scale where 10 Samples = 3 mm
  2.  
  3. 0 S => 0 mm
  4. 1 S => 0.3 mm
  5. 2 S => 0.6 mm
  6. 3 S => 0.9 mm
  7. .
  8. .
  9. .
  10. 9 S => 2.7 mm
  11. 110 + : : : : : : : : : :
  12. 100 + : : : : : : : : x :
  13. 90 + : : : : : : : x : :
  14. 80 + : : : : : : x : : :
  15. 70 + : : : : : x : : : :
  16. 60 + : : : : x : : : : :
  17. 50 + : : : x : : : : : :
  18. 40 + : : x : : : : : : :
  19. 30 + : x : : : : : : : :
  20. 10 + x : : : : : : : : :
  21. 10 x : : : : : : : : : :
  22. 0 --+--+--+--+--+--+--+--+--+--+--+
  23. | | | | | | | | | | |
  24. | | | | |
  25. 0 0.6 1.2 1.8 2.4
  26. (mm)
To copy to clipboard, switch view to plain text mode