Plotting with gnuplot from several files

谁说胖子不能爱 提交于 2020-01-06 21:10:03

问题


I have several files called data_x.dat, where x ranges from 1 to 10. I'm looking for something in gnuplot that would allow me to directly plot the second column agains the first one of all of the files in the same graph, instead of doing

p "data_1.dat" u 1:2, "data_2.dat" u 1:2, ..., "data_10.dat" u 1:2

which is slow to type. Something like:

p "data_*" u 1:2

is what I'm looking for. Does it exist for gnuplot?.

Thank you.


回答1:


Use inline iterations:

plot for [i=1:10] sprintf("data_%d.dat", i) u 1:2


来源:https://stackoverflow.com/questions/29716111/plotting-with-gnuplot-from-several-files

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