gnuplot - How to make zmin equal to zmax keeeping autoscale on z axis

此生再无相见时 提交于 2020-01-14 05:15:09

问题


How one could make resulting output of scaling over z axis symmetric over xy plane: zmax = zmin, keeping autoscale on z axis turning on? (GNUplot 5.0)

resulting graph - 3d-polar.png

Is there this possibility in GNUplot or only fixed range of cbrange can be used?

the example that is used for polar heatmap plot:

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

set parametric
set grid xtics ytics

set angles degree
set autoscale xfix
set autoscale yfix
set autoscale zfix
set palette model RGB defined ( 0"black", 1"white", 2"grey")
splot '_FullWV.dat' u ($2*cos($1)):($2*sin($1)):3
unset multiplot

The _FullWV.dat file is here.


回答1:


You can use stats to extract min and max of the 3rd column, and define cbrange accordingly.

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


来源:https://stackoverflow.com/questions/40656069/gnuplot-how-to-make-zmin-equal-to-zmax-keeeping-autoscale-on-z-axis

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