2013-03-10 156 views
0

我对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".

回答

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。使用.png的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 
} 
+0

非常感谢,这非常有帮助。 – booker378 2013-04-01 15:23:37