2013-03-10 119 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