Gnuplot:如何 "stretch" 沿 splot 的第 3 个维度的多个文件?

Gnuplot: How to "stretch" multiple files along the 3rd dimension in splot?

我想使用 splots 在 gnuplot 中比较九个数据集。每个文件都在一个子目录中,对应于一个不同的参数。我有一个 list 的文件名,所以像 plot for [file in list] file u 1:5 这样的东西很好用。但是,我希望能够通过以某种方式将这些文件沿 splot 中的第三轴拉伸出来,从而从中绘制围栏图。

如何执行类似 splot for [file in list] file u 1:5:<LIST OF VALUES> 的操作,其中 <LIST OF VALUES> 是参数列表,这些参数不会出现在数据文件本身中,但必须手动输入?显式列表是 {0.25,0.5,1,5,10,15,20,25,30}

作为解决方法,您可以遍历整数索引并从字符串变量中提取相应的文件名和 z-index:

#as a minimal example, plot the value of the "z-index"
#and use the file name as key label

fileList="file1.dat file2.dat"
valsList="0.1 0.2"

plot for [i=1:words(fileList)] real(word(valsList, i)) t word(fileList, i)

在较新版本的 Gnuplot 中,这可以用数组来简化。