Reputation: 11
I have the following data:
2025-02-08 07:12 3.8
2025-02-08 12:15 4.7
2025-02-08 17:30 7
2025-02-08 19:40 6.3
and the following gnuplot snippet:
reset
set title "Glucose level"
set xlabel "Date and time"
set ylabel "Glucose level in blood (mmol)"
set xtics rotate by -45
set grid ytics
set grid xtics
set grid
set term pngcairo size 1500,500
set xdata time
set timefmt '%Y-%m-%d %H:%M'
set format x "%H:%M\n%b,%d"
set xtics 24*60*60
plot data using 1:3 with linespoints
I am expecting to see the horizontal line of glucose level for the date and time from the 1st and 2nd columns, but the generated graph looks like on the picture
Upvotes: 1
Views: 30
Reputation: 15118
I have no idea what went wrong in your case, but the commands and data you show plot correctly for me with any version of gnuplot from 4.6 through to current 6.0. I attach the output from gnuplot 5.2.0
Upvotes: 0