I have two problems with axes that I encountered while using QwtPlot:

1. Some curves are scaled with margins some aren't:

CVax.jpg

This curve has values in 0-100 range, precisely. And it is scaled precisely 0-100.

Gax.jpg

This curve as you can see (I plotted two of them at the same time) is nearly absolutely identical BUT it's upper value is 100.517 and lower is -0.489989, and so we get margins. But I want to ALWAYS have these margins (or never have them, but I like them and I would rather prefer them to stay). How can I do that? No matter if signal is perfectly 0-100 or not, I always want margins, because when I plot few curves at once using different scales I will get this:

two.jpg

It makes comparison of very similar signals pretty painful, because autoscale may forget about adding margins. And I would rather want to use autoscale, so I will not have to mess my code even more with fully manual scales.


2. Axes seem to ignore out-of-scale changes in data model.

I use my own QwtSeriesData so I will not have to copy any values anywhere. I catch signal from my dataset saying that value of sample has changed. And then I do this:

Qt Code:
  1. qDebug() << "no zoomer, no multiaxes mode";
  2. this->setAutoReplot(true); // it does not replot this change automatically
  3. this->setAxisAutoScale(QwtAxisId(0,0),true); // I want my axis to rescale automatically to new data
  4. this->replot(); // replot to see changes, autoreplot does not work in this situation for some reasons
  5. QRectF bounds = QRectF(zoomer->zoomBase().left(),this->axisScaleDiv(0).lowerBound(),zoomer->zoomBase().right()-zoomer->zoomBase().left(),this->axisScaleDiv(0).upperBound()-this->axisScaleDiv(0).lowerBound());
  6. zoomer->setZoomBase(bounds); // with code above I actualize zoomer to new base, as changed sample could change upper or lower value
  7. qDebug() << "new zoom base: " << bounds;
To copy to clipboard, switch view to plain text mode 

And get this in debug:
Qt Code:
  1. Slot samplesChanged reached
  2. no zoomer, no multiaxes mode
  3. new zoom base: QRectF(0,50 13089x250)
To copy to clipboard, switch view to plain text mode 

And my plot looks like that:

norescale.jpg

As you can see, curve sees the change in data (but autoreplot does not work on it's own, I had to manually force replot to see this change), yet my axis totally ignores, that it's new upper value should be 500 now. What should I do to convince my axis that it is really nice idea to change it's upper value without setting axes manually?