Back to demo index

gnuplot demo script: boxes3d.dem

autogenerated by webify.pl on Sat Mar 11 15:39:58 2023
gnuplot version gnuplot 5.4 patchlevel 7alpha
# 
# splot with boxes
# Note: 3D boxes are implemented via the pm3d code so for commands
# with both a pm3d and a non-pm3d variant you must use the former.
#   "set pm3d depthorder" rather than "set hidden3d"
#   "set pm3d border lc black" rather than "set style fill border lc black"
#
set boxwidth 0.4 abs
set xyplane at 0
set grid z vertical lw 1.0
set yrange [0:6]
set view 59, 24
set pm3d border lc black

rgbfudge(x) = x*51*32768 + (11-x)*51*128 + int(abs(5.5-x)*510/9.)
ti(col) = sprintf("%d",col)

set title '3D Boxes'
splot for [col=5:4:-1] 'candlesticks.dat' using 1:(col):col \
      with boxes title ti(col)


Click here for minimal script to generate this plot




set title 'lc variable (from column 1)'
splot for [col=5:4:-1] 'candlesticks.dat' using 1:(col):col:1 \
      with boxes title ti(col) lc variable


Click here for minimal script to generate this plot




set title 'lc rgb variable'
splot for [col=5:4:-1] 'candlesticks.dat' using 1:(col):(col*column(col)):(rgbfudge($1)) \
      with boxes title ti(col) lc rgb variable


Click here for minimal script to generate this plot




set title "transparent boxes with imperfect depth sorting"
unset key
set style fill transparent solid 0.7
set pm3d depthorder
set grid x y z vertical
splot for [col=1:5] 'candlesticks.dat' using 1:(col):(col*column(col)):(rgbfudge($1)) \
      with boxes fc rgb variable


Click here for minimal script to generate this plot




set title "give the boxes a 3D depth and correct depth sorting"
set style fill solid
set boxdepth 0.3
set pm3d depthorder base
set walls z0
replot


Click here for minimal script to generate this plot




set title 'Full treatment: 3D boxes with pm3d depth sorting and lighting'
set pm3d lighting
replot


Click here for minimal script to generate this plot