1

我有一个要绘制的表格文件,文件中的每一列对应一条曲线

例如,文件 1

N plot1 plot2 plot3

1 2     3     4
2 3     4     5

我按以下方式运行 gnuplot

gnuplot -e "set key autotitle columnhead; set title 'file1'; plot 'file1' using 1:2 with lines, 'file1' using 1:3 with lines, 'file1' using 1:4 with lines"

问题是如果我有很多曲线要绘制,我有很多列我需要在命令中为 gnuplot 描述它们,但是我认为用第一列绘制每个列文件是非常标准的,比如1:2 1:3 1:4

我可以在不列出所有列的情况下以更方便的方式进行操作吗?

4

1 回答 1

1

这可以使用 forloop 来完成,例如

plot for [i=2:4] "file" using 1:i

您需要至少 4.4 的 Gnuplot 版本才能使用此功能。

于 2013-12-22T16:35:13.240 回答