#
# The combination of iteration and 3D plotting was problematic
# in earlier gnuplot versions.  Be aware that this test plot
# would trigger an almost-infinite loop in versions prior to
# gnuplot 6.
# This demo serves as a unit test to check for regressions.
#
unset xtics
unset ytics
set border 16
set view 60., 345., 1., 0.75

splot for [j=0:*] "whale.dat" index j using 1:($2-1):($3+1) \
                               with lines lc "grey" notitle, \
      for [k=1:2] sin(x+k) with surface lc "dark-turquoise" notitle, \
      for [l=1:1] for [m=0:*] "whale.dat" index m using (2-$1):($2+1):($3+1) \
                               with lines lc "steelblue" notitle, \
      keyentry with lines lc "grey" title "Grey Whale", \
      keyentry with boxes lc "dark-turquoise" title "waves", \
      keyentry with lines lc "steelblue" title "Blue Whale"

pause -1 "<cr> to continue"

reset
