PDA

View Full Version : Plot auto-scaling



ccbaci
26th July 2013, 13:29
I am using Qt+Qwt for real time signal plotting. I need to auto-scale the y-axis so that the canvas size covers the data.

I tried QwtScaleEngine::Attribute::Floating = true to achieve the cumulative min-max. But I want to auto-scale my plot such that the boundaries are not taken from the min-max of data starting from time zero, but starting from another time.

How can I obtain time based min-max? (i.e. the auto-scale of my plot between times 5-10). I know one way is to check out all data between these times to find the max and min, then scale accordingly.

Is there a faster method at Qwt library?

Uwe
26th July 2013, 14:07
But I want to auto-scale my plot such that the boundaries are not taken from the min-max of data starting from time zero, but starting from another time.
Setting a specific time independent from the data is the opposite of autoscaling !
What exactly do you want to to: setting a specific start, while the end needs to be adjusted to the upper limit of the curve ?

Uwe

ccbaci
26th July 2013, 18:04
Thanks for quick reply! I will be more clear about my issue.

9370

I have something similar to this signal. Since I am plotting real-time, if time exceeds 0.08, I change my x interval from (0-0.08) to (0.08-0.16). I have my scale engine floating y left = true. So, the canvas height is increasing with time.

Suppose the signal envolope is started to narrow down -instead of expanding- after time 0.06. Since I have my uppermost data at 0.06; the autoscale takes the min-max from there. However, after 0.08 -on my second time interval, I need my canvas expand according to the data AFTER 0.08. I do not need to see before. This is my main issue.

So, yes, I exactly need a specific start. I don't know which methods are the best for my aim.

Uwe
14th September 2013, 10:59
Isn't this more or less the same question as in: http://www.qtcentre.org/threads/56127-Custom-X-axis-scale-auto-scale-Y-axis-for-many-Curves ?