1
votes

I have a dataset with timestamps and values. The timestamp has 6 digit milli seconds. I tried to use this set format x "%H:%M:%.6S" with gnuplot. However, gnuplot cannot recognize this and just groups the values together for each second in the plot:

set format x "%H:%M:%.6S"

The dataset looks like this:

16:28:11.690076 1

16:28:11.690198 12

16:28:11.710519 14

16:28:11.730769 53

16:28:11.770280 18

16:28:11.791748 12

16:28:11.893583 15

The first column is the timestamp and the second column is the value. I want to plot the time on the x axis and the value on the y axis.

Now, gnuplot only gives me a plot up to seconds, but not millisecond. Is there something I should have set?

1

1 Answers

0
votes

To read in time data you must use set timefmt ... to specify the format to use. Here, you must not specify the number of digits to use for the seconds, using %S reads the milliseconds as you specified them.

For the output you can set the number of digits:

set timefmt '%H:%M:%S'
set xdata time
set format x '%H:%M:%.3S'
plot 'test.txt' using 1:2 w lp pt 7 notitle

enter image description here