Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Mathematica, but already find it a very nice tool. Right now I am trying to create an animation of numeric data, where each frame corresponds to a distinct text file with a table-like content.

With one static frame (file) I can do the following:

file = "Desktop/d1.txt"
data = Import[file, "Table"]

Now, with multiple frames (files) I have to somehow animate a list of 2D lists, e.g.:

files = { "Desktop/d1.txt", "Desktop/d2.txt", "Desktop/d3.txt" }
data = Map[Import[#] &, files]

ListAnimate is said to accept a list:


,but it does not display the bitmap and shows a box with an advancing position bar and text representation of the data[[1]] . I would like to playback all the files' content as consecutive bitmaps. Should I somehow rearrange my 2D lists and/or may be ListAnimate is the wrong function for that task and I should use something else?

share|improve this question
1) ListAnimate 2) there is no ArrayPlot in AnimateList/ListAnimate. So is ListAnimate[ArrayPlot/@data] what you need? – Kuba Sep 14 '13 at 11:49
I am sorry for the typo, indeed it is ``ListAnimate''. – Student4K Sep 14 '13 at 21:35
up vote 2 down vote accepted

Here's an example that does work, like Kuba says you have to give ListAnimate a list of exactly the elements you want to cycle through.

ListAnimate[Table[ArrayPlot[RandomReal[1, {3, 3}]], {i, 100}], 10]


In your case:

ListAnimate[Map[ArrayPlot[Import[#,"Table"]] &, files]]

Observe that the real name of the function is ListAnimate and not AnimateList.

share|improve this answer

Another way to approach this is with Manipulate:

Manipulate[ArrayPlot[RandomReal[i, {5, 5}]], {i, 1, 100}]

This creates a slider that allows you to move through the various images. By clicking on the small + sign in the upper right you can choose autorun, and it will animate through the various data.

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.