体积中的点热图

时间:2018-11-26 15:51:46

标签: gnuplot

我有(x,y,z)个点,其坐标如下图所示,

enter image description here

我想根据点的浓度为点着色。 想法是制作点的热图,但以3D图形形式。

我将不胜感激。

致谢。

2 个答案:

答案 0 :(得分:1)

使用第4列中的数据值为平滑的调色板编制索引

splot DATA using 1:2:3:4 with points lc palette

答案 1 :(得分:0)

gnuplot开发版本现在支持点密度函数的计算,该函数又可以用于为单个点着色。这取决于在3D体素网格上运行的一组新命令。示例脚本和输出:

set title "Gaussian 3D cloud of 3000 random samples\ncolored by local point density"
rlow = -4.0; rhigh = 4.0
set xrange [rlow:rhigh]; set yrange [rlow:rhigh]; set zrange [rlow:rhigh]
set xtics axis nomirror; set ytics axis nomirror; set ztics axis nomirror;
set xyplane at 0
set xzeroaxis lt -1; set yzeroaxis lt -1; set zzeroaxis lt -1;
set log cb; set cblabel "point density"

# define 100 x 100 x 100 voxel grid
set vgrid $vdensity size 100
vclear $vdensity    

# datablock $random has previously been loaded with 3000 points
# in a spherical Gaussian distribution about the origin
# The vfill command adds 1 to each voxel in a spherical region with radius 0.33
# around each point in $random
vfill $random using 1:2:3:(0.33):(1.0)

# plot the same points colored by local point density
splot $random using 1:2:3:(voxel($1,$2,$3)) with points pt 7 ps 0.5 lc palette

enter image description here

此处的完整演示:voxel demo in gnuplot online collection