0

I have a pure 1D list of any sample values and want to plot the time curve of them. How do I scale the x axis to secs, knowing the time interval and total duration? I have

set xdata time
set timefmt "%s"
set trange [0 : 3.5]
plot 'some.dat' using ??? with lines

What is missing? How are the parameters for using? Thanks in advance.

anatom13
  • 1
  • 3

1 Answers1

0

I'm not sure, if I got your question right. Assuming you have a single column in your data file and two samples are taken at a constant time difference you can plot it with:

# time interval
dt = 0.1
# time range in seconds
set xrange [0:10]
plot 'some.dat' using ($0 * dt):1 with lines

$0 is the row number which is then scaled by the time interval dt. There is no need to use set xdata time if you want to display only seconds.

Christoph
  • 47,569
  • 8
  • 87
  • 187