Keywords: Shepard interpolation 2.png en Shepards interpolation method sampling a smooth function exp -x 2-y 2 See also File Shepard interpolation png 2012-05-07 own Hankwang cc-zero n set pm3d set pm3d map unset colorbox unset grid unset surf unset grid unset xtics unset ytics unset border set size square set xra 0 1 set yra 0 1 x0 0 05 y0 0 dx 0 2 /mkscatter pl > scatter dat set term png size 640 160 giant uncomment one of the sets below 0/1 points zfunc dum 3 set outp 'shepard_interpolation png' smooth function zfunc dum exp -8 1-0 5 2+ 2-0 5 2 set outp 'shepard_interpolation_2 png' unset key n 0 set bmargin at screen 0 05 set tmargin at screen 1 05 set multiplot set lmargin at screen x0+n dx; set rmargin at screen x0+ n+1 dx set dgrid3d 100 100 1 set label 1 'p 1' at screen x0+ n+ 5 dx 0 08 center splot 'scatter dat' using 1 2 zfunc 0 n n+1 set lmargin at screen x0+n dx; set rmargin at screen x0+ n+1 dx set dgrid3d 100 100 2 set label 1 'p 2' at screen x0+ n+ 5 dx 0 08 center splot 'scatter dat' using 1 2 zfunc 0 n n+1 set lmargin at screen x0+n dx; set rmargin at screen x0+ n+1 dx set dgrid3d 100 100 4 set label 1 'p 4' at screen x0+ n+ 5 dx 0 08 center splot 'scatter dat' using 1 2 zfunc 0 n n+1 set lmargin at screen x0+n dx; set rmargin at screen x0+ n+1 dx set dgrid3d 100 100 16 set colorbox set label 1 'p 16' at screen x0+ n+ 5 dx 0 08 center splot 'scatter dat' using 1 2 zfunc 0 unset multiplot set output Data <pre> /usr/bin/perl -w n 40; p 0 1; srand 6 ; for i 0; i < n; ++ i x rand 1 ; y rand 1 ; v rand 1 < p 1 0; print x y v\n ; </pre> Interpolation Images with Perl source code |