QCustomPlot Discussion and Comments

Mapping plot into other x axis rangeReturn to overview

Hi,
I was wondering is there a way to map a plot from one range to another?
For example, here's the situation I'm interested in:
Lets say I have an x and y QVector with 5 seconds worth of sensor data.
The x axis data is a timestamp that, naturally, is always increasing as time goes on - [10,15]s or [12,17]s or [27,32]s.
I would like to map this QVector from whatever range it is in to the range [-5s, 0s].
Obviously, I can manipulate the x QVector before plotting it, but I would have to do that before every replot, which is actually a lot of processing when I have many points.
I was just wondering if there is a way for QCustomPlot to move the plot into that relative range, regardless of the absolute value of the x axis vectors used.

Thanks.

Hallo Peter,

our questions is not clear to understand for me. If your sensor data always have the same tick on the axis x, then you could use an static init. x vector. Also an calculation of an new x vector every 5 seconds should not an problem.

Where is your problem?

> ...i f there is a way for QCustomPlot to move the plot into that relative range, regardless of the absolute value of the x axis vectors used
There is a way if you wish. You can e.g. create an own x or y axis ticker. For more see to DateTimeDemo https://www.qcustomplot.com/index.php/demos/datedemo