gnuplot 使用循环处理多个文件

gnuplot with muliple files using loop

我有一些文件,顺序如下:

file_001.txt, file_002.txt, file_003_txt,
file_021.txt, file_023.txt, file_023.txt,
file_041.txt, file_042.txt, file_043.txt,
file_061.txt, file_062.txt, file_063.txt,
file_081.txt, file_082.txt, file_083.txt,
file_101.txt, file_102.txt, file_103.txt

我想使用循环在 gnuplot 中绘制每个文件。我无法循环。但是我的以下脚本正在运行并且看起来很长。

 plot,\
 for [i=1:3] 'file_00'$i'.txt' u 1:2,\
 for [i=1:3] 'file_02'$i'.txt' u 1:2,\
 for [i=1:3] 'file_04'$i'.txt' u 1:2,\
 for [i=1:3] 'file_06'$i'.txt' u 1:2,\
 and so on

我怎样才能以任何其他有效的方式制作循环?

您可以使用嵌入式循环:

plot for [j=0:10:2] for [i=1:3] 'file0'.j.i.'.dat' u 1:2;

#for [<var> = <start> : <end> {: <incr>}]