I'm a bit confused to use timefmt function due to ouput warning "Bad time format in string"
To bring some details, I would like to print out the output values from an ADC of a microcontroller. Values a logged with timestamp (without date like year-month-day). I made a script that fit data with timestamp to a csv file.
My input file is a csv file with this kind of values:
unset key
set datafile separator ";"
set key autotitle columnhead
set style data linespoints
set key top
set key box opaque
set terminal png size 1000,400 enhanced font 'Helvetica,10'
set output "./RESULTS/IMAGES/Sinus.png"
set size 1,1
set origin 0,0
set key on outside noopaque font "Courriel,8"
set tics font "Courriel,8"
set title "ADC Output Signal" font ",10"
set ylabel 'Measured ADC Signal (mV)'
set xlabel 'Time (sec)'
set autoscale y
set xdata time
set timefmt "%H:%M:%.3S"
set format x "%M:%.3S"
plot "SinusWaveFile.csv" using 1:2 with lines title "Channel 1"
I get warning from last line "warning: Bad time format in string"
It is important to have a precision of a millisecond because ADC measurement is made every 5 milliseconds. It seems it takes only one value each second. I thought if I specify "%.3S" in time format it should take each value.
I cannot get the correct graph, could you please help me to fix this issue?
I assume something is missing but I cannot find what is it...
Even if seconds have a precision of a millisecond, this is for the axis format that you have to specify the precision that you want. In my case this is:
set format x "%M:%.3S"
Hope it could help someone!
Louis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everybody!
I'm a bit confused to use timefmt function due to ouput warning "Bad time format in string"
To bring some details, I would like to print out the output values from an ADC of a microcontroller. Values a logged with timestamp (without date like year-month-day). I made a script that fit data with timestamp to a csv file.
My input file is a csv file with this kind of values:
The GNUPlot script is the following:
I get warning from last line "warning: Bad time format in string"
It is important to have a precision of a millisecond because ADC measurement is made every 5 milliseconds. It seems it takes only one value each second. I thought if I specify "%.3S" in time format it should take each value.
I cannot get the correct graph, could you please help me to fix this issue?
I assume something is missing but I cannot find what is it...
Thank you in advance,
Best regards,
Louis
Last edit: Louis Fournier 2021-11-10
Sorry for spamming, finally I fixed my issue!
The correct use of timefmt is :
Even if seconds have a precision of a millisecond, this is for the axis format that you have to specify the precision that you want. In my case this is:
Hope it could help someone!
Louis