绘制多个矩阵gnuplot

时间:2013-03-10 14:37:53

标签: animation matrix gnuplot

我对gnuplot相当新,我试图看看我的数组如何随着程序的迭代而变化,我希望能够制作数据动画。

以下是我的数据:

'q = 0的'

1 0 0 

0 1 1

1 1 0 

'Q = 1'

1 0 0  
0 1 1  
0 1 0  

等等。

我尝试使用:使用图片绘制"matrix.dat"索引0矩阵,只是为了绘制第一个矩阵,但我得到"Warning matrix contains missing or undefined values, Matrix does not represent a grid".

1 个答案:

答案 0 :(得分:0)

我认为问题可能是评论行。当我使用此版本的数据文件时

1 0 0
0 1 1
1 1 0

1 0 0 
0 1 1 
0 1 0

使用index进行绘图。要制作动画,您可以创建一系列.png文件和stitch them together with another application。制作.pngs的gnuplot代码的一个例子是:

set terminal png
do for [i=0:100] {
    set output sprintf('matrix%03.0f.png',i)
    plot 'data.dat' index i matrix with image
}