使用gnuplot将多个文件绘制到不同页面中的单个ps文件

时间:2015-11-05 14:58:33

标签: shell plot gnuplot postscript

我有文件夹10,11,12,... 50。 在所有文件夹中,我都有数据文件" data.dat"。 我想将所有这些文件中的数据绘制到单个ps文件中。每个文件都有自己的页面。像:

  

plot" 10 / data.dat"你1:3 w l," 10 / data.dat"你1:4 w l," 10 / data.dat"   你1:5 w l

     

plot" 11 / data.dat"你1:3 w l," 11 / data.dat"你1:4 w l," 11 / data.dat"   你1:5 w l

     

.....

     

plot" 50 / data.dat"你1:3 w l," 50 / data.dat"你1:4 w l," 50 / data.dat"   你1:5 w l

因此每个文件都有自己的页面,ps文件将有41页。 如何在gnuplot中使用某种循环结构来做到这一点?或者我应该如何使用shell脚本?

1 个答案:

答案 0 :(得分:2)

您应该使用do for,因为plot for会在一个页面中绘制所有这些内容。

do for [i=10:41] {
    set title "Plot ".i
    plot "".i."/data.dat" u 1:3 w l, "" u 1:4 w l, "" u 1:5 w l
}