如何根据数据逐步设置背景

时间:2017-10-08 10:51:23

标签: gnuplot background-color

我尝试更多地绘制背景"红色"冒号2中的数字越高。但我没有运气这样做。

set terminal wx size 700,300
set palette defined (0 "white", 1 "red")
set autoscale cbfix
set autoscale xfix
set autoscale yfix
set y2range [0:1]
set y2tics

$data << EOD
1501293600  0   2348.81
1501297200  8   2338.23
1501300800  7   2325.25
1501304400  16  2349.49
1501308000  13  2354.78
1501311600  18  2349.97
1501315200  14  2361.19
1501318800  16  2350.1
1501322400  8   2325.57
1501326000  12  2296.07
1501329600  24  2309.74
1501333200  30  2301.21
1501336800  30  2308.85
1501340400  19  2321.49
1501344000  24  2315.54
1501347600  17  2331.58
1501351200  17  2350.56
1501354800  20  2344.22
1501358400  15  2339.81
1501362000  19  2326.6
1501365600  8   2313.58
1501369200  13  2318.37
EOD

plot '$data' using 1:(1):2 with image axes x1y2, \  # just use 1 (the max y2 value) as y value
     '$data' using 1:3 with lines axes x1y1

1 个答案:

答案 0 :(得分:0)

您可以尝试使用彩色框样式而不是图像样式:

set style fill solid
plot '$data' using 1:(1):2 with boxes linecolor palette axes x1y2, \
     '$data' using 1:3 with lines axes x1y1

结果:

background colored by column