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
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
Share Improve this question asked Feb 15 at 21:11 user11672821user11672821 111 bronze badge New contributor user11672821 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 2 |1 Answer
Reset to default 0I 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
set xtics 24*60*60
? Which gnuplot version are you using? – theozh Commented Feb 15 at 21:18