Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Loops 脚本中包含的打印数据在循环中失败_Loops_Gnuplot - Fatal编程技术网

Loops 脚本中包含的打印数据在循环中失败

Loops 脚本中包含的打印数据在循环中失败,loops,gnuplot,Loops,Gnuplot,我想绘制脚本文件中包含的数据点。 应多次执行此操作(打印到不同的文件)。 因此,我使用do for循环 这个循环让我们停止执行。 你能告诉我原因吗 这是我的MWE: reset set autoscale do for [index=1:1] { plot "-" with lines ls 2 notitle 0.500 5 1.000 6 1.500 7 e } 是的,似乎不支持将do for与内联数据相结合。这也不是很方便,因为这将需要一个单独的数据块用于像中一样的每次迭代 set s

我想绘制脚本文件中包含的数据点。 应多次执行此操作(打印到不同的文件)。 因此,我使用do for循环

这个循环让我们停止执行。 你能告诉我原因吗

这是我的MWE:

reset
set autoscale

do for [index=1:1] {
plot "-" with lines ls 2 notitle
0.500 5
1.000 6
1.500 7
e
}

是的,似乎不支持将
do for
与内联数据相结合。这也不是很方便,因为这将需要一个单独的数据块用于像中一样的每次迭代

set style data linespoints
plot '-' using 1:2, '-' using 1:3
1 2 3
4 5 6
e
1 2 3
4 5 6
e
5.0版引入了允许重用内联数据的内联数据块:

$data <<EOD
1 2 3
4 5 6
EOD
do for [i=2:3] {
    plot $data using 1:i w l
    pause -1
}
$数据相关:。因为我没有v4.6,但可能是内联数据在循环中不受支持,所以请尝试将数据放在单独的文件中。