gpt4 book ai didi

linux - GNUplot 在日期绘制时抛出错误

转载 作者:太空宇宙 更新时间:2023-11-04 12:02:09 24 4
gpt4 key购买 nike

今天我想用一种自动化的方式来计算特定时间范围内的操作,但是 GNUplot 抛出了这个错误:

"today.p", line 10: x range is invalid

tod​​ay.p 有以下选项:

set datafile separator ","
set autoscale fix
set style data lines
set key outside right center
set timefmt '"%y-%m-%d %H:%M:%S"'
set format x '%H'
set title "Product Key Generation "
set output 'test.png'
set term png
plot 'result.csv' u 1:($1) title "Product Keys" with lines

result.csv 看起来像这样:

productkey,activatedat
ACHIZ-wYMIV-UQaHO-mwabr,"2018-08-22 00:00:01"
NWUBO-cLcTr-L4Ia6-llvyw,"2018-08-22 00:00:01"
VXWGQ-UKHao-kq2j1-avuka,"2018-08-22 00:00:01"
NVVFK-3mz8v-27avd-lztgm,"2018-08-22 00:00:01"
PGSRV-oQ2G3-afGRg-kxzob,"2018-08-22 00:00:01"
BULEL-CU1bE-GWxRf-hucwa,"2018-08-22 00:00:01"
ANKWL-LBW8B-il3tM-zzklf,"2018-08-22 00:00:01"
ZSDVL-tZcdY-YRJJQ-ddctr,"2018-08-22 00:00:01"
ZSQLX-pmAp2-Dp3h9-ejtfu,"2018-08-22 00:00:01"
IWKUL-hFhDs-GPapK-fwgmr,"2018-08-22 00:00:01"
GSYAU-eIUjm-2h4O1-gfmmf,"2018-08-22 00:00:01"
OQTDJ-rXkyz-bt18d-skfvp,"2018-08-22 00:00:01"
EKTMD-uOUbA-XEWtP-gyfac,"2018-08-22 00:00:01"
DCPWO-H98qT-FSdZU-qbbqh,"2018-08-22 00:00:01"
ZXSMC-AsiRf-6zkwv-aidor,"2018-08-22 00:00:01"
OGJLE-NyTxe-HuJK5-dwtty,"2018-08-22 00:00:01"
FZETE-BTTA4-W0I0p-bmxah,"2018-08-22 00:00:01"

我只是想不通这里出了什么问题。谷歌对这个结果一无所知,我对 GNUplot 还很陌生

最佳答案

你需要修正时间格式(多余的引号,错误的年份格式),然后

set timefmt "%Y-%m-%d %H:%M:%S"
plot 'result.csv' using 2:(1.0) smooth frequency with lines

这会为第 2 列中具有相同 x 坐标(时间)的每个条目添加计数 (1.0)。

关于linux - GNUplot 在日期绘制时抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51974882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com