gnuplot for loop with interval

流过昼夜 提交于 2019-12-20 02:14:18

问题


I have the following gnuplot script that uses a for loop to plot 100 data sets of (x,y) format to one plot. However, the script only plots 2 data sets. Can anybody help? Thank you.

plotfile = "graph.eps"
set output plotfile
filename(n) = sprintf("%d_mod.int", n)
plot for [i = 400000:4000000:400000] filename(i) u 1:2 title sprintf("%d", i) w lp

回答1:


That is a bug, which will be fixed in 4.6.6 and 5.0, see #1429 Erratic behaviour of do for loops .

As a workaround you must iterate over smaller numbers:

plot for [i = 4:40:4] filename(i*100000) u 1:2 title sprintf("%d", i*100000) w lp


来源:https://stackoverflow.com/questions/24282925/gnuplot-for-loop-with-interval

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!