gnuplot-如何缩放xyrange以不考虑热图图中的小z [英] Gnuplot - how to scale xyrange to not take into account small z in heatmap plot
问题描述
我有一个数据文件 _FullWV.dat ,我希望Gnuplot能够如果在所需区域z <z,则自动缩放xyrange. 10 ^(-8),有什么办法吗?
I have a data file _FullWV.dat and I want Gnuplot to automatically scale xyrange if outside the wanted region z < 10^(-8), is there any way to make it?
图是此处.
使用过的脚本在下面:
reset
set terminal pngcairo size 800,800
set output '3d-polar.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 map
unset key
set multiplot
stats '_FullWV.dat' using 3
max(a,b) = (a>b) ? a : b
Z_MAX = max(-STATS_min, STATS_max)
set parametric
set grid xtics ytics
set angles degree
set autoscale xfix
set autoscale yfix
#set zrange [-Z_MAX : Z_MAX]
set cbrange [-Z_MAX : Z_MAX]
set palette model RGB defined ( 0"black", 1"white", 2"grey")
splot '_FullWV.dat' u ($2*cos($1)):($2*sin($1)):3
unset multiplot
推荐答案
代码
set size ratio -1
splot '_FullWV.dat' u (abs($3)<1e-5 ? NaN : $2*cos($1)):($2*sin($1)):3
1e-8太小了,它几乎没有超出原始范围.
1e-8 was too small, it cut almost nothing from the original range.
abs($3)<1e-5 ? NaN : $2*cos($1)
如果z(第3列)在-1e-5和1e-5之间,请将x保留为undefined(非数字).如果未定义x,则即使定义了y和z,也不会显示任何点.
If z (3rd column) is between -1e-5 and 1e-5, leave x undefined (Not a Number). If x is undefined, no point will be displayed, even if y and z are defined.
如果z超出此范围,则将x定义为$2*cos($1)
.
If z is outside this range, define x as $2*cos($1)
.
请注意,对于pm3d,至少需要2个连续的值才能显示一个点.这意味着自动缩放会考虑1个单独的值,但不会显示.
Note that for pm3d, at least 2 consecutive values are needed for a point to be displayed. It means that 1 lone value will be take into account by autoscale, but will not be displayed.
set size ratio -1
表示x比例尺上的一个单位将与y比例尺上的一个单位一样大:否则,圆形可能显示为椭圆.
means that one unit on the x scale will be as big as one unit on the y scale : a circle might be displayed as an ellipse otherwise.
这篇关于gnuplot-如何缩放xyrange以不考虑热图图中的小z的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!