2017-07-19 84 views
0

gnuplot很新。gnuplot 2d热图基本格式

数据:系统中有5个粒子。我在不同的时间点追踪他们之间的距离。想要生成它们邻近的热图。 http://gnuplot.sourceforge.net/demo/heatmaps.html表示只有X Y Z或Z值。我不明白什么X和Y和Z的位置:

5 4 3 1 0 First column:x ? Second column y? and various z values in column 
2 2 0 0 1 3,4,5 ...? 
0 0 0 1 0 
0 0 0 2 3 
0 1 2 4 3 

对于我的研究,我有一个矩阵(为一组)

(particle)--->1 2  3  4  5 
    | 
    1   0 1.2 2.4 7.5 3.4 
    2  1.2 0  4  8.9 3 
    3  2.4 4  0  2  8 
    4  7.5 8.9 2  0  6 
    5  3.4 3  8  6  0 
(next set) 
------------similar to above 

等等.....

我很困惑什么应该是我的ASCII数据的格式? 在此先感谢您的帮助。

回答

0

热图通常用于可视化两个变量x和y的函数,其中x和y是轴。

所以你解释它的方式是正确的,但matrix with image样式实际上会颠倒这些点,因为它开始在(0,0)处打印,然后在正坐标方向上添加元素。 所以,如果你的文件(让我们称之为它data.dat)看起来是这样的:

0 1.2 2.4 7.5 3.4 
1.2 0  4  8.9 3 
2.4 4  0  2  8 
7.5 8.9 2  0  6 
3.4 3  8  6  0 

你可以得到这样一个情节:

YourPlot

通过调用plot "<tail -r data.dat" matrix w ima