Charts 如何使用gnuplot中的列来分隔绘图

Charts 如何使用gnuplot中的列来分隔绘图,charts,gnuplot,Charts,Gnuplot,我有以下数据来绘制在特定时间戳运行任务的CPU使用率 cpu timestamp load taskId 0 0 1.0 0 1 0 1.0 0 0 0 0.5 1 1 0 0.5 1 0 65 0.5 0 1 65 0.5 0 0 20094 0.0 0 1 20094 0.0 0 0 40042 0.0 1 1 40042 0.0 1 这就是我使用gnuplot创建绘图的方法: set key autotitle columnheader set xtics rotate #set xra

我有以下数据来绘制在特定时间戳运行任务的CPU使用率

cpu timestamp load taskId
0 0 1.0 0
1 0 1.0 0
0 0 0.5 1
1 0 0.5 1
0 65 0.5 0
1 65 0.5 0
0 20094 0.0 0
1 20094 0.0 0
0 40042 0.0 1
1 40042 0.0 1
这就是我使用gnuplot创建绘图的方法:

set key autotitle columnheader
set xtics rotate
#set xrange [-0.5:100000]
set ylabel "CPU Load"
set xlabel "Time"
set key right
set grid y x
#set yrange [-0.05:1.01]
plot 'test.dat' using (column(2)):3 with linespoints
pause -1 "Hit return to continue"
结果是:

但是,我想使用第四列为任务ID绘制两行,每行一行。结果应该是:

如何修复图形?如果我也能用第一列绘制两张图,那就更好了

set datafile missing NaN
set offset graph 0.05, graph 0.05
set ylabel "CPU Load"
set xlabel "Time"
set key outside right
set grid y x
set xtics rotate
set style data linespoints
set autoscale noextend
set border back

set multiplot layout 2,1
do for [i=0:1] {
    set title sprintf("CPU %d", i)
    plot 'data' using (column(1) == i ? column(2) : NaN) : 3 title "Task 0" pt 7 lw 2, \
         'data' using (column(1) == i ? column(2) : NaN) : 4 title "Task 1" pt 7 lw 2
}
unset multiplot