QCustomPlot Discussion and Comments

Expand range by a simple percentage amountReturn to overview

Starting from the real-time example, I built a simpler real-time plotter which fetches data from a local data store.

Works great so far, but one minor wiggle: if the values for the current time interval are, say in the 100 to 200 range then the lower
and upper 'box' will be placed squarely at 100 and 200, the attained min and max.

That is a little unusual. If I use, say, R to plot the point 1 to 10 then the 'canvas' with span 0.64 to 10.36 (as returned by par("usr")) leaving just that little bit for the eye to appreciate the range beyond the min and max values.

I looked around and found some methods for scaling the axes but none helped me accomplished what I am after. Any tips?

Using qcustomplot 1.3.2 on Ubuntu 16.10.

Thanks, Dirk

So .. I cheated and just added two 'transparent' series with a positive (negative) delta to the series I happen to know are boundary ones.

There must be a better way though.

I assume you call rescale after setting new data points. Now after doing that, why can't you just manually increase the range by a certain factor with xAxis->scaleRange(1.07, xAxis->range().center())? This gives 3.5% gap either side.

Thanks for your answer which I missed (as forums don't give you a heads-up as emails would). That is a fine idea -- I had found and tried scaleRange() but was missing the autoMAGIC value setting you showed me here.

This works just fine -- many thanks!