1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
#
# Compare surface drawn "with pm3d" colored with a 7-color discrete palette
# to the same surface drawn "with contourfill"
#
set colorbox user origin 0.75,0.2 size 0.15, 0.6
set cbtics scale .1
set view ,,,1.2
unset key
set xrange [-8:8]
set yrange [-8:8]
set rmargin at screen 0.75
set xyplane 0
set isosamples 51
set samples 51
set pm3d border lt -1 lw 0.5
set pm3d depth
sinc(x) = (x==0) ? 1.0 : sin(x) / x
f(x,y) = sinc( sqrt(x*x + y*y) )
set label 1 "set palette cubehelix\nmaxcolors 7"
set label 1 at screen 0.825, 0.9 center
set palette cubehelix maxcolors 7
set label 2 "splot with pm3d"
set label 2 at screen 0.4, 0.9 center
splot f(x,y) with pm3d
pause -1 "<cr> to continue"
set label 2 "set contourfill cbtics\nsplot with contourfill"
set contourfill cbtics
splot f(x,y) with contourfill fs border lc "black" lw 0.5
pause -1 "<cr> to set contourfill ztics"
reset
#
# Illustrate work in progress on new plot style "with contourfill"
# The style options are
# set contourfill
# auto N N evenly spaced slices spanning zrange
# ztics slice boundary at every z axis major tic
# cbtics slice boundary at every cb axis major tic
#
# cbtics are still active even if the colorbox isn't shown,
# so an arbitrary set of slice boundaries can be constructe via
# set cbtics ( z1, z2, z3, z4, ... )
# unset colorbox
# set contourfill cbtics
#
# In all cases the fill color is taken from the palette value for the
# midpoint z of the slice. Other coloring methods are planned.
#
set key at screen 1, 0.9 right top
set samples 51
set isosamples 51
set contour surface
set xyplane 0
set zlabel "Z "
set zlabel offset character 1, 0, 0 font "" textcolor lt -1 norotate
unset xtics
unset ytics
set hidden3d back offset 0
set pm3d scansauto border lc "black" lw 0.5
set colorbox user origin 0.80,0.3 size 0.05, 0.5
set label 1 "set palette viridis"
set label 1 at screen 0.82, 0.9 center
set palette viridis
set cbtics 10 scale 5.
set label 2 "set contourfill ztics\nsplot with contourfill"
set label 2 at screen 0.4, 0.9 center
set cntrparam levels 5
g(x,y) = x**2 + y**2 * (1 - x)**3
set xrange [-1 : 5]
set yrange [-3 : 3]
set zrange [-10 : 10]
set view 60, 30, 0.8, 1.0
set lmargin screen 0
set bmargin screen 0
set contourfill ztics
splot g(x,y) with contourfill fs solid border lc "black" lw 0.5 notitle
pause -1 "<cr> for 2D projection"
#
# cbtics must match cntrparam increments
# turn off "pm3d depth" to superimpose contour lines
#
set title "set view map; splot with contourfill + contour lines"
unset label
set zrange [-25:25]
set cbrange [-21:21]
set cbtics -20, 5, 20
set contours
set cntrparam cubic
set cntrparam levels incremental -20, 5, 20
set cntrlabel onecolor
unset colorbox
unset hidden3d
set palette viridis positive
set contourfill cbtics
set pm3d scansauto border retrace
set view map
set tics scale 0
set key inside samplen .1 reverse
set key title "&{----} z = x^2 + y^2(1-x)^3"
splot g(x,y) with contourfill fs solid border notitle, \
g(x,y) nosurface lt black title "Contour levels Δz = 5"
pause -1 "<cr> to continue"
reset
|