【发布时间】:2016-11-28 15:28:02
【问题描述】:
我想在底部绘制 3D 曲面图与相同函数的热图图(来自 file 数据)(如 Gnuplot Cookbook 中的“将曲面与图像组合”一章)。
等高线图是用script绘制的。
是否可以通过 Gnuplot 在一个图中在极坐标中绘制两个图形(等高线和 3D)?
输出什么都没有,所以代码有错误:
reset
set terminal pngcairo size 800,800 enhanced font 'Verdana,20'
set output '3d-polar_AbsPsiSquared.png'
set lmargin at screen 0.05
set rmargin at screen 0.85
set bmargin at screen 0.1
set tmargin at screen 0.9
set pm3d
unset key
set multiplot
stats '_FullWV.dat' using ($3*$3+$4*$4)
max(a,b) = (a>b) ? a : b
round2(x) = x - floor(x) < 0.5 ? floor(x) : ceil(x)
round(x, n) = round2(x*10**n)*10.0**(-n)
Z_MAX = max(-STATS_min, STATS_max)
Z_MAX = round(Z_MAX,1)
set parametric
set grid xtics ytics
set angles degree
#set zrange[-1,1]
#set cbrange [-1:1]
set autoscale fix
#set autoscale xfix
#set autoscale yfix
set autoscale zfix
#set autoscale
set cbrange [-Z_MAX : Z_MAX]
set palette model RGB defined ( 0"#6495ED", 1"blue", 2"#00008B",3"white",\
4"green",5"yellow",6"red")
#splot '_FullWV.dat' u ($2*cos($1)):($2*sin($1)):($3*$3+$4*$4)
set size ratio -1
set hidden front
set xyplane at -1
splot '_FullWV.dat' u (abs(($3*$3+$4*$4))<1e-3 ? NaN : $2*cos($1)):($2*sin($1)):($3*$3+$4*$4) with pm3d at b, '_FullWV.dat' u (abs(($3*$3+$4*$4))<1e-3 ? NaN : $2*cos($1)):($2*sin($1)):($3*$3+$4*$4) with pm3d
unset multiplot
【问题讨论】:
-
你尝试了什么?
-
@EricDuminil:更新了问题——我刚刚尝试更改现有脚本以在其上添加曲面图,但未生成输出(尽管 Gnuplot 未显示任何错误消息)
-
与其他问题相比,它是另一个
_FullWV.dat文件吗?只有 3 列,您使用$4引用第 4 列 -
你是对的,新文件是here。我用 Total Commander Viewer 看到了一些输出(这几乎是我想要的),但其他查看器没有显示,可能是边距有问题吗?
-
您有较小的数据子集吗?
标签: gnuplot