1#
2# splot with boxes
3# Note: 3D boxes are implemented via the pm3d code so for commands
4# with both a pm3d and a non-pm3d variant you must use the former.
5#   "set pm3d depthorder" rather than "set hidden3d"
6#   "set pm3d border lc black" rather than "set style fill border lc black"
7#
8set boxwidth 0.4 abs
9set xyplane at 0
10set grid z vertical lw 1.0
11set yrange [0:6]
12set view 59, 24
13set pm3d border lc black
14
15rgbfudge(x) = x*51*32768 + (11-x)*51*128 + int(abs(5.5-x)*510/9.)
16ti(col) = sprintf("%d",col)
17
18set title '3D Boxes'
19splot for [col=5:4:-1] 'candlesticks.dat' using 1:(col):col \
20      with boxes title ti(col)
21
22pause -1 "hit return to continue"
23
24set title 'lc variable (from column 1)'
25splot for [col=5:4:-1] 'candlesticks.dat' using 1:(col):col:1 \
26      with boxes title ti(col) lc variable
27
28pause -1 "hit return to continue"
29
30set title 'lc rgb variable'
31splot for [col=5:4:-1] 'candlesticks.dat' using 1:(col):(col*column(col)):(rgbfudge($1)) \
32      with boxes title ti(col) lc rgb variable
33
34pause -1 "hit return to continue"
35
36set title "transparent boxes with imperfect depth sorting"
37unset key
38set style fill transparent solid 0.7
39set pm3d depthorder
40set grid x y z vertical
41splot for [col=1:5] 'candlesticks.dat' using 1:(col):(col*column(col)):(rgbfudge($1)) \
42      with boxes fc rgb variable
43
44pause -1 "hit return to continue"
45
46set title "give the boxes a 3D depth and correct depth sorting"
47set style fill solid
48set boxdepth 0.3
49set pm3d depthorder base
50set walls z0
51replot
52
53pause -1 "hit return to continue"
54
55set title 'Full treatment: 3D boxes with pm3d depth sorting and lighting'
56set pm3d lighting
57replot
58
59pause -1 "hit return to continue"
60reset
61