Back to demo index

gnuplot demo script: heatmap_4D.dem

autogenerated by webify.pl on Fri Dec 20 14:46:49 2024
gnuplot version gnuplot 6.0 patchlevel 2
#
# Demonstrate use of 4th data column to color a 3D surface.
# Also demonstrate use of the pseudodata special file '++'.
# This plot is nice for exploring the effect of the 'l' and 'L' hotkeys.
#
set view 49, 28, 1, 1.48
set urange [ 5 : 35 ] noreverse nowriteback
set vrange [ 5 : 35 ] noreverse nowriteback
# set zrange [ 1.0 : 3.0 ] noreverse nowriteback
set ticslevel 0
set format cb "%4.1f"
set colorbox user size .03, .6 noborder
set cbtics scale 0

set samples 50, 50
set isosamples 50, 50

set title "4D data (3D Heat Map)"\
          ."\nIndependent value color-mapped onto 3D surface"  offset 0,1
set xlabel "x" offset 3, 0, 0 
set ylabel "y" offset -5, 0, 0
set label "z" at graph 0, 0, 1.1
set pm3d implicit at s

Z(x,y) = 100. * (sinc(x,y) + 1.5)
sinc(x,y) = sin(sqrt((x-20.)**2+(y-20.)**2))/sqrt((x-20.)**2+(y-20.)**2)
color(x,y) = 10. * (1.1 + sin((x-20.)/5.)*cos((y-20.)/10.))

splot '++' using 1:2:(Z($1,$2)):(color($1,$2)) with pm3d title "4 data columns x/y/z/color"


Click here for minimal script to generate this plot