Hello,
I am trying to work out how the invTransform function works. But I guess I misunderstood something.
Here is what I tried already:
#include <QApplication>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
int main( int argc, char** argv ){
QVector<QPointF> list;
curve.setSamples( list );
curve.attach( &plot );
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3 );
qDebug
() <<
"invTransform(): " << plot.
canvasMap( QwtPlot::xBottom ).
invTransform( list
[1].
x() );
plot.show();
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3);
return app.exec();
}
#include <QApplication>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
int main( int argc, char** argv ){
QApplication app( argc, argv );
QwtPlot plot;
QwtPlotCurve curve;
QVector<QPointF> list;
list.append( QPointF(2,1.5) );
list.append( QPointF(3,5) );
list.append( QPointF(4,3.4) );
curve.setSamples( list );
curve.attach( &plot );
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3 );
qDebug() << "invTransform(): " << plot.canvasMap( QwtPlot::xBottom ).invTransform( list[1].x() );
plot.show();
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3);
return app.exec();
}
To copy to clipboard, switch view to plain text mode
The Console outputs:
invTransform(): 3
invTransform(): 3
invTransform(): -3
invTransform(): 3
invTransform(): 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.
Bookmarks