gnuplot demo script: animate2.dem

autogenerated by webify.pl on Mon Mar 12 11:55:04 2007
gnuplot version gnuplot 4.3 patchlevel CVS-14Feb2007

animate2.dem

#
# $Id: animate2.dem,v 1.1 2006/01/07 23:21:02 sfeam Exp $
#
# demo for creating GIF animation and illustrating saving images to
# file one pixel to one pixel
#
# A combination of what was animate.dem and world2.dem with the
# addition of saving the rotated image to an animated GIF.
# Requires GIF_ANIMATION
#
# History:
#   - 1. 3. 2006 Dan Sebald:  1st version
#    07 Jan 2006 Ethan Merritt:  Revise to assume terminal type is set by caller
#

# Caller must set terminal type.
# Example of intended use:
# set term gif animate transparent opt delay 10 size 200,200 x000000

unset title
unset key
unset xtics
unset ytics
unset ztics
set border 0
set hidden3d nooffset
set parametric
set angles degrees
set samples 64,64
set isosamples 13,13
set mapping spherical
set dummy u,v
set urange [ -90.0000 : 90.0000 ] noreverse nowriteback
set vrange [ 0.00000 : 360.000 ] noreverse nowriteback
set style data line

# Defines for gnuplot.rot script
limit_iterations=72
xrot=60
xrot_delta = 0
zrot=136
zrot_delta = 355
xview(xrot)=xrot
zview(zrot)=zrot
set view xview(xrot), zview(zrot), 2, 1
set size square

splot cos(u)*cos(v),cos(u)*sin(v),sin(u) notitle with lines lt 5, \
      'world.dat' notitle with lines lt 2 lw 3

iteration_count=0
xrot =(xrot+xrot_delta)%360
zrot =(zrot+zrot_delta)%360

load "gnuplot.rot"

gnuplot.rot

# A generic rotation routine for the gnuplot view.  In the commands
# that load this file, the following should be defined:
#
# iteration_count:  set iteration_count=0
#
# limit_iterations:  if set to a nonzero value, it'll stop after that
#     many iterations; if zero value, continues indefinitely
#
# xrot:  the initial x rotation of the view
#
# xrot_delta:  the amount to increment the x rotation for each new plot
#
# xview:  function for generating x view value; for example
#     xview(xrot)=(50.+30.*sin((xrot%180)/180.*pi))
#
# zrot:  the initial z rotation of the view
#
# zrot_delta:  the amount to increment the z rotation for each new plot
#
# zview:  function for generating z view value; for example
#     zview(zrot)=(60.+45.*sin(zrot/180.*pi))
#

iteration_count=iteration_count+1
if ((!limit_iterations) || (iteration_count<=limit_iterations)) \
  set view xview(xrot),zview(zrot); \
  replot; \
  zrot=(zrot+zrot_delta)%360; \
  xrot=(xrot+xrot_delta)%360; \
  reread