Hello,
I am trying to work out how the invTransform function works. But I guess I misunderstood something.

Here is what I tried already:

Qt Code:
  1. #include <QApplication>
  2.  
  3. #include <qwt_plot.h>
  4. #include <qwt_plot_curve.h>
  5.  
  6. int main( int argc, char** argv ){
  7.  
  8. QApplication app( argc, argv );
  9.  
  10. QwtPlot plot;
  11. QwtPlotCurve curve;
  12. QVector<QPointF> list;
  13.  
  14. list.append( QPointF(2,1.5) );
  15. list.append( QPointF(3,5) );
  16. list.append( QPointF(4,3.4) );
  17.  
  18. curve.setSamples( list );
  19. curve.attach( &plot );
  20.  
  21. qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3 );
  22. qDebug() << "invTransform(): " << plot.canvasMap( QwtPlot::xBottom ).invTransform( list[1].x() );
  23.  
  24. plot.show();
  25.  
  26. qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3);
  27.  
  28. return app.exec();
  29. }
To copy to clipboard, switch view to plain text mode 

The Console outputs:

Qt Code:
  1. invTransform(): 3
  2. invTransform(): 3
  3. invTransform(): -3
To copy to clipboard, switch view to plain text mode 

Can someone please tell me why it's not working?!
I appreciate it.