答案 0 :(得分:0)
一种选择是定义描述渐变的自定义函数(例如,高斯),然后使用pm3d map
将其可视化:
set terminal pngcairo size 400,400
set output 'fig.png'
unset border
unset colorbox
unset xtics
unset ytics
set pm3d map
#force the plot to occupy the entire canvas
set lmargin at screen 0
set rmargin at screen 1
set tmargin at screen 1
set bmargin at screen 0
set isosamples 100,100
#specify custom palette
set palette model RGB
set palette defined ( 0 "white", 1 "royalblue" )
set xr [-10:10]
set yr [-10:10]
#a Gaussian might be a reasonable choice
splot exp(-0.2*(x*x+y*y))
然后产生:
定义函数的另一个选择可能是:
set xr [-pi:pi]
set yr [-pi:pi]
fn(r) = (r>(pi/2))?0:(cos(r))
splot fn(sqrt(x*x+y*y))
这会产生:
答案 1 :(得分:0)