admin管理员组

文章数量:1123160

I have a table that I want to plot with gnuplot. The first "x" column is the timestamp is seconds since Epoch. I want the xtics to show only the hours, skipping 3. That is:

... 9 12 15 18 ...

So I set this:

set xdata time
set format x "%k"
set xtics 3600,10800

It works, but the problem is that the hours are given in UTC time, while I heed to apply the local time (shifted -2 hours). Hence, instead of

... 9 12 15 18 ...

I need

... 7 10 13 16 ...

at the corresponding places.

Is there a way to apply a formula to the xtics without affecting the funcion? Of course I could simply apply an offset to the first column of the data substracting 3 hours, but I don´t want to do that.

I have a table that I want to plot with gnuplot. The first "x" column is the timestamp is seconds since Epoch. I want the xtics to show only the hours, skipping 3. That is:

... 9 12 15 18 ...

So I set this:

set xdata time
set format x "%k"
set xtics 3600,10800

It works, but the problem is that the hours are given in UTC time, while I heed to apply the local time (shifted -2 hours). Hence, instead of

... 9 12 15 18 ...

I need

... 7 10 13 16 ...

at the corresponding places.

Is there a way to apply a formula to the xtics without affecting the funcion? Of course I could simply apply an offset to the first column of the data substracting 3 hours, but I don´t want to do that.

Share Improve this question asked 5 hours ago Luis A. FloritLuis A. Florit 2,5793 gold badges37 silver badges66 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You don't provide original data, but simply shift your data by -2 hours.

plot FILE u ($1-2*3600):2   # or whatever column you need to plot

本文标签: linuxHow to shift the xtics values in gnuplotStack Overflow