gnuplot读取循环数据,同时也获取循环数据(在一个脚本中冲突两个循环并重新读取)

时间:2019-01-28 11:55:17

标签: bash gnuplot livegraph

我有一个bash脚本代码,该脚本代码获取用于绘图(循环)的数据。我想绘制图形,并使用每个新值更新图形(重新读取),然后返回主脚本以获取新数据,然后再用于绘制。

bash脚本获取数据x和y
绘制x和y
返回bash脚本以获取x和y的新值
用x和y的新值重新读取图
返回bash脚本以获取x和y的新值
等...


注释: xy值存储在test.dat文件中,并使用该文件进行绘制

gnuplot  <<- EOF
set xdata time
set timefmt "%H:%M:%S"
set format x "%H:%M"
set xlabel "Time in Minutes"
set xlabel font 'Arial Bold ,13'
set ylabel "Bandwidth in Megabyte "
set ylabel font 'Arial Bold ,13'
set yrange [0:*]
set title "Press 'e' to exit then close normally"
set title font 'Arial Bold , 16 , textcolor linespec 3'
set grid
set style fill transparent solid 0.5 noborder
set style data lines
bind all "e" "unset output ; exit ./fftest.sh"
plot "test.dat" using 1:2 title "Download" w filledcurves x1 linestyle 6 lc "green" , \ "" using 1:3 title "Upload" w filledcurves x1 linestyle 10 lc "blue" 
EOF

0 个答案:

没有答案