yes, indeed, the QwtPlot::setAxisScale() was the right function to do this.
I have connected a QSlider to "remove the noise", i.e. change the scale of the y-axis manually
void my2dPlot::removeNoise(int noiseFactor)
{
double factorPerCentage = noiseFactor/10;
myPlot
->setAxisScale
(QwtPlot::yLeft,
(1-factorPerCentage
)*0.4*meanOfYvalues ,
(1+factorPerCentage
)*1.6*meanOfYvalues ,
0);
}
void my2dPlot::removeNoise(int noiseFactor)
{
double factorPerCentage = noiseFactor/10;
myPlot->setAxisScale(QwtPlot::yLeft, (1-factorPerCentage)*0.4*meanOfYvalues , (1+factorPerCentage)*1.6*meanOfYvalues ,0);
}
To copy to clipboard, switch view to plain text mode
the only thing is that when I move the slider the whole transformation is a bit slow, but it definitely works.
The other things is that I created the removeNoise(int) by empirical studies only, and when I first move the slider the graph jumps up a bit and then it changes smoothly. If you have any optimizing suggestions on that, please post.
Bookmarks