如何使用 GnuPlot 创建大小为 d 的液滴与高度的关系图,并按大小为液滴着色?
How to use GnuPlot to create a plot of droplets of size d versus height and color the droplets by size?
我有一个 x,y,z,d 的文件,其中 x,y,z 是液滴的坐标,液滴的直径是 d。
我想对液滴的 x、z 位置进行 GnuPlot 绘制,并根据从最小 d 到最大 d 缩放的 RGB 光谱的直径为其着色。
我试过用这个:
unset hidden3d
set ticslevel 0.5
set view 60,30
set autoscale
set parametric
set style data points
set xlabel "data style point - no dgrid"
set key box
set output 'particles.png'
plot '/directory/kinematicCloud_00000490.dat' \
using 1:3:(0.5-rand(0)):(5.*rand(0)) with points pt 5 ps var lc rgb variable
pause -1
但是,这里的点是用随机颜色着色的。我希望它们像我上面所说的那样着色。那么,如何指定第 3 个和第 4 个参数来执行我希望的操作?
# Set palette to RGB spectrum (Red = Min; Blue = Max)
set palette model HSV defined (0 0 1 1, 1 0.7 1 1)
# Set min/max of color spectrum to match expected droplet size
set cbrange [0 : MAX]
# 3D plot with points colored by diameter
splot 'data' using 1:2:3:4 with points pointtype 7 lc palette
如果您想放弃 y 坐标并改为制作二维绘图,则命令变为
# 2D plot x/z with points colored by diameter
set view map
splot 'data' using 1:3:(0):4 with points pointtype 7 lc palette
我有一个 x,y,z,d 的文件,其中 x,y,z 是液滴的坐标,液滴的直径是 d。
我想对液滴的 x、z 位置进行 GnuPlot 绘制,并根据从最小 d 到最大 d 缩放的 RGB 光谱的直径为其着色。
我试过用这个:
unset hidden3d
set ticslevel 0.5
set view 60,30
set autoscale
set parametric
set style data points
set xlabel "data style point - no dgrid"
set key box
set output 'particles.png'
plot '/directory/kinematicCloud_00000490.dat' \
using 1:3:(0.5-rand(0)):(5.*rand(0)) with points pt 5 ps var lc rgb variable
pause -1
但是,这里的点是用随机颜色着色的。我希望它们像我上面所说的那样着色。那么,如何指定第 3 个和第 4 个参数来执行我希望的操作?
# Set palette to RGB spectrum (Red = Min; Blue = Max)
set palette model HSV defined (0 0 1 1, 1 0.7 1 1)
# Set min/max of color spectrum to match expected droplet size
set cbrange [0 : MAX]
# 3D plot with points colored by diameter
splot 'data' using 1:2:3:4 with points pointtype 7 lc palette
如果您想放弃 y 坐标并改为制作二维绘图,则命令变为
# 2D plot x/z with points colored by diameter
set view map
splot 'data' using 1:3:(0):4 with points pointtype 7 lc palette