gnuplot 在同一图表中绘制多个图
gnuplot drawing multiple plots in same chart
我正在尝试按照在此处找到的 gnuplot 上绘制财务数据的指南进行操作:
http://gnuplot.sourceforge.net/demo/finance.html
我生成了一些数据并尝试使用以下脚本绘图:
1 set datafile separator ","
2 set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"#cccccc" behind
3
4 set xdata time
5 set timefmt "%Y-%M-%dT%H:%M:%S"
6 set format x "%d-%H"
7
8 set ylabel "Price"
9 set xlabel 'Time'
10
11 set style line 100 lt 1 lc rgb "grey" lw 0.5
12 set style line 101 lt 1 lc rgb "orange" lw 1
13
14 set grid ls 100
15 set key off
16
17 plot "lastrun.dat" using 1:2 with lines, '' using 1:3 with lines ls 101, '' using 1:4 with lines ls 101
但是生成的图表似乎没有正确地将数据拼接在一起,所以我没有一张图表,而是三个相同的图表 space。
我确定我犯了一个简单的错误,但我一直对那是什么感到困惑。
检查help time_specifiers
:
%d day of the month, 01–31
%H hour, 00–23 (always two digits)
%m month, 01–12
%M minute, 0–60
%S second, integer 0–60 on output, (double) on input
%Y year, 4-digit
我正在尝试按照在此处找到的 gnuplot 上绘制财务数据的指南进行操作:
http://gnuplot.sourceforge.net/demo/finance.html
我生成了一些数据并尝试使用以下脚本绘图:
1 set datafile separator ","
2 set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"#cccccc" behind
3
4 set xdata time
5 set timefmt "%Y-%M-%dT%H:%M:%S"
6 set format x "%d-%H"
7
8 set ylabel "Price"
9 set xlabel 'Time'
10
11 set style line 100 lt 1 lc rgb "grey" lw 0.5
12 set style line 101 lt 1 lc rgb "orange" lw 1
13
14 set grid ls 100
15 set key off
16
17 plot "lastrun.dat" using 1:2 with lines, '' using 1:3 with lines ls 101, '' using 1:4 with lines ls 101
但是生成的图表似乎没有正确地将数据拼接在一起,所以我没有一张图表,而是三个相同的图表 space。
我确定我犯了一个简单的错误,但我一直对那是什么感到困惑。
检查help time_specifiers
:
%d day of the month, 01–31 %H hour, 00–23 (always two digits) %m month, 01–12 %M minute, 0–60 %S second, integer 0–60 on output, (double) on input %Y year, 4-digit