GIF动画中的Gnuplot [英] Gif Animation in Gnuplot
问题描述
我具有由两条线分隔的数据文件。数据的每个部分是〜50行。我试图做一个.gif文件。我知道如何单独或一组绘制他们,但不能得到.gif若要工作。
I have a data file separated by two lines. Each section of data is ~50 lines. I'm trying to make a .gif file. I know how to plot them individually or in a group but can't get the .gif to work.
我的问题是类似的在他的YouTube频道,以一个制定格伦麦克拉克伦,第5部分。相反,1分,我对每个数据段〜50个数据点。他利用$索引功能解决了这个问题,我试图做同样的,但煤矿不能正常工作。
My problem is similar to the one worked out by Glen MacLachlan in his youtube channel, part 5. Instead of 1 point, I have ~50 data points for each data section. He solves the problem by utilizing $index feature, and I tried to do the same but mine doesn't work.
我在想什么?难道我真的要分开绘制数据为.png文件,并将它们组合在一起来获得.gif文件?
What am I missing? Do I really have to plot the data separately into .png files and group them together to get .gif file?
我所做:::
我编辑的数据文件。 previously有两列x和y。现在,我有他们在第二和第三列,第一列是从0到50的索引数据中的每块具有类似的索引
I edited the data file. Previously there were two columns x, and y. Now, I have them in 2nd and 3rd column, and the first column is index from 0 to 50. Each block of data has similar index.
bash脚本来创建绘图文件
bash script to create plot file
for ((i=0;i < 50; i++)) do echo "plot 'data.txt'
u 2:3 w circles index $i"; done >>simulate.plt
这只是绘制所有数据点
It just plots ALL the data points
推荐答案
为什么不告诉你,你已经尝试了什么?
Why don't you show what you have tried?
以下罚款应该工作:
set terminal gif animate delay 100
set output 'foobar.gif'
stats 'datafile' nooutput
set xrange [-0.5:1.5]
set yrange [-0.5:5.5]
do for [i=1:int(STATS_blocks)] {
plot 'datafile' index (i-1) with circles
}
在文件数据文件
:
0
1
2
3
4
5
给
这篇关于GIF动画中的Gnuplot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!