Graphics gnuplot中不同文件数据集的绘图功能

Graphics gnuplot中不同文件数据集的绘图功能,graphics,gnuplot,Graphics,Gnuplot,我有几个具有类似数据的文件,需要使用gnuplot绘制这些文件 举个例子,我用这样的方法来绘制3个文件的第1列和第5列: plot "file1.csv" using 1:5 title 'test 1' with lp, \ "file2.csv" using 1:5 title 'test 2' with lp, \ "file3.csv" using 1:5 title 'test 3' with lp 但是,我不知道如何绘制3个文件中数据的函数。举例来说,我希望在前

我有几个具有类似数据的文件,需要使用gnuplot绘制这些文件

举个例子,我用这样的方法来绘制3个文件的第1列和第5列:

plot "file1.csv" using 1:5 title 'test 1' with lp, \
     "file2.csv" using 1:5 title 'test 2' with lp, \
     "file3.csv" using 1:5 title 'test 3' with lp

但是,我不知道如何绘制3个文件中数据的函数。举例来说,我希望在前面的绘图中包括每个点的3列介质(即函数
f(x1,x2,x3)=(x1(I)+x2(I)+x3(I))/3
,用于第I个数据点)。有可能吗?

这是一个常见的问题,答案是:不是直接从gnuplot内部。但是,您可以调用外部工具为您计算。以下是几个其他答案和示例(您可以在该网站上搜索“gnuplot多个文件”以了解更多…):


另一种可能性是使用Pyxplot plotting包,该包的语法与gnuplot类似,但经过清理。Pyxplot有一个插值命令(请参阅),用于生成函数,这些函数可以对文件中的数据进行插值,例如通过线性插值或样条曲线拟合

然后,您可以执行以下操作,例如:

interpolate linear file1() "file1.csv" using 1:5
interpolate linear file2() "file2.csv" using 1:5
interpolate linear file3() "file3.csv" using 1:5
plot file1(x) + file2(x) + file3(x)
我想这正是你想要的