我在一份文本档案中提供了一些数据(fre.24.val)。 该数据的格式如下:
文本档案有1440个浏览点,每排24小时。
第一行时间为24小时。 最后一行是1米前。
第1栏是HHH:MM格式,第二栏是与时间相对应的温度,第三栏是相当于24小时前的温度。
head fre.24.val -n1
produced:
18:52 -16.4 -17.3
tail fre.24.val -n1
produced:
18:52 -17.0 -16.6
这表明,档案格式正确,这是我想要绘制图表的顺序。
当我用以下地块绘制地图时,该图的运行时间是午夜到午夜。
set title "" textcolor rgb "#995be0"
set xlabel "" textcolor rgb "#995be0"
set ylabel "" textcolor rgb "#995be0"
set grid
set term png transparent truecolor size 392, 200
set output "/var/www/html/img/freday.png"
set border lw 0
# Set the time format for the x-axis
set xdata time
set timefmt "%H:%M"
set format x "%l%p"
# Specify the line color and width
set style line 1 lc rgb "#995be0" lw 2
set style line 2 lc rgb "#cc995be0" lw 2
# Specify the x-axis tick interval to 10 minutes
set xtics "00:00", 14400
set xtics textcolor rgb "#995be0"
# Specify the number of items on the y-axis
set ytics 1 textcolor rgb "#995be0"
# Remove the key (legend)
unset key
plot "fre.24.val" using 1:2 smooth csplines with lines ls 1,
"" using 1:3 smooth csplines with lines ls 2
我利用以下阴谋:
set title "" textcolor rgb "#995be0"
set xlabel "" textcolor rgb "#995be0"
set ylabel "" textcolor rgb "#995be0"
set grid
set term png transparent truecolor size 392, 200
set output "/var/www/html/img/freday.png"
set border lw 0
# Set the time format for the x-axis
set xdata time
set timefmt "%H:%M"
set format x "%l%p"
# Specify the line color and width
set style line 1 lc rgb "#995be0" lw 2
set style line 2 lc rgb "#cc995be0" lw 2
# Specify the x-axis tick interval to 10 minutes
set xtics "00:00", 14400
set xtics textcolor rgb "#995be0"
# Specify the number of items on the y-axis
set ytics 1 textcolor rgb "#995be0"
# Remove the key (legend)
unset key
# Set the x-axis range from -24 hours to current time
start_time = time(0) - 24*60*60
end_time = time(0)
set xrange [start_time:end_time]
plot "fre.24.val" using 1:2 smooth csplines with lines ls 1,
using 1:3 smooth csplines with lines ls 2
但这会造成错误:
plot "fre.24.val" using 1:2 smooth csplines with lines ls 1, using 1:3 smooth csplines with lines ls 2
^
"fre.24.plot" line 34: all points y value undefined!
我做了什么错误?