Gnuplot heatmap XYZ

浪尽此生 提交于 2019-12-18 12:44:44

问题


Hey guys I'm trying to do a real heat map like in A true heat map in R, but in GNUPLOT.

My file is like

3 1 2
3 4 3
3 5 5

4 1 7
4 1 2
4 4 3
4 5 2

5 1 3
5 1 2
5 4 3

.
..
....

and I've tried with

plot "file" using 1:2:3 with image

splot "file" using 1:2:3 p3md

etc..

Also I follow this example http://gnuplot.sourceforge.net/demo/heatmaps.html, but nothing.

Can someone shed some light here please?

Thanks


回答1:


set pm3d interpolate 2,2
splot "file"

You can adjust level of interpolation by changing the number or even set it as 0 to tell gnuplot to "guess" it. It is not well documented what interpolation method that gnuplot is using, so be careful.

set pm3d interpolate 0,0
splot "file"

Here's the result without interpolation:

Here's the result with interpolation 2,2:

Here's the result with interpolation 0,0:




回答2:


Use the pm3d option:

set pm3d
splot "file"


来源:https://stackoverflow.com/questions/21663358/gnuplot-heatmap-xyz

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!