【发布时间】:2013-07-06 18:34:36
【问题描述】:
我想创建一个包含三个绘图的 gnuplot。 数据应该是内联的(我只想
应该是这样的:
目前我正在使用以下 gnuplot 脚本来创建绘图:
set terminal png
set output "test.png"
plot for[col=2:4] "data.txt" using 1:col title columnheader(col) with lines
文件data.txt是:
Generation Best Worst Average
0 2 1 0
1 3 1 2
2 4 3 3
3 4 3 3
4 6 3 4
5 7 4 5
6 9 6 7
7 10 6 9
8 10 5 6
9 11 6 8
10 12 7 9
我想将 data.txt 通过管道传输到 gnuplot 中,而不是依赖脚本中引用的数据文件。
像cat data.txt | gnuplot plot.gnu 这样的东西。
原因是,我有几个 data.txt 文件,不想为每个文件构建一个 plot.gnu 文件。
我读到了特殊的'-' 文件in this stackoverflow thread 和我读到了multiple plots in one file。但是,这需要将数据包含在不干净的 gnuplot 代码中。
【问题讨论】:
-
可以打赌,你用基于人口的算法解决了一些优化问题;)
标签: gnuplot