最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

gnuplot: time range is shown incorrectly - Stack Overflow

programmeradmin2浏览0评论

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
  • Was the graph generated with this data you've shown? How does the graph look like if you skip the line set xtics 24*60*60? Which gnuplot version are you using? – theozh Commented Feb 15 at 21:18
  • please, show the command line used and OS , tks – ticktalk Commented Feb 15 at 22:09
Add a comment  | 

1 Answer 1

Reset to default 0

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

发布评论

评论列表(0)

  1. 暂无评论