I would like a way to choose the frame refresh rate for gifs. Let's take example from the translate method, but skip a few points between saves. I want the resulting gif to last the same amount of time as the original version, and to loop.
; Create the data.
x = FINDGEN(100)
y = 20 * Sin(x*2*!PI/25.0) * Exp(-0.01*x)
; Draw the sky and sea.
p = PLOT(x, y, XRANGE=[0,99], YRANGE=[-40,100], $
FILL_LEVEL=-40, $
AXIS_STYLE=0, MARGIN=0, DIMENSIONS=[500,400], $
BACKGROUND_COLOR="light sky blue", $
/FILL_BACKGROUND, FILL_COLOR="sea green", TRANSPARENCY=100)
; Draw the sun
e = ELLIPSE(0.9, 1, FILL_COLOR="yellow", COLOR="yellow")
; Determine the points for the boat to travel.
xx = 0.5*[-22,-19,-12,-7,8,13,18,23,0.5,0.5, $
13,8,0.5,0.5,8,3,-2,-7,0,0,-7,-12,0,0]
yy = 2*[3,-0.7,-1,-1.5,-1.5,-0.7,0.5,3,3,5, $
5,13,13,15,15,20,20,15,15,13,13,5,5,3]
; Draw the boat. Give a Z value to put the boat on top.
p1 = POLYGON(xx,yy,1,/DATA,FILL_COLOR="burlywood", CLIP=0)
; Translate p1 using data coordinates,
; translate e using device coordinates.
step = 10
FOR i=step,99,step DO BEGIN & $
p.SAVE, 'translatemethod_ex.gif', RES=96, /APPEND & $
p1.TRANSLATE, step, y[i]-y[i-step], /DATA & $
e.TRANSLATE, 1,-0.5 & $
ENDFOR
p.SAVE, 'translatemethod_ex.gif', RES=96, /APPEND, /CLOSE
|