Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.GSO.4.56.0510061224040.13780@laurel.few.vu.nl>
Date: 2005-10-06T10:57:17Z
From: Katharine Mullen
Subject: playing with R: make a animated GIF file...
In-Reply-To: <mailman.11.1128592801.28547.r-help@stat.math.ethz.ch>

you could first make the frames to put together in R, then outside of R
glue the frames into a gif.

eg:

frames<-10
for(i in 1:frames) {
      jpeg(paste("ani_", i, ".jpg", sep = ""))
      plot(1:10,1:10, col = i)
      dev.off()
}

then use an image editing program to glue the jpgs together -- eg free and
crossplatform imagemagick (www.imagemagick.org).
under linux and once imagemagick is installed, the command

$ convert -delay 10 ani_*.jpg animation.gif

makes a looping animated gif `animation.gif' with 10/100 sec. between
frame flips.

----
Katharine Mullen
Department of Physics and Astronomy
Faculty of Sciences
Vrije Universiteit
de Boelelaan 1081
1081 HV Amsterdam
The Netherlands
room: T.1.06
tel: +31 205987870
fax: +31 205987992
e-mail: kate at nat.vu.nl
http://www.nat.vu.nl/~kate/