我在格式
中有一个数据文件 cpuTemp.txt09:16;314
09:19;314
并希望使用此脚本绘制此图:
#!/usr/bin/gnuplot
set datafile sep ';' # seperator ;
set terminal png #output format of graph
set term pngcairo size 300,300 #resolution
set output "temp.png" #name of output file
set title "Temperature over Time" #title of graph
set xlabel "time" #horizontal axis name
set ylabel "celsius * 10" #vertical axis name
set timefmt "%H:%M" #format of time is source file cpuTemp.txt
set yrange [0:600] #vertical axis range (optional line)
set xdata time #x axis is not numbers, but dates/times
set format x "%H:%M" #format of time labels in axis label
set grid xtics lc rgb "#888888" lw 1 lt 0 #grey grid on background
set grid ytics lc rgb "#888888" lw 1 lt 0 #grey grid on background
plot "cpuTemp.txt" u 1:3 title "temperature" w lines lc rgb '#8b1a0e' lt 1 lw 2
现在执行时我得到了警告和这个我无法弄清楚的错误:
me@box:~ $ ./tempPlotter.sh
"./tempPlotter.sh", line 15: warning: Skipping data file with no valid points
plot "cpuTemp.txt" using 1:3 title "temperature" with lines lc rgb '#8b1a0e' lt 1 lw 2
^
"./tempPlotter.sh", line 15: x range is invalid
提前致谢, Gewure