我正在 gnuplot 中将一些财务数据绘制为烛台。数据示例:
2022-04-20T00:01:00 1.07907 1.07901 1.07916 1.07907
2022-04-20T00:02:00 1.07906 1.079 1.07908 1.07907
2022-04-20T00:03:00 1.07906 1.07898 1.07909 1.07905
2022-04-20T00:04:00 1.07906 1.07889 1.07906 1.07895
2022-04-20T00:05:00 1.07892 1.07889 1.07901 1.07895
2022-04-20T00:06:00 1.07894 1.07887 1.07894 1.07891
2022-04-20T00:07:00 1.07892 1.07887 1.07895 1.0789
2022-04-20T00:08:00 1.07892 1.07889 1.07904 1.07902
2022-04-20T00:09:00 1.07903 1.07901 1.07909 1.07903
2022-04-20T00:10:00 1.07904 1.079 1.07912 1.07903
2022-04-20T00:11:00 1.07902 1.079 1.07903 1.07902
2022-04-20T00:12:00 1.07903 1.07899 1.07905 1.07901
2022-04-20T00:13:00 1.07903 1.07899 1.07905 1.07902
2022-04-20T00:14:00 1.07901 1.07891 1.07905 1.07895
2022-04-20T00:15:00 1.07893 1.07886 1.07898 1.07887
2022-04-20T00:16:00 1.07888 1.07887 1.07898 1.07893
2022-04-20T00:17:00 1.07892 1.07892 1.07904 1.07901
2022-04-20T00:18:00 1.07902 1.079 1.07905 1.07902
对于绘图,我使用这个脚本:
set mxtics 10
set mytics 10
set grid mxtics mytics
set xdata time
set timefmt "%Y-%m-%dT%H:%M:%S"
set format x "%H:%M:%S"
plot filename using 1:2:3:4:5 with candlesticks
pause mouse close
我按如下方式执行 gnuplot:
gnuplot -e "filename='/tmp/dat'" gnuplot_script.dat
除了状态栏之外,这效果很好:
对于时间/日期,状态栏仅显示 unix 时间戳的科学记数法(我猜)。但是,我希望能够在图中移动鼠标光标时读取具体时间。可以改变格式吗?
答案1
我想知道是否set mouse mouseformat 3
会有所帮助,基于现已删除的用户的这篇 Reddit 帖子:https://www.reddit.com/r/gnuplot/comments/jjp2nk/comment/gaf9pid/?utm_source=share&utm_medium=web2x&context=3。