Some more investigation:
My code
qDebug() << "<<<<<<<<<<<<<<<<<";
qDebug() << "Left (p): " << d->plot->canvas()->rect().left();
qDebug() << "Right (p): " << d->plot->canvas()->rect().width();
qDebug
() <<
"Left : " << d
->plot
->invTransform
(QwtPlot::xBottom,
0);
qDebug
() <<
"Right: " << d
->plot
->invTransform
(QwtPlot::xBottom, d
->plot
->canvas
()->rect
().
width());
qDebug() << "dx (p): " << dx;
qDebug
() <<
"dx : " << d
->plot
->invTransform
(QwtPlot::xBottom,
fabs(dx
));
const QwtScaleMap map = d->plot->canvasMap( QwtPlot::xBottom );
qDebug() << "<<<<<<<<<<<<<<<<<";
qDebug() << "Left (p): " << d->plot->canvas()->rect().left();
qDebug() << "Right (p): " << d->plot->canvas()->rect().width();
qDebug() << "Left : " << d->plot->invTransform(QwtPlot::xBottom, 0);
qDebug() << "Right: " << d->plot->invTransform(QwtPlot::xBottom, d->plot->canvas()->rect().width());
qDebug() << "dx (p): " << dx;
qDebug() << "dx : " << d->plot->invTransform(QwtPlot::xBottom, fabs(dx));
To copy to clipboard, switch view to plain text mode
Output after moving 5 units:
<<<<<<<<<<<<<<<<<
Left (p): 0
Right (p): 502
Left : 14.6537
Right: 45.3258
dx (p): -81
dx : 19.6028
<<<<<<<<<<<<<<<<<
Left (p): 0
Right (p): 502
Left : 14.6537
Right: 45.3258
dx (p): -81
dx : 19.6028
To copy to clipboard, switch view to plain text mode
So my question is, what is dx?
The (limited) documentation says "Offset in horizontal direction", my question is offset from what?
My deductions:
- If left is 0 and right is 502 in pixels(?)
- In my plot axis, left is 14 and right is 45
- So moving 5 units in the units of my plot should be about (+/-)17 pixels(?) in either direction
- Why is the dx then -81, where does that value come from?
Bookmarks